Stationary
Stationary is a dead simple tool to generate a static blog from markdown files. Its aims are to be;
- Simple to configure
- Simple to style
npm install -g stationary-md
Config
properties: author: name: Amman Vedi links: main: https://github.com/ammanvedi stylesheets: post: styles/post.scss index: styles/index.scss markdown: source: mock-markdown templates: index: templates/index.html post: templates/post.html output: directory: _generated/ extra: - template: templates/extra.html stylesheet: styles/extra.scss slug: test-extra
Markdown
Markdown is parsed and generated into html with Marked, so if it works here then it will be fine when passed through this generator
Markdown source directory should contain a set of markdown files and associated yaml metadata file
my-post.mdmy-post.yaml
The yaml file should contain metadata, here is an example
publishDate: "2020-06-16T18:00:28+0000"tags: - flow - javascript - type-theorytitle: flow's type inference quirkslug: flow-type-inference-quirk-vs-typescriptimageUrl: ''
this config will be passed to you in your templates
Templates
A template should be provided for the index page and the posts page. Both of these use handlebars syntax.
Index templates are passed the following model
Post templates are passed;
Examples
You can see a complete example usage in the test/
folder
Developing
npm install
- To install packages
npm run build
- To build the package
npm run mock
- to run the generator on some mock blog posts
npm run serve-test
- to start a server on port 6003 to view mock output