Skip to content

Commit e157fca

Browse files
committed
docs: update contributing section
1 parent fca89f8 commit e157fca

File tree

1 file changed

+40
-8
lines changed

1 file changed

+40
-8
lines changed

docs/content/docs/contributing/website.md

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,29 @@ The site is based on [hextra](https://github.com/imfing/hextra) theme.
1717

1818
## Templating
1919

20-
We use templates like `{.SomeField}` inside our `md` files.
20+
We use [shortcodes](https://gohugo.io/templates/types/#shortcode) and [partials](https://gohugo.io/templates/types/#partial) based on files from `./docs/.tmp/` and `./docs/data/`.
2121

22-
These templates are expanded by running `make website_expand_templates` in the root of the repository.
23-
It runs script `scripts/website/expand_templates/` that rewrites `md` files with replaced templates.
22+
- The files in `./docs/.tmp/` are used to be embedded with the shortcode `{{%/* embed file="filename.ext" */%}}`.
23+
- The files in `./docs/data/` are used as [data sources](https://gohugo.io/content-management/data-sources/).
24+
25+
These files are created by running:
26+
27+
- `make website_expand_templates` in the root of the repository.
28+
- `make website_dump_info` in the root of the repository. (only during a release)
29+
30+
### Some Notes
31+
32+
[shortcodes](https://gohugo.io/templates/types/#shortcode):
33+
- cannot be used inside another shortcode
34+
- can only be used inside a page
35+
- can contain Markdown or HTML, but the tag is different: `{{%/* shortcode */%}}` vs `{{</* shortcode */>}}`
36+
37+
[partials](https://gohugo.io/templates/types/#partial):
38+
- are reusable HTML blocks or "functions"
39+
- cannot be used inside a page
40+
- can be used inside another partial
41+
- can be used inside a shortcode
42+
- can be used inside a layout
2443

2544
## Hosting
2645

@@ -30,14 +49,24 @@ GitHub deploys the website to production after merging anything to a `main` bran
3049

3150
## Local Testing
3251

33-
Install Hugo (v0.148.1 or newer).
52+
Install Hugo Extended (v0.148.1 or newer).
3453

3554
Run:
3655

3756
```bash
38-
# (if in the root of the repository)
57+
# (in the root of the repository)
3958
make docs_serve
40-
# OR (if inside the docs/ folder)
59+
```
60+
61+
or
62+
63+
```bash
64+
# (in the root of the repository)
65+
make website_expand_templates
66+
67+
cd docs/
68+
69+
# (inside the docs/ folder)
4170
make serve
4271
```
4372

@@ -51,6 +80,9 @@ Also, there is no need to refresh a webpage: hot reload updates changed content
5180
To do this, run:
5281

5382
```bash
54-
# (only in the root of the repository)
55-
make website_expand_templates
83+
HUGO_ENVIRONMENT=production \
84+
HUGO_ENV=production \
85+
hugo \
86+
--gc --minify \
87+
--baseURL "https://golangci-lint.run/"
5688
```

0 commit comments

Comments
 (0)