A little exporter to move blog posts and categories from Serendipity (s9y) to Hugo. Comes with lot of assumptions.
Used to learn some sql/sqlx (for Golang). Meant as a POC — published in case anyone finds it useful.
./s9y-hugo
It will connect to MySQL (running on localhost/socket) and dump your entries into a structure of:
content
└── posts
├── cat-1
└── cat-2It will not:
- migrate/handle authors
- migrate/handle nested categories
- migrate/handle nested tags
- connect to a remote MySQL server
- configure Hugo (install theme, make changes to
hugo.yaml, ...)
Config (via environment variables):
DB_USERDB_PASSDB_NAMEDB_TABLE_PREFIX(default:s9y_)BLOG_URL(default:/blog)
The BLOG_URL is used to add an alias to each post so redirects will continue to work.