Fixes prettier formatting for go templates
The prettier-plugin-go-template is a formatter plugin for go template files. It is designed to work with Prettier, requiring it to be installed as a peer dependency. Starting with Prettier 3, auto-discovery has been removed, so configuration is now required. This plugin automatically detects certain file types like .gohtml, .gotmpl, .go.tmpl, .tmpl, .tpl, and .html.tmpl.
To use the plugin with GoHugo and basic .html files, you need to override the parser used in your .prettierrc file. It is recommended to have both Prettier and prettier-plugin-go-template installed globally or locally. If installed globally, you also need to set your VSCode prettier path to the global prettier path.
To install prettier-plugin-go-template, you need to have Prettier installed as a peer dependency. You can install both globally or locally using the following command:
npm install -g prettier prettier-plugin-go-template
Make sure that Prettier and prettier-plugin-go-template are installed in the same scope. If you choose the global installation, you also need to set your VSCode prettier path to the global prettier path.
Note: For GoHugo and basic .html files, you need to override the used parser in your .prettierrc file. Additional details can be found in the issue linked above.
prettier-plugin-go-template is a formatter plugin for go template files that works with Prettier. It requires configuration and supports auto-detection of various file types. It can be installed globally or locally, and supports GoHugo and basic .html files with some additional configuration. Contributions to the project are welcome.