For now, the configuration is a part of regular Spring
application.yaml (src/src/main/resources/application.yaml) file. Later there will be an opportunity to externalize all relevant settings (#7).
app: sources: source-1: wordpress-home: /optional/path/to/public_html1 wordpress-remote-base-url: http://optional.website1.org/ wordpress-table-prefix: some-table-prefix database: url: jdbc:mysql://localhost:3306/database1 username: root password: mysql tags: - 'regular' categories: - 'Basic posts' source-2: wordpress-home: /optional/path/to/public_html2 wordpress-remote-base-url: http://optional.website2.org/ target-resource-suffix: "-s" database: url: jdbc:mysql://localhost:3306/database2 username: root password: mysql tags: - 'extra' categories: - 'Limited edition posts' target: hugo-site-content-items-dir: output/blog/content/posts
Here multiple sources could be declared. Local or remote or both locations could be specified, tool automatically tries to find a resource. So if you do not have a local copy, but there a workable website, just put it.
wordpress-remote-base-url helps for detecting inner-site or external links. Because inner-site links should be transformed into the new "folders" structure.
Tags, categories and other taxomonies
categories could be assigned for specific sources. And, of course, original tokens will also be migrated.
Wordpress Table Prefix
Some of user maybe use table
prefix for wordpress instalation, you need to supply
prefix in configuration based on your wordpress table. The default value for prefix is
Typical content page layout
Freemarker template) to get an idea about configuring the target post composition.
All fields from original
Wordpress posts are propagated into
post object. With some additions:
postDirectoryName- path to the target
hugodirectory for the specific post;
thumbnailFilename- path to the thumbnail file;
taxonomy- taxonomy data as map -> (e.g.
Output 'hugo' structure
Just create an empty
hugo new site blog
And put its path to the tool configuration.
target: hugo-site-content-items-dir: output/blog/content/posts
Build and run
./gradlew clean build run