theNewDynamic / language-hugo-vscode

Adds syntax highlighting to Hugo files in VS Code
https://marketplace.visualstudio.com/items?itemName=budparr.language-hugo-vscode
Apache License 2.0
64 stars 20 forks source link

[Request] Beautify for hugo template syntax. #9

Open dtvn opened 4 years ago

dtvn commented 4 years ago

VSCode might appreciate a Hugo (Go HTML template) syntax beautifier. Still now, Hugo tags are treated as text nodes (pure text) in HTML format leads to its content always get indent backward. Something look like this:

Expectation:

{{ if "what-ever-cond-is" }}
    // A text node
{{ end }}

Reality:

{{ if "what-ever-cond-is" }}
// A text node
{{ end }}

Since we already have syntax highlighting for Hugo, maybe it is possible to do a beautifier for it?

brennanangel commented 1 year ago

We've been using this Prettier plugin for the last few years with Hugo. It's not perfect but it'll get you 85% of the way there: https://github.com/NiklasPor/prettier-plugin-go-template