n2h

command module
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2023 License: MIT Imports: 11 Imported by: 0

README

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!

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
log

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL