hugo repo template
.gitignore | ||
.prettierrc | ||
README.md |
Hugo Site
Welcome to your new hugo project
Here's some steps to get you started
hugo new site . --force
Add a theme to the themes folder:
using a submodule, generally recommended
git submodule add https://example.com/theme/<theme-name>.git ./themes/<theme-name>
hugo module
Init your project
hugo mod init github.com/<your_user>/<your_project>
Add the theme to your hugo config file
########################## hugo.yaml ##########################
module:
imports:
- path: https://example.com/theme/<theme-name>
########################## hugo.toml ##########################
[module]
[[module.imports]]
path = 'https://example.com/theme/<theme-name>'
########################## hugo.json ##########################
{
"module": {
"imports": [
{
"path": "https://example.com/theme/<theme-name>"
}
]
}
}
See more at the hugo docs
Prettier
This repository includes a .prettierrc file, to install prettier and the go plugin you can use npm
npm install --save-dev prettier prettier-plugin-go-template
Additional Options
// .prettierrc
{
/**
* Enables & disables spacing between go statements.
* E.g. {{ statement }} vs {{statement}}.
* Default: true
*/
"goTemplateBracketSpacing": true
}
Ignoring Code
Single Block
<div>
<!-- prettier-ignore -->
{{if }}
{{end }}
</div>
Multiline
<html>
{{/* prettier-ignore-start */}}
<script>
{{if }}
Whatever.
{{else }}
Psych.
{{end }}
</script>
{{/* prettier-ignore-end */}}
</html>
Please show the devs of prettier hugo some love
License
Here's a few to pick from: Open Source Initiative
Here's some I recommend: