Configure HTML files in IntelliJIDEA to recognize HUGO's GO Templates

Written by Lyoneel on in HUGO, IntelliJ Platform
 1 min

Configure HTML files in IntelliJIDEA to recognize HUGO's GO Templates

To create GO Templates, you have two options…

File specific configuration

If you have one or few files, you can just turn the syntax highlighting only to those files without affecting the global configuration.

You have to do right-click on the desired file, and then use the option Override File Type

image of a right-click menu when is clicked over a file inside IntelliJIDEA IDE file tree

A dialogue will pop out.

image of type selection menu after “override file type” option is executed

Scroll down until you find the type you desire, for this explanation will pick Go Template

You should do this operation on every file, if this way is not efficient for you, check Global Configurations.

Global configuration

To modify global configuration for the Hugo’s Html GOTemplates you have to go to menu File -> Settings...

settings file type dialog

Then you have to click in + button and add *.html, and leave blank the second field, press ok, you may be asked if you want to override the association, override it.

settings file type dialog for adding a new pattern

Now you should find visual change on icons and syntax-highlighting.


Thanks for reading!

Namaste.