next-static icon indicating copy to clipboard operation
next-static copied to clipboard

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

Open tgrecojs opened this issue 7 years ago • 1 comments

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!

tgrecojs avatar Aug 30 '17 02:08 tgrecojs

@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.

infiniteluke avatar Aug 30 '17 19:08 infiniteluke