diff options
author | Chen Xianmin <xianmin12@gmail.com> | 2022-10-15 17:20:12 +0300 |
---|---|---|
committer | Chen Xianmin <xianmin12@gmail.com> | 2022-10-15 17:20:12 +0300 |
commit | fd6ed71eaa87896c6988e26b464431bbf119b6bb (patch) | |
tree | 80d80cee6c526e03a6cf271a511201ce1865468e | |
parent | 58d7b87b02bdf2658135b10913a4b66026ded195 (diff) |
feat: add .prettierrc for prettier-plugin-go-template
-rw-r--r-- | .prettierrc | 11 | ||||
-rw-r--r-- | .vscode/settings.json | 3 | ||||
-rw-r--r-- | exampleSite/content/post/how-to-contribute.md | 53 |
3 files changed, 67 insertions, 0 deletions
diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..b7b5c51 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,11 @@ +{ + "overrides": [ + { + "files": ["*.html"], + "options": { + "parser": "go-template" + } + } + ], + "goTemplateBracketSpacing": true +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..63ac2a3 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "prettier.resolveGlobalModules": true +} diff --git a/exampleSite/content/post/how-to-contribute.md b/exampleSite/content/post/how-to-contribute.md new file mode 100644 index 0000000..b69a2d6 --- /dev/null +++ b/exampleSite/content/post/how-to-contribute.md @@ -0,0 +1,53 @@ ++++ +title = "How to Contribute" +description = "" +tags = [ + "go", + "golang", + "hugo", + "Contribute", +] +date = "2021-10-15" +categories = [ + "Development", + "index", +] ++++ + +## Contributing to Jane + +There are many ways to contribute to the Jane theme: submitting pull requests, reporting issues, providing new translations, and creating suggestions. + + +## Build and Run + +If you want to understand how Jane works, you'll want to get the source, build it, and run locally. + +### Getting the sources + +```bash +git clone https://github.com/xianmin/hugo-theme-jane.git +``` + +### Prerequisites + +You need install the `Hugo_extended` version to use [Hugo Pipes](https://gohugo.io/hugo-pipes/). + +We recommend that you use VSCode. And if you edit `.html` files, recommend you install prettier and [prettier-plugin-go-template](https://github.com/NiklasPor/prettier-plugin-go-template) **globally** . And open `Prettier: Resolve Global Modules` in your VSCode Settings. + +```bash +npm install -g prettier prettier-plugin-go-template +``` + + +### Watch example Site + +```bash +hugo server --contentDir='./exampleSite/content' --config='dev-config.toml' +``` + + +## Directory Structure + +- `layouts/` Stores templates in the form of .html files that specify how views of your content will be rendered into a static website. +- `assets/` stores all the scss & js **source files**, `Hugo Pipes` will bundle them to `resources/` folder. |