theNewDynamic / language-hugo-vscode

Adds syntax highlighting to Hugo files in VS Code

Home Page:https://marketplace.visualstudio.com/items?itemName=budparr.language-hugo-vscode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Request] Beautify for hugo template syntax.

dtvn opened this issue · comments

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?

commented

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