Hugo

From Giki

WordPress2Hugo

source: https://www.smashingmagazine.com/2019/05/switch-wordpress-hugo/

export wordpress contents

  1. wordpress admin center
  2. tools
  3. export
  4. all content
  5. save file to "/tmp/blog2md"

convert wordpress content to md files

  1. git clone https://github.com/palaniraja/blog2md.git
  2. npm install
  3. node index.js w gpunktschmitz039sblog.WordPress.2022-03-04.xml en_out paragraph-fix

wordpress plugin: export all urls

https://de.wordpress.org/plugins/export-all-urls/

rename files to {id}-{title}

$csv = Import-Csv -Path ./export-all-urls-123456.CSV 
foreach($entry in $csv) {
  $url = $entry.URLs.Replace('https://blog.gpunktschmitz.com/','')
  $file = '{0}.md' -f $url.Substring(($url.IndexOf('-')+1))
  if(Test-Path -Path $file) {
    Move-Item -Path $file -Destination $('{0}.md' -f $url)
  }
}

Install Hugo on Windows

winget install Hugo.Hugo.Extended

or

winget install Hugo.Hugo

After the installation is completed all Windows terminals/consoles have to be closed/restarted to use the alias and the PATH-change takes effect.

Output

C:\>winget install Hugo.Hugo.Extended
Found Hugo (Extended) [Hugo.Hugo.Extended] Version 0.113.0
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Successfully verified installer hash
Extracting archive...
Successfully extracted archive
Starting package install...
Command line alias added: "hugo"
Path environment variable modified; retart your shell to use the new value.
Successfully installed