This commit is contained in:
Brooke 2024-05-03 19:23:30 -04:00
parent b031f4e6a8
commit a79c2ad5a2
2 changed files with 122 additions and 2 deletions

15
.prettierrc Normal file
View file

@ -0,0 +1,15 @@
{
"plugins": [
"prettier-plugin-go-template"
],
"overrides": [
{
"files": [
"*.html"
],
"options": {
"parser": "go-template"
}
}
]
}

109
README.md
View file

@ -1,3 +1,108 @@
# hugo
# Hugo Site
hugo repo template
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](https://gohugo.io/hugo-modules/use-modules/)
## 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
```js
// .prettierrc
{
/**
* Enables & disables spacing between go statements.
* E.g. {{ statement }} vs {{statement}}.
* Default: true
*/
"goTemplateBracketSpacing": true
}
```
#### Ignoring Code
##### Single Block
```html
<div>
<!-- prettier-ignore -->
{{if }}
{{end }}
</div>
```
##### Multiline
```html
<html>
{{/* prettier-ignore-start */}}
<script>
{{if }}
Whatever.
{{else }}
Psych.
{{end }}
</script>
{{/* prettier-ignore-end */}}
</html>
```
[Please show the devs of prettier hugo some love](https://github.com/NiklasPor/prettier-plugin-go-template)
## License
Here's a few to pick from: [Open Source Initiative](https://opensource.org/license)
Here's some I recommend:
- [GNU General Public License v3](https://www.gnu.org/licenses/gpl-3.0.en.html#license-text)
- [MIT](https://mit-license.org/)