Это лучший инструмент для переноса экспорта WordPress в Hugo. Он обрабатывает несколько странных крайних случаев, с которыми я столкнулся при попытке перенести свой личный веб-сайт на сайт на базе Hugo.
Хотя это в первую очередь предназначено для генерации кода на основе Hugo, его можно использовать для преобразования блогов WordPress в файлы на основе Markdown, которые можно использовать с другими системами, например Mkdocs или Jekyll.
Я хочу, чтобы этот проект был как можно более доступным и при этом финансировал затраты на разработку. Этот проект полностью бесплатен для некоммерческого и личного использования. Коммерческое использование ограничено лицензией. Не стесняйтесь обращаться ко мне, если вы хотите лицензировать это на коммерческой основе.
wp2hugo
из выпусковTools -> Export
в панели администратора.wordpress-export.xml
Создайте веб-сайт, используя $ 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
с RSS- feed.xml
Хьюго.xmlSummary
в Hugo googlemaps
wp-content/uploads
встроенных в страницы, в статические файлы Hugo, сохраняя при этом относительные URL-адреса. Существующие инструменты выполняют лишь наполовину работу по переносу контента. Они редко переносят метаданные, такие как GUID, встраивания YouTube, встраивания Google Map и встраивание кода должным образом.
В этом репозитории содержится экспериментальный инструмент hugomanager
. Я использую этот инструмент для автоматического создания URL-адресов из заголовка, а также для того, чтобы узнать, какие сообщения в блоге все еще отмечены как черновики, а какие планируется опубликовать в ближайшее время.
Вы можете построить это через
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.
Примечание: