Hugo supports hugo.toml、hugo.yaml、hugo.json format and follow the order, supporting split configuration file by envirament, root configuration key, and language.
Note
See Hugo Documentation for more details.
Hugo Narrow uses split configuration with YAML.
1exampleSite/
2├── config/
3│ └── _default/
4│ ├── hugo.yaml
5│ ├── languages.yaml
6│ ├── menus.yaml
7│ └── params.yaml
8└── content/The site configuration is not much different from that of a regular Hugo site; the special part is:
permalinks.projectssets the permalinks for projects.outputFormats.WebAppManifestautomatically generates theWebAppManifestconfiguration for the theme.highlight.lineNumbersInTableneeds to be set tofalse.highlight.stylesetting does not take effect. To change the Hugo Narrow codeblock style, you need to modify the CSS files.- The minimum required version of Hugo is 0.146.
1baseURL: https://hugo-narrow.vercel.app/
2languageCode: en-US
3defaultContentLanguage: en
4defaultContentLanguageInSubdir: false
5title: Hugo Narrow
6theme: "hugo-narrow"
7
8hasCJKLanguage: true
9enableEmoji: true
10
11permalinks:
12 posts: /posts/:slug/
13 projects: /projects/:slug/
14 pages: /:slug/
15
16pagination:
17 pagerSize: 6
18 path: "page"
19
20taxonomies:
21 category: categories
22 tag: tags
23 series: series
24
25markup:
26 tableOfContents:
27 startLevel: 2
28 endLevel: 4
29 ordered: false
30 goldmark:
31 renderer:
32 unsafe: true
33 extensions:
34 extras:
35 delete:
36 enable: true
37 insert:
38 enable: true
39 mark:
40 enable: true
41 subscript:
42 enable: false
43 superscript:
44 enable: false
45 strikethrough: false
46 highlight:
47 codeFences: true
48 guessSyntax: false
49 lineNos: false
50 lineNumbersInTable: false # Set to false
51 noClasses: false
52 style: github # No need to change
53 tabWidth: 2
54
55outputs:
56 home: ["HTML", "RSS", "JSON", "WebAppManifest"]
57
58# Custom output
59outputFormats:
60 WebAppManifest:
61 mediaType: "application/manifest+json"
62 baseName: "site"
63 isPlainText: true
64
65module:
66 hugoVersion:
67 extended: true
68 min: 0.146.0主要 Sections
Hugo Narrow could configure the main sections, which are used for global search.
1mainSections: ["posts", "projects", "pages"]The recent posts of home page will use the first section.