An installable Golang library for converting your Notion pages into a markdown file in your Hugo blog.
I love writing in Notion! But want to keep my Hugo blog alive. This is my solution.
For a more comprehensive breakdown of this project, check out my blog post Write in Notion, Publish with Hugo.
This package lives in your /usr/bin
and can be called from anywhere to create a new Hugo draft from a page in Notion. Right now this supports converting this items from Notion:
- Bold
- Italic
- Strikethrough
- Inline Code
- Bulleted List (1 level deep)
- Headers
- Links
- Code Blocks (via Github Gists)
- Clone the repo &
cd n2h
- Copy secrets with
cp secrets-example.yml secrets.yml
- Replace variables with your data (See blog post for more info how)
- Run
make install
Run n2h --help
to see the accepted params.
If I had a blog article "How I Use Notion at Work" that lived in the database "My Thoughts" and had a "Writing Status" property that was equal to "Ready to publish", I would run:
n2h -status-property="Writing Status" -status="Ready to publish" -title="How I Use"
And an new .md
file would show up in my blog directory.
Happy writing!