Closed michael-proulx closed 2 years ago
@michael-proulx That's interesting... I'm assuming the file extension is either html
or njk
?
Yes it's index.njk
@michael-proulx
I have a working modification that extends the YAML support so the highlighting does not break.
As of right now, this is more of a workaround, since I just included some regex to accommodate 11ty's custom frontmatter.
https://user-images.githubusercontent.com/402910/173114602-33f28c24-2f09-4257-9110-4d3f449ad8a2.mp4
@michael-proulx
I'll do some more research on how to add additional syntax highlighting for embedded grammars like json
/toml
/js
but right now I don't know if there is a way to do this inside of frontmatter.
Nice thank you !! :)
As of the current version, I see something like this:
When the specified language is HTML: Only the frontmatter has syntax highlighting. (It's a monochrome theme, but still.)
When the specified language is Nunjucks: Highlighting more broken.
Plus tooltips for HTML tags no longer work. I've added the emmet
configs mentioned in multiple extensions but can't be sure this's even meant to re0enable tooltips or something else entirely.
As of the current version, I see something like this:
When the specified language is HTML: Only the frontmatter has syntax highlighting. (It's a monochrome theme, but still.)
When the specified language is Nunjucks: Highlighting more broken.
Plus tooltips for HTML tags no longer work. I've added the
emmet
configs mentioned in multiple extensions but can't be sure this's even meant to re0enable tooltips or something else entirely.
@munael Could you provide me a little more context or the file you're trying to get syntax highlighting working from the looks of it you're trying to use XML and change the grammar to Nunjucks, is that accurate?
Also, your YAML is not valid from the screenshots:
it should be:
---
title: Giffleball
images:
- ???.jpg
- ,,,.jpg
- parrot.gif
---
Very good plugin, I found an issue for specific file configuration with 11ty.
I'm using the before callback for a specific file, because I need to filter my variable for localisation, normally I do not need that, because I do create page in every languages.
But using ---js broke syntax highlighting but it is required for 11ty (https://www.11ty.dev/docs/pagination/#the-before-callback)
https://user-images.githubusercontent.com/23478544/173084613-3f14d43d-a957-4af3-8cc7-f7249d63f604.mp4