callaars / markdown-to-blog

Super rough Markdown (technically Notion export to Markdown) to blog so I can publish with ease to https://callaa.rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

markdown-to-blog

This is a simple super-unsafe script that allows me to use exported Notion-to-markdown pages and convert them to my blog post format.

It uses a markdown file with a very specific layout (see the test markdown) and converts it into a HTML file.

How to use

Run with the markdown file you want to convert as the argument to the script.

$ yarn install
$ node index.js ./test-data/test.md

See the test markdown to see the layout. After running it will create (hopefully) a directory + index.html file in the output directory.

Change the template

You can change it all you want. It will search for one of the following tags to insert the data:

  • %title%, this is where the title will be inserted. The first line of the markdown file is used as the title.
  • %date%, this is where the date is written in the form "Month Year".
  • %content%, this is where the blog post is written, it is fetched from line 7 and onwards in the markdown file.

This script is unsafe/stupid/unhelpful/doesn't do/blabla...

Yup, it's an internal tool only and it works perfectly for what I want it to do. šŸ§ 

About

Super rough Markdown (technically Notion export to Markdown) to blog so I can publish with ease to https://callaa.rs

License:MIT License


Languages

Language:HTML 55.2%Language:JavaScript 44.8%