lando-systems / site

Website: https://lando.systems
0 stars 0 forks source link

Game posts in markdown format #4

Open bploeckelman opened 1 year ago

bploeckelman commented 1 year ago

Markdown formatted files can be converted to html with micromark either at runtime or via a build step that generates html fragments for each markdown file in a directory.

import {micromark} from 'https://esm.sh/micromark@4.0.0?bundle';
// markdown text either set inline or with fetch(src).text()
let markdown = '...'; 
let html = micromark(md);

Generating the markup as a build step is preferable for performance reasons, but still have to figure out how best to do that automatically. Maybe a pre-commit hook or gitlab action?

Also need to settle on a format for frontmatter if we decide to use it, though most relevant info will probably be in the game-attribs file so it might not be needed.