infiniteluke / next-static

A simple static blog powered by next.js
MIT License
105 stars 9 forks source link

Support a "supportedLanguages" configuration option which loads respective prism.js formatters #10

Open tgrecojs opened 7 years ago

tgrecojs commented 7 years ago

I'm currently migrating my blog posts over to next-static and i'm getting an error trying to use a block of .sh code. Wondering if you got any input on this!

infiniteluke commented 7 years ago

@tgrecojs Unfortunately prism doesn't allow languages to be dynamically added in a SSR environment (at least that I've found). If they did, I would add a config option to allow an array of supported languages. For now I have added bash since it's an obvious one that should be supported.

See https://github.com/infiniteluke/next-static/commit/d9017ce9380bc9eef8b034799019c42d76a7993f for how I did that.

I will look into a better way to handle this in the future as continually adding support for languages isn't needed.