Skip to content
/ n2h Public

A golang library for converting your Notion pages into a markdown file, in this case, specifically for a Hugo blog.

License

Notifications You must be signed in to change notification settings

joshmenden/n2h

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

n2h — Notion to Hugo

An installable Golang library for converting your Notion pages into a markdown file in your Hugo blog.

Background

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)

Setup

  1. Clone the repo & cd n2h
  2. Copy secrets with cp secrets-example.yml secrets.yml
  3. Replace variables with your data (See blog post for more info how)
  4. Run make install

Usage

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!

About

A golang library for converting your Notion pages into a markdown file, in this case, specifically for a Hugo blog.

Resources

License

Stars

Watchers

Forks

Packages

No packages published