diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..546dcf9 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,15 @@ +{ + "plugins": [ + "prettier-plugin-go-template" + ], + "overrides": [ + { + "files": [ + "*.html" + ], + "options": { + "parser": "go-template" + } + } + ] + } \ No newline at end of file diff --git a/README.md b/README.md index a067cf0..89a69ef 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,108 @@ -# hugo +# Hugo Site -hugo repo template \ No newline at end of file +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/.git ./themes/ +``` +### hugo module +Init your project +``` +hugo mod init github.com// +``` +Add the theme to your hugo config file +``` +########################## hugo.yaml ########################## + +module: + imports: + - path: https://example.com/theme/ + +########################## hugo.toml ########################## + +[module] + [[module.imports]] + path = 'https://example.com/theme/' + +########################## hugo.json ########################## + +{ + "module": { + "imports": [ + { + "path": "https://example.com/theme/" + } + ] + } +} + +``` + +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 +
+ + {{if }} + {{end }} +
+``` + +##### Multiline + +```html + + {{/* prettier-ignore-start */}} + + {{/* prettier-ignore-end */}} + +``` +[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/) \ No newline at end of file