Dies ist der beste Migrator für die Migration des WordPress-Exports nach Hugo. Es behandelt mehrere seltsame Grenzfälle, auf die ich gestoßen bin, als ich versucht habe, meine persönliche Website auf eine Hugo-basierte Website zu migrieren.
Während dies in erster Linie auf die Hugo-basierte Codegenerierung abzielt, kann man damit auch WordPress-Blogs in Markdown-basierte Dateien konvertieren, die mit anderen Systemen wie Mkdocs oder Jekyll verwendet werden können.
Ich möchte, dass dieses Projekt so weit wie möglich zugänglich ist und gleichzeitig die Entwicklungskosten finanziert werden kann. Dieses Projekt ist für den nichtkommerziellen und persönlichen Gebrauch völlig kostenlos. Die kommerzielle Nutzung ist über eine Lizenz eingeschränkt. Kontaktieren Sie mich gerne, wenn Sie dies kommerziell lizenzieren möchten.
wp2hugo
Tool von Releases herunterTools -> Export
in Ihrem Admin-Dashboardwordpress-export.xml
Generieren Sie die Website mit $ wp2hugo --source wordpress-export.xml --download-media
$ wp2hugo
Usage of wp2hugo:
-authors string
CSV list of author name(s), if provided, only posts by these authors will be processed
-color-log-output
enable colored log output, set false to structured JSON log (default true)
-continue-on-media-download-error
continue processing even if one or more media downloads fail
-download-media
download media files embedded in the WordPress content
-font string
custom font for the output website (default " Lexend " )
-media-cache-dir string
dir path to cache the downloaded media files (default " /tmp/wp2hugo-cache " )
-output string
dir path to write the Hugo-generated data to (default " /tmp " )
-source string
file path to the source WordPress XML file
$ git clone [email protected]:ashishb/wp2hugo.git
$ cd wp2hugo/src/wp2hugo
$ make build_prod
# `./bin/wp2hugo` will contain the binary and you can use it as `$ ./bin/wp2hugo --source wordpress-export.xml --download-media`
wp2hugo
feed.xml
von WordPress dem RSS- feed.xml
von Hugo zuSummary
in Hugo googlemaps
wp-content/uploads
Bilder in statische Hugo-Dateien und behalten Sie dabei die relativen URLs bei Bestehende Tools erledigen die Migration von Inhalten nur halbherzig. Sie migrieren die Metadaten wie GUID, YouTube-Einbettungen, Google Map-Einbettungen und Code-Einbettungen selten ordnungsgemäß.
Dieses Repository enthält ein experimentelles Tool, hugomanager
. Ich nutze dieses Tool zur automatischen Generierung von URLs aus Titeln und um zu erfahren, welche Blog-Beiträge noch als Entwurf markiert sind oder bald veröffentlicht werden sollen.
Sie können das über erstellen
src/wp2hugo $ make build_hugo_manager
...
src/wp2hugo $ ./bin/hugomanager
A tool for managing Hugo sites e.g. adding URL suggestions, generating site status summary etc.
Usage:
hugomanager [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
help Help about any command
sitesummary Print site stats (e.g. number of posts, number of drafts etc.)
urlsuggest Suggests URLs for all the pending/future posts that are missing a URL
version Print the version number of HugoManager
Flags:
-a, --author string author name for copyright attribution (default " YOUR NAME " )
--config string config file (default is $HOME /.cobra.yaml)
-h, --help help for hugomanager
-l, --license string name of license for the project
--viper use Viper for configuration (default true)
Use " hugomanager [command] --help " for more information about a command.
Notiz: