Can we intelligently inject languages into go templates? Do you want HTML as a default? #13884
Unanswered
David-Else
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
At the moment the only injections are comments, I think the following should work to inject HTML into the raw text that comprises of anything that is not part of the template itself:
But making that default would make everything inside the template highlight as HTML. I am very new to go templates, maybe we only need to add script and style elements to cover most use cases, something like (just pseudocode):
It seems like go templates are currently a bit useless with no languages injected? HTML is the one I am most after for use in Hugo. There is a discussion about using other file extensions in progress: gohugoio/hugo#10449, but
.html
is currently the default.Does anyone else want any other languages injected, I am hoping for a new default.
Beta Was this translation helpful? Give feedback.
All reactions