mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 06:00:25 +03:00
Squashed 'docs/' changes from 227aab619..8390a4a3a
8390a4a3a Add Void Linux installation instructions
d6099aae8 Update link to PostCSS plugins
25dad4693 netlify: Hugo 0.139.4
2b1fa118c Fix typo
3ef1eb505 Update hosting-on-aws-amplify
c0f6d35d6 Fix typo
aa54d4301 Correct directory name
98aa26bdb Improve instructions for hosting with AWS Amplify
a07638a80 Add new-in badges
6ad018055 netlify: Hugo 0.139.3
1050835d6 Update title of hugo.Store page
ebbd2e851 Clarify the shortcode Ordinal method
b7716ed95 Revise code block render hook for Mermaid diagrams
f1da9b6ea netlify: Hugo 0.139.2
d8ac9f428 Downgrade the Go toolchain in go.mod to a slightly older Go version
254b3c4f2 netlify: Hugo 0.139.1
03e666038 Add hugo.Store, site.Store and Shortcode.Store
157e8983b Update Anchorize.md
59fa9f214 Document the PageRef menu entry method
bda544cce docs(transform.Unmarshal): match lang attribute to title language in examples
1985886bd Adjust front matter of shared Markdown snippets
da5bd70d1 Fix typo
431b65d6b Update theme
b63ef69f5 Update style guidance
d50ed3422 Remove old new-in badges
12bfb9933 Update docs.yaml
0b936cacd netlify: Hugo 0.139.0
ab7668b4d dartsass: Add silenceDeprecations option
154df9bfc Merge commit '838bd312b1
'
efa80477c docs: Regen CLI docs
ad99e4a7a docs: Regenerate CLI docs
git-subtree-dir: docs
git-subtree-split: 8390a4a3ac36094f4cf47170af23b636608c420e
This commit is contained in:
parent
838bd312b1
commit
e477373487
118 changed files with 709 additions and 251 deletions
|
@ -22,8 +22,15 @@
|
|||
{{ $releases = where $releases "draft" false }}
|
||||
{{ $releases = where $releases "prerelease" false }}
|
||||
{{ range $releases | first 20 }}
|
||||
{{ $publishDate := .published_at | time.AsTime }}
|
||||
|
||||
{{/* Correct the v0.138.0 release date. See https://github.com/gohugoio/hugo/issues/13066. */}}
|
||||
{{ if eq .name "v0.138.0" }}
|
||||
{{ $publishDate = "2024-11-06T11:22:34Z" | time.AsTime }}
|
||||
{{ end }}
|
||||
|
||||
{{ $ctx := dict
|
||||
"Date" (.published_at | time.AsTime)
|
||||
"Date" $publishDate
|
||||
"Title" (printf "Release %s" .name)
|
||||
"Permalink" .html_url
|
||||
"Section" "news"
|
||||
|
|
|
@ -21,14 +21,21 @@
|
|||
{{- $releases = where $releases "draft" false }}
|
||||
{{- $releases = where $releases "prerelease" false }}
|
||||
{{- range $releases | first 20 }}
|
||||
{{- $publishDate := .published_at | time.AsTime }}
|
||||
|
||||
{{- /* Correct the v0.138.0 release date. See https://github.com/gohugoio/hugo/issues/13066. */}}
|
||||
{{- if eq .name "v0.138.0" }}
|
||||
{{- $publishDate = "2024-11-06T11:22:34Z" | time.AsTime }}
|
||||
{{- end }}
|
||||
|
||||
{{- $summary := printf
|
||||
"Hugo %s was released on %s. See [release notes](%s) for details."
|
||||
.tag_name
|
||||
(.published_at | time.AsTime | time.Format "2 Jan 2006")
|
||||
($publishDate | time.AsTime | time.Format "2 Jan 2006")
|
||||
.html_url
|
||||
}}
|
||||
{{- $ctx := dict
|
||||
"PublishDate" (.published_at | time.AsTime)
|
||||
"PublishDate" $publishDate
|
||||
"Title" (printf "Release %s" .name)
|
||||
"Permalink" .html_url
|
||||
"Section" "news"
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<h2>{{ $heading }}</h2>
|
||||
<ul>
|
||||
{{- range . }}
|
||||
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
||||
<li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
|
||||
{{- end }}
|
||||
</ul>
|
||||
{{- end }}
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
# github.com/gohugoio/gohugoioTheme v0.0.0-20241105120803-6c6e5fb8f8af
|
||||
# github.com/gohugoio/gohugoioTheme v0.0.0-20241119115653-b92d27ede3e1
|
||||
|
||||
|
|
|
@ -33,7 +33,6 @@ hugo [flags]
|
|||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
-c, --contentDir string filesystem path to content directory
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
--disableKinds strings disable different kind of pages (home, RSS etc.)
|
||||
--enableGitInfo add Git revision, date, author, and CODEOWNERS info to the pages
|
||||
|
@ -64,7 +63,6 @@ hugo [flags]
|
|||
-t, --theme strings themes to use (located in /themes/THEMENAME/)
|
||||
--themesDir string filesystem path to themes directory
|
||||
--trace file write trace to file (not useful in general)
|
||||
-v, --verbose verbose output
|
||||
-w, --watch watch filesystem for changes and recreate as needed
|
||||
```
|
||||
|
||||
|
|
|
@ -33,7 +33,6 @@ hugo build [flags]
|
|||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
-c, --contentDir string filesystem path to content directory
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
--disableKinds strings disable different kind of pages (home, RSS etc.)
|
||||
--enableGitInfo add Git revision, date, author, and CODEOWNERS info to the pages
|
||||
|
@ -64,7 +63,6 @@ hugo build [flags]
|
|||
-t, --theme strings themes to use (located in /themes/THEMENAME/)
|
||||
--themesDir string filesystem path to themes directory
|
||||
--trace file write trace to file (not useful in general)
|
||||
-v, --verbose verbose output
|
||||
-w, --watch watch filesystem for changes and recreate as needed
|
||||
```
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@ See each sub-command's help for details on how to use the generated script.
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -34,7 +33,6 @@ See each sub-command's help for details on how to use the generated script.
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -48,7 +48,6 @@ hugo completion bash
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -57,7 +56,6 @@ hugo completion bash
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -39,7 +39,6 @@ hugo completion fish [flags]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -48,7 +47,6 @@ hugo completion fish [flags]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -36,7 +36,6 @@ hugo completion powershell [flags]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -45,7 +44,6 @@ hugo completion powershell [flags]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -50,7 +50,6 @@ hugo completion zsh [flags]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -59,7 +58,6 @@ hugo completion zsh [flags]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -34,7 +34,6 @@ hugo config [command] [flags]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -43,7 +42,6 @@ hugo config [command] [flags]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -28,7 +28,6 @@ hugo config mounts [flags] [args]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -37,7 +36,6 @@ hugo config mounts [flags] [args]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -27,7 +27,6 @@ See convert's subcommands toJSON, toTOML and toYAML for more information.
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -36,7 +35,6 @@ See convert's subcommands toJSON, toTOML and toYAML for more information.
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -28,7 +28,6 @@ hugo convert toJSON [flags] [args]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -39,7 +38,6 @@ hugo convert toJSON [flags] [args]
|
|||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
--unsafe enable less safe operations, please backup first
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -28,7 +28,6 @@ hugo convert toTOML [flags] [args]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -39,7 +38,6 @@ hugo convert toTOML [flags] [args]
|
|||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
--unsafe enable less safe operations, please backup first
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -28,7 +28,6 @@ hugo convert toYAML [flags] [args]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -39,7 +38,6 @@ hugo convert toYAML [flags] [args]
|
|||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
--unsafe enable less safe operations, please backup first
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -38,7 +38,6 @@ hugo deploy [flags] [args]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -47,7 +46,6 @@ hugo deploy [flags] [args]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -27,7 +27,6 @@ hugo env [flags] [args]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -36,7 +35,6 @@ hugo env [flags] [args]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -23,7 +23,6 @@ Generate documentation for your project using Hugo's documentation engine, inclu
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -32,7 +31,6 @@ Generate documentation for your project using Hugo's documentation engine, inclu
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -33,7 +33,6 @@ hugo gen chromastyles [flags] [args]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -42,7 +41,6 @@ hugo gen chromastyles [flags] [args]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -33,7 +33,6 @@ hugo gen doc [flags] [args]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -42,7 +41,6 @@ hugo gen doc [flags] [args]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -30,7 +30,6 @@ hugo gen man [flags] [args]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -39,7 +38,6 @@ hugo gen man [flags] [args]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -25,7 +25,6 @@ Import requires a subcommand, e.g. `hugo import jekyll jekyll_root_path target_p
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -34,7 +33,6 @@ Import requires a subcommand, e.g. `hugo import jekyll jekyll_root_path target_p
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -30,7 +30,6 @@ hugo import jekyll [flags] [args]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -39,7 +38,6 @@ hugo import jekyll [flags] [args]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -25,7 +25,6 @@ List requires a subcommand, e.g. hugo list drafts
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -34,7 +33,6 @@ List requires a subcommand, e.g. hugo list drafts
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -27,7 +27,6 @@ hugo list all [flags] [args]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -36,7 +35,6 @@ hugo list all [flags] [args]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -27,7 +27,6 @@ hugo list drafts [flags] [args]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -36,7 +35,6 @@ hugo list drafts [flags] [args]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -27,7 +27,6 @@ hugo list expired [flags] [args]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -36,7 +35,6 @@ hugo list expired [flags] [args]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -27,7 +27,6 @@ hugo list future [flags] [args]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -36,7 +35,6 @@ hugo list future [flags] [args]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -27,7 +27,6 @@ hugo list published [flags] [args]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -36,7 +35,6 @@ hugo list published [flags] [args]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -34,7 +34,6 @@ See https://gohugo.io/hugo-modules/ for more information.
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -43,7 +42,6 @@ See https://gohugo.io/hugo-modules/ for more information.
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -34,7 +34,6 @@ hugo mod clean [flags] [args]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -43,7 +42,6 @@ hugo mod clean [flags] [args]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -58,7 +58,6 @@ hugo mod get [flags] [args]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -67,7 +66,6 @@ hugo mod get [flags] [args]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -35,7 +35,6 @@ hugo mod graph [flags] [args]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -44,7 +43,6 @@ hugo mod graph [flags] [args]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -39,7 +39,6 @@ hugo mod init [flags] [args]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -48,7 +47,6 @@ hugo mod init [flags] [args]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -27,7 +27,6 @@ hugo mod npm [command] [flags]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -36,7 +35,6 @@ hugo mod npm [command] [flags]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -42,7 +42,6 @@ hugo mod npm pack [flags] [args]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -51,7 +50,6 @@ hugo mod npm pack [flags] [args]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -28,7 +28,6 @@ hugo mod tidy [flags] [args]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -37,7 +36,6 @@ hugo mod tidy [flags] [args]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -34,7 +34,6 @@ hugo mod vendor [flags] [args]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -43,7 +42,6 @@ hugo mod vendor [flags] [args]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -33,7 +33,6 @@ hugo mod verify [flags] [args]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -42,7 +41,6 @@ hugo mod verify [flags] [args]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -30,7 +30,6 @@ Ensure you run this within the root directory of your site.
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -39,7 +38,6 @@ Ensure you run this within the root directory of your site.
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -42,7 +42,6 @@ hugo new content [path] [flags]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -51,7 +50,6 @@ hugo new content [path] [flags]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -31,7 +31,6 @@ hugo new site [path] [flags]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -40,7 +39,6 @@ hugo new site [path] [flags]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -30,7 +30,6 @@ hugo new theme [name] [flags]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -39,7 +38,6 @@ hugo new theme [name] [flags]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -54,6 +54,7 @@ hugo server [command] [flags]
|
|||
--noChmod don't sync permission mode of files
|
||||
--noHTTPCache prevent HTTP caching
|
||||
--noTimes don't sync modification time of files
|
||||
-O, --openBrowser open the site in a browser after server startup
|
||||
--panicOnWarning panic on first WARNING log
|
||||
--poll string set this to a poll interval, e.g --poll 700ms, to use a poll based approach to watch for file system changes
|
||||
-p, --port int port on which the server will listen (default 1313)
|
||||
|
@ -80,7 +81,6 @@ hugo server [command] [flags]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -89,7 +89,6 @@ hugo server [command] [flags]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -24,7 +24,6 @@ hugo server trust [flags] [args]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -33,7 +32,6 @@ hugo server trust [flags] [args]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -27,7 +27,6 @@ hugo version [flags] [args]
|
|||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-d, --destination string filesystem path to write files to
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
|
@ -36,7 +35,6 @@ hugo version [flags] [args]
|
|||
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
# Do not remove front matter.
|
||||
_comment: Do not remove front matter.
|
||||
---
|
||||
|
||||
| Kind | Description | Example |
|
||||
|
|
|
@ -52,7 +52,7 @@ Hugo does not provide a built-in template for Mermaid diagrams. Create your own
|
|||
|
||||
{{< code file=layouts/_default/_markup/render-codeblock-mermaid.html >}}
|
||||
<pre class="mermaid">
|
||||
{{- .Inner | safeHTML }}
|
||||
{{- .Inner | htmlEscape | safeHTML }}
|
||||
</pre>
|
||||
{{ .Page.Store.Set "hasMermaid" true }}
|
||||
{{< /code >}}
|
||||
|
|
|
@ -37,7 +37,9 @@ Please follow these guidelines:
|
|||
|
||||
### Style
|
||||
|
||||
Although we do not strictly adhere to the [Microsoft Writing Style Guide], it is an excellent resource for questions related to style, grammar, and voice.
|
||||
Please adhere to Google's [developer documentation style guide].
|
||||
|
||||
[developer documentation style guide]: https://developers.google.com/style
|
||||
|
||||
#### Terminology
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
# Do not remove front matter.
|
||||
_comment: Do not remove front matter.
|
||||
---
|
||||
|
||||
Path|Pattern|Match
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
# Do not remove front matter.
|
||||
_comment: Do not remove front matter.
|
||||
---
|
||||
|
||||
Hugo uses Go's [text/template] and [html/template] packages.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
# Do not remove front matter.
|
||||
_comment: Do not remove front matter.
|
||||
---
|
||||
|
||||
{{% note %}}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
# Do not remove front matter.
|
||||
_comment: Do not remove front matter.
|
||||
---
|
||||
|
||||
When specifying the regular expression, use a raw [string literal] (backticks) instead of an interpreted string literal (double quotes) to simplify the syntax. With an interpreted string literal you must escape backslashes.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
# Do not remove front matter.
|
||||
_comment: Do not remove front matter.
|
||||
---
|
||||
|
||||
Format a `time.Time` value based on [Go's reference time]:
|
||||
|
|
|
@ -124,6 +124,6 @@ module.exports = {
|
|||
```
|
||||
|
||||
[node.js]: https://nodejs.org/en/download
|
||||
[postcss plugins]: https://www.postcss.parts/
|
||||
[postcss plugins]: https://postcss.org/docs/postcss-plugins
|
||||
[supported file name]: https://github.com/postcss/postcss-load-config#usage
|
||||
[transpile to CSS]: /functions/css/sass/
|
||||
|
|
|
@ -86,6 +86,9 @@ includePaths
|
|||
{{ end }}
|
||||
```
|
||||
|
||||
silenceDeprecations
|
||||
: (`slice`) {{< new-in 0.139.0 >}} A slice of deprecation IDs to silence. The deprecation IDs are printed to in the warning message, e.g "import" in `WARN Dart Sass: DEPRECATED [import] ...`. This is for Dart Sass only.
|
||||
|
||||
## Dart Sass
|
||||
|
||||
The extended version of Hugo includes [LibSass] to transpile Sass to CSS. In 2020, the Sass team deprecated LibSass in favor of [Dart Sass].
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
# Do not remove front matter.
|
||||
_comment: Do not remove front matter.
|
||||
---
|
||||
|
||||
The documentation for Go's [fmt] package describes the structure and content of the format string.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
# Do not remove front matter.
|
||||
_comment: Do not remove front matter.
|
||||
---
|
||||
|
||||
See Go's [text/template] documentation for more information.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
# Do not remove front matter.
|
||||
_comment: Do not remove front matter.
|
||||
---
|
||||
|
||||
The falsy values are `false`, `0`, any `nil` pointer or interface value, any array, slice, map, or string of length zero, and zero `time.Time` values.
|
||||
|
|
125
content/en/functions/hugo/Store.md
Normal file
125
content/en/functions/hugo/Store.md
Normal file
|
@ -0,0 +1,125 @@
|
|||
---
|
||||
title: hugo.Store
|
||||
description: Returns a global, persistent "scratch pad" to store and manipulate data.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
related:
|
||||
- methods/page/store
|
||||
- methods/site/store
|
||||
- functions/collections/NewScratch
|
||||
returnType: maps.Scratch
|
||||
signatures: [hugo.Store]
|
||||
toc: true
|
||||
---
|
||||
|
||||
{{< new-in 0.139.0 >}}
|
||||
|
||||
The global `hugo.Store` function creates a persistent [scratch pad] to store and manipulate data. To create a locally scoped, use the [`newScratch`] function.
|
||||
|
||||
[`Scratch`]: /functions/hugo/scratch/
|
||||
[`newScratch`]: /functions/collections/newscratch/
|
||||
[scratch pad]: /getting-started/glossary/#scratch-pad
|
||||
|
||||
## Methods
|
||||
|
||||
###### Set
|
||||
|
||||
Sets the value of a given key.
|
||||
|
||||
```go-html-template
|
||||
{{ hugo.Store.Set "greeting" "Hello" }}
|
||||
```
|
||||
|
||||
###### Get
|
||||
|
||||
Gets the value of a given key.
|
||||
|
||||
```go-html-template
|
||||
{{ hugo.Store.Set "greeting" "Hello" }}
|
||||
{{ hugo.Store.Get "greeting" }} → Hello
|
||||
```
|
||||
|
||||
###### Add
|
||||
|
||||
Adds a given value to existing value(s) of the given key.
|
||||
|
||||
For single values, `Add` accepts values that support Go's `+` operator. If the first `Add` for a key is an array or slice, the following adds will be appended to that list.
|
||||
|
||||
```go-html-template
|
||||
{{ hugo.Store.Set "greeting" "Hello" }}
|
||||
{{ hugo.Store.Add "greeting" "Welcome" }}
|
||||
{{ hugo.Store.Get "greeting" }} → HelloWelcome
|
||||
```
|
||||
|
||||
```go-html-template
|
||||
{{ hugo.Store.Set "total" 3 }}
|
||||
{{ hugo.Store.Add "total" 7 }}
|
||||
{{ hugo.Store.Get "total" }} → 10
|
||||
```
|
||||
|
||||
```go-html-template
|
||||
{{ hugo.Store.Set "greetings" (slice "Hello") }}
|
||||
{{ hugo.Store.Add "greetings" (slice "Welcome" "Cheers") }}
|
||||
{{ hugo.Store.Get "greetings" }} → [Hello Welcome Cheers]
|
||||
```
|
||||
|
||||
###### SetInMap
|
||||
|
||||
Takes a `key`, `mapKey` and `value` and adds a map of `mapKey` and `value` to the given `key`.
|
||||
|
||||
```go-html-template
|
||||
{{ hugo.Store.SetInMap "greetings" "english" "Hello" }}
|
||||
{{ hugo.Store.SetInMap "greetings" "french" "Bonjour" }}
|
||||
{{ hugo.Store.Get "greetings" }} → map[english:Hello french:Bonjour]
|
||||
```
|
||||
|
||||
###### DeleteInMap
|
||||
|
||||
Takes a `key` and `mapKey` and removes the map of `mapKey` from the given `key`.
|
||||
|
||||
```go-html-template
|
||||
{{ hugo.Store.SetInMap "greetings" "english" "Hello" }}
|
||||
{{ hugo.Store.SetInMap "greetings" "french" "Bonjour" }}
|
||||
{{ hugo.Store.DeleteInMap "greetings" "english" }}
|
||||
{{ hugo.Store.Get "greetings" }} → map[french:Bonjour]
|
||||
```
|
||||
|
||||
###### GetSortedMapValues
|
||||
|
||||
Returns an array of values from `key` sorted by `mapKey`.
|
||||
|
||||
```go-html-template
|
||||
{{ hugo.Store.SetInMap "greetings" "english" "Hello" }}
|
||||
{{ hugo.Store.SetInMap "greetings" "french" "Bonjour" }}
|
||||
{{ hugo.Store.GetSortedMapValues "greetings" }} → [Hello Bonjour]
|
||||
```
|
||||
|
||||
###### Delete
|
||||
|
||||
Removes the given key.
|
||||
|
||||
```go-html-template
|
||||
{{ hugo.Store.Set "greeting" "Hello" }}
|
||||
{{ hugo.Store.Delete "greeting" }}
|
||||
```
|
||||
|
||||
## Determinate values
|
||||
|
||||
The `Store` method is often used to set scratch pad values within a shortcode, a partial template called by a shortcode, or by a Markdown render hook. In all three cases, the scratch pad values are indeterminate until Hugo renders the page content.
|
||||
|
||||
If you need to access a scratch pad value from a parent template, and the parent template has not yet rendered the page content, you can trigger content rendering by assigning the returned value to a [noop] variable:
|
||||
|
||||
[noop]: /getting-started/glossary/#noop
|
||||
|
||||
```go-html-template
|
||||
{{ $noop := .Content }}
|
||||
{{ hugo.Store.Get "mykey" }}
|
||||
```
|
||||
|
||||
You can also trigger content rendering with the `ContentWithoutSummary`, `FuzzyWordCount`, `Len`, `Plain`, `PlainWords`, `ReadingTime`, `Summary`, `Truncated`, and `WordCount` methods. For example:
|
||||
|
||||
```go-html-template
|
||||
{{ $noop := .WordCount }}
|
||||
{{ hugo.Store.Get "mykey" }}
|
||||
```
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
# Do not remove front matter.
|
||||
_comment: Do not remove front matter.
|
||||
---
|
||||
|
||||
Apply the filter using the [`images.Filter`] function:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
# Do not remove front matter.
|
||||
_comment: Do not remove front matter.
|
||||
---
|
||||
|
||||
If you are a Windows user, and the path to your project contains a space, you must place the PostCSS configuration within the package.json file. See [this example] and issue [#7333].
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
# Do not remove front matter.
|
||||
_comment: Do not remove front matter.
|
||||
---
|
||||
|
||||
Format|Time zone
|
||||
|
|
|
@ -230,7 +230,7 @@ Let's add a `lang` attribute to the `title` nodes of our RSS feed, and a namespa
|
|||
<language>en-US</language>
|
||||
<atom:link href="https://example.org/books/index.xml" rel="self" type="application/rss+xml" />
|
||||
<item>
|
||||
<title lang="fr">The Hunchback of Notre Dame</title>
|
||||
<title lang="en">The Hunchback of Notre Dame</title>
|
||||
<description>Written by Victor Hugo</description>
|
||||
<isbn:number>9780140443530</isbn:number>
|
||||
<link>https://example.org/books/the-hunchback-of-notre-dame/</link>
|
||||
|
@ -238,7 +238,7 @@ Let's add a `lang` attribute to the `title` nodes of our RSS feed, and a namespa
|
|||
<guid>https://example.org/books/the-hunchback-of-notre-dame/</guid>
|
||||
</item>
|
||||
<item>
|
||||
<title lang="en">Les Misérables</title>
|
||||
<title lang="fr">Les Misérables</title>
|
||||
<description>Written by Victor Hugo</description>
|
||||
<isbn:number>9780451419439</isbn:number>
|
||||
<link>https://example.org/books/les-miserables/</link>
|
||||
|
@ -266,7 +266,7 @@ Each item node looks like this:
|
|||
"pubDate": "Mon, 09 Oct 2023 09:27:12 -0700",
|
||||
"title": {
|
||||
"#text": "The Hunchback of Notre Dame",
|
||||
"-lang": "fr"
|
||||
"-lang": "en"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
@ -290,8 +290,8 @@ Hugo renders this to:
|
|||
|
||||
```html
|
||||
<ul>
|
||||
<li>The Hunchback of Notre Dame (fr) 9780140443530</li>
|
||||
<li>Les Misérables (en) 9780451419439</li>
|
||||
<li>The Hunchback of Notre Dame (en) 9780140443530</li>
|
||||
<li>Les Misérables (fr) 9780451419439</li>
|
||||
</ul>
|
||||
```
|
||||
|
||||
|
|
|
@ -28,10 +28,10 @@ This controls the behavior of the `anchorize` function and the generation of hea
|
|||
Set `autoHeadingIDType` to one of:
|
||||
|
||||
github
|
||||
: Compatible with GitHub. This is the default, and strongly recommended.
|
||||
: Compatible with GitHub. This is the default.
|
||||
|
||||
github-ascii
|
||||
: Similar to the "github" setting, but removes non-ASCII characters.
|
||||
: Similar to the `github` setting, but removes non-ASCII characters.
|
||||
|
||||
blackfriday
|
||||
: Provided for backwards compatibility with Hugo v0.59.1 and earlier. This option will be removed in a future release.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
# Do not remove front matter.
|
||||
_comment: Do not remove front matter.
|
||||
---
|
||||
|
||||
The [`anchorize`] and [`urlize`] functions are similar:
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
---
|
||||
title: Host on AWS Amplify
|
||||
description: Develop and deploy a cloud-powered web app with AWS Amplify.
|
||||
categories: [hosting and deployment]
|
||||
keywords: [hosting,amplify]
|
||||
menu:
|
||||
docs:
|
||||
parent: hosting-and-deployment
|
||||
toc: true
|
||||
---
|
||||
|
||||
In this guide we'll walk through how to deploy and host your Hugo site using the [AWS Amplify Console](https://console.amplify.aws).
|
||||
|
||||
AWS Amplify is a combination of client library, CLI toolchain, and a Console for continuous deployment and hosting. The Amplify CLI and library allow developers to get up & running with full-stack cloud-powered applications with features like authentication, storage, serverless GraphQL or REST APIs, analytics, Lambda functions, & more. The Amplify Console provides continuous deployment and hosting for modern web apps (single page apps and static site generators). Continuous deployment allows developers to deploy updates to their web app on every code commit to their Git repository. Hosting includes features such as globally available CDNs, easy custom domain setup + HTTPS, feature branch deployments, and password protection.
|
||||
|
||||
## Pre-requisites
|
||||
|
||||
* [Sign up for an AWS Account](https://portal.aws.amazon.com/billing/signup?redirect_url=https%3A%2F%2Faws.amazon.com%2Fregistration-confirmation). There are no upfront charges or any term commitments to create an AWS account and signing up gives you immediate access to the AWS Free Tier.
|
||||
* You have an account with GitHub, GitLab, or Bitbucket.
|
||||
* You have completed the [Quick Start] or have a Hugo website you are ready to deploy and share with the world.
|
||||
|
||||
## Hosting
|
||||
|
||||
1. Log in to the [AWS Amplify Console](https://console.aws.amazon.com/amplify/home) and choose Get Started under Deploy.
|
||||

|
||||
|
||||
1. Connect a branch from your GitHub, Bitbucket, GitLab, or AWS CodeCommit repository. Connecting your repository allows Amplify to deploy updates on every code commit to a branch.
|
||||

|
||||
|
||||
1. Accept the default build settings. The Amplify Console automatically detects your Hugo build settings and output directory.
|
||||

|
||||
|
||||
1. Review your changes and then choose **Save and deploy**. The Amplify Console will pull code from your repository, build changes to the backend and frontend, and deploy your build artifacts at `https://master.unique-id.amplifyapp.com`. Bonus: Screenshots of your app on different devices to find layout issues.
|
||||
|
||||
## Using a newer version of Hugo
|
||||
|
||||
If you need to use a different, perhaps newer, version of Hugo than the version currently supported by AWS Amplify:
|
||||
|
||||
1. Visit the [AWS Amplify Console](https://console.aws.amazon.com/amplify/home), and click the app you would like to modify
|
||||
1. In the side navigation bar, Under App Settings, click **Build settings**
|
||||
1. On the Build settings page, near the bottom, there is a section called **Build image settings**. Click **Edit**
|
||||
1. Under **Live package updates**, click **Add package version override**
|
||||
1. From the selection, click **Hugo** and ensure the version field says `latest`
|
||||
1. Click **Save** to save the changes.
|
||||
|
||||
[Quick Start]: /getting-started/quick-start/
|
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
Binary file not shown.
After Width: | Height: | Size: 47 KiB |
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
Binary file not shown.
After Width: | Height: | Size: 80 KiB |
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
Binary file not shown.
After Width: | Height: | Size: 60 KiB |
|
@ -0,0 +1,151 @@
|
|||
---
|
||||
title: Host on AWS Amplify
|
||||
description: Host your site on AWS Amplify with continuous deployment.
|
||||
categories: [hosting and deployment]
|
||||
keywords: [hosting]
|
||||
menu:
|
||||
docs:
|
||||
parent: hosting-and-deployment
|
||||
toc: true
|
||||
---
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Please complete the following tasks before continuing:
|
||||
|
||||
1. [Create an AWS account]
|
||||
2. [Install Git]
|
||||
3. [Create a Hugo site] and test it locally with `hugo server`
|
||||
4. Commit the changes to your local repository
|
||||
5. Push the local repository to your [GitHub], [GitLab], or [Bitbucket] account
|
||||
|
||||
[Bitbucket]: https://bitbucket.org/product
|
||||
[Create a Hugo site]: /getting-started/quick-start/
|
||||
[Create an AWS account]: https://aws.amazon.com/resources/create-account/
|
||||
[GitHub]: https://github.com
|
||||
[GitLab]: https://about.gitlab.com/
|
||||
[Install Git]: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
|
||||
|
||||
## Procedure
|
||||
|
||||
This procedure will enable continuous deployment from a GitHub repository. The procedure is essentially the same if you are using GitLab or Bitbucket.
|
||||
|
||||
Step 1
|
||||
: Create a file named `amplify.yml` in the root of your project.
|
||||
|
||||
```sh
|
||||
touch amplify.yml
|
||||
```
|
||||
|
||||
Step 2
|
||||
: Copy and paste the YAML below into the file you created. Change the application versions and time zone as needed.
|
||||
|
||||
{{< code file=amplify.yml copy=true >}}
|
||||
version: 1
|
||||
env:
|
||||
variables:
|
||||
# Application versions
|
||||
DART_SASS_VERSION: 1.81.0
|
||||
GO_VERSION: 1.23.3
|
||||
HUGO_VERSION: 0.139.3
|
||||
# Time zone
|
||||
TZ: America/Los_Angeles
|
||||
# Cache
|
||||
HUGO_CACHEDIR: ${PWD}/.hugo
|
||||
NPM_CONFIG_CACHE: ${PWD}/.npm
|
||||
frontend:
|
||||
phases:
|
||||
preBuild:
|
||||
commands:
|
||||
# Install Dart Sass
|
||||
- curl -LJO https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz
|
||||
- sudo tar -C /usr/local/bin -xf dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz
|
||||
- rm dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz
|
||||
- export PATH=/usr/local/bin/dart-sass:$PATH
|
||||
|
||||
# Install Go
|
||||
- curl -LJO https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz
|
||||
- sudo tar -C /usr/local -xf go${GO_VERSION}.linux-amd64.tar.gz
|
||||
- rm go${GO_VERSION}.linux-amd64.tar.gz
|
||||
- export PATH=/usr/local/go/bin:$PATH
|
||||
|
||||
# Install Hugo
|
||||
- curl -LJO https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz
|
||||
- sudo tar -C /usr/local/bin -xf hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz
|
||||
- rm hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz
|
||||
- export PATH=/usr/local/bin:$PATH
|
||||
|
||||
# Check installed versions
|
||||
- go version
|
||||
- hugo version
|
||||
- node -v
|
||||
- npm -v
|
||||
- sass --embedded --version
|
||||
|
||||
# Install Node.JS dependencies
|
||||
- "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci --prefer-offline || true"
|
||||
|
||||
# https://github.com/gohugoio/hugo/issues/9810
|
||||
- git config --add core.quotepath false
|
||||
build:
|
||||
commands:
|
||||
- hugo --gc --minify
|
||||
artifacts:
|
||||
baseDirectory: public
|
||||
files:
|
||||
- '**/*'
|
||||
cache:
|
||||
paths:
|
||||
- ${HUGO_CACHEDIR}/**/*
|
||||
- ${NPM_CONFIG_CACHE}/**/*
|
||||
{{< /code >}}
|
||||
|
||||
Step 3
|
||||
: Commit and push the change to your GitHub repository.
|
||||
|
||||
```sh
|
||||
git add -A
|
||||
git commit -m "Create amplify.yml"
|
||||
git push
|
||||
```
|
||||
|
||||
Step 4
|
||||
: Log in to your AWS account, navigate to the [Amplify Console], then press the **Deploy an app** button.
|
||||
|
||||
[Amplify Console]: https://console.aws.amazon.com/amplify/apps
|
||||
|
||||
Step 5
|
||||
: Choose a source code provider, then press the **Next** button.
|
||||
|
||||

|
||||
|
||||
Step 6
|
||||
: Authorize AWS Amplify to access your GitHub account.
|
||||
|
||||

|
||||
|
||||
Step 7
|
||||
: Select your personal account or relevant organization.
|
||||
|
||||

|
||||
|
||||
Step 8
|
||||
: Authorize access to one or more repositories.
|
||||
|
||||

|
||||
|
||||
Step 9
|
||||
: Select a repository and branch, then press the **Next** button.
|
||||
|
||||

|
||||
|
||||
Step 10
|
||||
: On the "App settings" page, scroll to the bottom then press the **Next** button. Amplify reads the `amplify.yml` file you created in Steps 1-3 instead of using the values on this page.
|
||||
|
||||
Step 11
|
||||
: On the "Review" page, scroll to the bottom then press the **Save and deploy** button.
|
||||
|
||||
Step 12
|
||||
: When your site has finished deploying, press the **Visit deployed URL** button to view your published site.
|
||||
|
||||

|
|
@ -12,6 +12,8 @@ aliases: [/tutorials/github-pages-blog/]
|
|||
|
||||
## Prerequisites
|
||||
|
||||
Please complete the following tasks before continuing:
|
||||
|
||||
1. [Create a GitHub account]
|
||||
2. [Install Git]
|
||||
3. [Create a Hugo site] and test it locally with `hugo server`.
|
||||
|
@ -53,10 +55,11 @@ Step 4
|
|||
{style="max-width: 280px"}
|
||||
|
||||
Step 5
|
||||
: Create an empty file in your local repository.
|
||||
: Create a file named `hugo.yaml` in a directory named `.github/workflows`.
|
||||
|
||||
```text
|
||||
.github/workflows/hugo.yaml
|
||||
mkdir -p .github/workflows
|
||||
touch hugo.yaml
|
||||
```
|
||||
|
||||
Step 6
|
||||
|
@ -144,7 +147,13 @@ jobs:
|
|||
{{< /code >}}
|
||||
|
||||
Step 7
|
||||
: Commit the change to your local repository with a commit message of something like "Add workflow", and push to GitHub.
|
||||
: Commit and push the change to your GitHub repository.
|
||||
|
||||
```sh
|
||||
git add -A
|
||||
git commit -m "Create hugo.yaml"
|
||||
git push
|
||||
```
|
||||
|
||||
Step 8
|
||||
: From GitHub's main menu, choose **Actions**. You will see something like this:
|
||||
|
@ -181,7 +190,7 @@ You may remove this step if your site, themes, and modules do not transpile Sass
|
|||
|
||||
[Dart Sass]: /hugo-pipes/transpile-sass-to-css/#dart-sass
|
||||
|
||||
## Additional resources
|
||||
## Other resources
|
||||
|
||||
- [Learn more about GitHub Actions](https://docs.github.com/en/actions)
|
||||
- [Caching dependencies to speed up workflows](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows)
|
||||
|
|
|
@ -11,11 +11,13 @@ toc: true
|
|||
|
||||
## Prerequisites
|
||||
|
||||
Please complete the following tasks before continuing:
|
||||
|
||||
1. [Create a Netlify account]
|
||||
2. [Install Git]
|
||||
3. [Create a Hugo site] and test it locally with `hugo server`
|
||||
4. Commit the changes to your local repository
|
||||
4. Push the local repository to your [GitHub], [GitLab], or [Bitbucket] account
|
||||
5. Push the local repository to your [GitHub], [GitLab], or [Bitbucket] account
|
||||
|
||||
[Bitbucket]: https://bitbucket.org/product
|
||||
[Create a Hugo site]: /getting-started/quick-start/
|
||||
|
@ -34,64 +36,64 @@ Step 1
|
|||
Step 2
|
||||
: Select your deployment method.
|
||||
|
||||

|
||||

|
||||
|
||||
Step 3
|
||||
: Authorize Netlify to connect with your GitHub account by pressing the **Authorize Netlify** button.
|
||||
|
||||

|
||||

|
||||
|
||||
Step 4
|
||||
: Press the **Configure Netlify on GitHub** button.
|
||||
|
||||

|
||||

|
||||
|
||||
Step 5
|
||||
: Install the Netlify app by selecting your GitHub account.
|
||||
|
||||

|
||||

|
||||
|
||||
Step 6
|
||||
: Press the **Install** button.
|
||||
|
||||

|
||||

|
||||
|
||||
Step 7
|
||||
: Click on the site's repository from the list.
|
||||
|
||||

|
||||

|
||||
|
||||
Step 8
|
||||
: Set the site name and branch from which to deploy.
|
||||
|
||||

|
||||

|
||||
|
||||
Step 9
|
||||
: Define the build settings, press the **Add environment variables** button, then press the **New variable** button.
|
||||
|
||||

|
||||

|
||||
|
||||
Step 10
|
||||
: Create a new environment variable named `HUGO_VERSION` and set the value to the [latest version].
|
||||
|
||||
[latest version]: https://github.com/gohugoio/hugo/releases/latest
|
||||
|
||||

|
||||

|
||||
|
||||
Step 11
|
||||
: Press the "Deploy my new site" button at the bottom of the page.
|
||||
|
||||

|
||||

|
||||
|
||||
Step 12
|
||||
: At the bottom of the screen, wait for the deploy to complete, then click on the deploy log entry.
|
||||
|
||||

|
||||

|
||||
|
||||
Step 13
|
||||
: Press the **Open production deploy** button to view the live site.
|
||||
|
||||

|
||||

|
||||
|
||||
## Configuration file
|
||||
|
||||
|
|
|
@ -133,8 +133,6 @@ Also see the [CLI Doc](/commands/hugo_mod_clean/).
|
|||
|
||||
## Module workspaces
|
||||
|
||||
{{< new-in 0.109.0 >}}
|
||||
|
||||
Workspace support was added in [Go 1.18](https://go.dev/blog/get-familiar-with-workspaces) and Hugo got solid support for it in the `v0.109.0` version.
|
||||
|
||||
A common use case for a workspace is to simplify local development of a site with its theme modules.
|
||||
|
|
|
@ -88,7 +88,7 @@ HUGO_ENVIRONMENT
|
|||
: The value e.g. set with `hugo -e production` (defaults to `production` for `hugo` and `development` for `hugo server`).
|
||||
|
||||
HUGO_PUBLISHDIR
|
||||
: {{< new-in 0.109.0 >}} The absolute path to the publish directory (the `public` directory). Note that the value will always point to a directory on disk even when running `hugo server` in memory mode. If you write to this folder from PostCSS when running the server, you could run the server with one of these flags:
|
||||
: The absolute path to the publish directory (the `public` directory). Note that the value will always point to a directory on disk even when running `hugo server` in memory mode. If you write to this folder from PostCSS when running the server, you could run the server with one of these flags:
|
||||
|
||||
```sh
|
||||
hugo server --renderToDisk
|
||||
|
|
|
@ -42,7 +42,7 @@ transpiler
|
|||
targetPath
|
||||
: (`string`) If not set, the transformed resource's target path will be the original path of the asset file with its extension replaced by `.css`.
|
||||
|
||||
vars {{< new-in 0.109.0 >}}
|
||||
vars
|
||||
: (`map`) A map of key-value pairs that will be available in the `hugo:vars` namespace. Useful for [initializing Sass variables from Hugo templates](https://discourse.gohugo.io/t/42053/).
|
||||
|
||||
```scss
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
# Do not remove front matter.
|
||||
_comment: Do not remove front matter.
|
||||
---
|
||||
|
||||
Hugo is available in three editions: standard, extended, and extended/deploy. While the standard edition provides core functionality, the extended and extended/deploy editions offer advanced features.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
# Do not remove front matter.
|
||||
_comment: Do not remove front matter.
|
||||
---
|
||||
|
||||
## Prerequisites
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
# Do not remove front matter.
|
||||
_comment: Do not remove front matter.
|
||||
---
|
||||
|
||||
## Prebuilt binaries
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
# Do not remove front matter.
|
||||
_comment: Do not remove front matter.
|
||||
---
|
||||
|
||||
## Build from source
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
# Do not remove front matter.
|
||||
_comment: Do not remove front matter.
|
||||
---
|
||||
|
||||
### Homebrew
|
||||
|
|
|
@ -192,6 +192,16 @@ sudo eopkg install hugo
|
|||
|
||||
[Solus]: https://getsol.us/
|
||||
|
||||
### Void Linux
|
||||
|
||||
To install the extended edition of Hugo on [Void Linux]:
|
||||
|
||||
```sh
|
||||
sudo xbps-install -S hugo
|
||||
```
|
||||
|
||||
[Void Linux]: https://voidlinux.org/
|
||||
|
||||
{{% include "installation/_common/04-build-from-source.md" %}}
|
||||
|
||||
## Comparison
|
||||
|
|
120
content/en/methods/menu-entry/PageRef.md
Normal file
120
content/en/methods/menu-entry/PageRef.md
Normal file
|
@ -0,0 +1,120 @@
|
|||
---
|
||||
title: PageRef
|
||||
description: Returns the `pageRef` property of the given menu entry.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
related:
|
||||
- /methods/menu-entry/URL
|
||||
returnType: string
|
||||
signatures: [MENUENTRY.PageRef]
|
||||
toc: true
|
||||
---
|
||||
|
||||
The use case for this method is rare.
|
||||
|
||||
In almost also scenarios you should use the [`URL`] method instead.
|
||||
|
||||
## Explanation
|
||||
|
||||
If you specify a `pageRef` property when [defining a menu entry] in your site configuration, Hugo looks for a matching page when rendering the entry.
|
||||
|
||||
If a matching page is found:
|
||||
|
||||
- The [`URL`] method returns the page's relative permalink
|
||||
- The [`Page`] method returns the corresponding `Page` object
|
||||
- The [`HasMenuCurrent`] and [`IsMenuCurrent`] methods on a `Page` object return the expected values
|
||||
|
||||
If a matching page is not found:
|
||||
|
||||
- The [`URL`] method returns the entry's `url` property if set, else an empty string
|
||||
- The [`Page`] method returns nil
|
||||
- The [`HasMenuCurrent`] and [`IsMenuCurrent`] methods on a `Page` object return `false`
|
||||
|
||||
{{% note %}}
|
||||
In almost also scenarios you should use the [`URL`] method instead.
|
||||
|
||||
[`URL`]: /methods/menu-entry/url/
|
||||
{{% /note %}}
|
||||
|
||||
[defining a menu entry]: /content-management/menus/#define-in-site-configuration
|
||||
[`Page`]: /methods/menu-entry/page/
|
||||
[`URL`]: /methods/menu-entry/url/
|
||||
[`IsMenuCurrent`]: /methods/page/ismenucurrent/
|
||||
[`HasMenuCurrent`]: /methods/page/hasmenucurrent/
|
||||
[`RelPermalink`]: /methods/page/relpermalink/
|
||||
|
||||
## Example
|
||||
|
||||
This example is contrived.
|
||||
|
||||
{{% note %}}
|
||||
In almost also scenarios you should use the [`URL`] method instead.
|
||||
|
||||
[`URL`]: /methods/menu-entry/url/
|
||||
{{% /note %}}
|
||||
|
||||
|
||||
Consider this content structure:
|
||||
|
||||
```text
|
||||
content/
|
||||
├── products.md
|
||||
└── _index.md
|
||||
```
|
||||
|
||||
And this menu definition:
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
[[menus.main]]
|
||||
name = 'Products'
|
||||
pageRef = '/products'
|
||||
weight = 10
|
||||
[[menus.main]]
|
||||
name = 'Services'
|
||||
pageRef = '/services'
|
||||
weight = 20
|
||||
{{< /code-toggle >}}
|
||||
|
||||
With this template code:
|
||||
|
||||
{{< code file=layouts/partials/menu.html >}}
|
||||
<ul>
|
||||
{{ range .Site.Menus.main }}
|
||||
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{< /code >}}
|
||||
|
||||
Hugo render this HTML:
|
||||
|
||||
```html
|
||||
<ul>
|
||||
<li><a href="/products/">Products</a></li>
|
||||
<li><a href="">Services</a></li>
|
||||
</ul>
|
||||
```
|
||||
|
||||
In the above note that the `href` attribute of the second `anchor` element is blank because Hugo was unable to find the "services" page.
|
||||
|
||||
With this template code:
|
||||
|
||||
|
||||
{{< code file=layouts/partials/menu.html >}}
|
||||
<ul>
|
||||
{{ range .Site.Menus.main }}
|
||||
<li><a href="{{ or .URL .PageRef }}">{{ .Name }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{< /code >}}
|
||||
|
||||
Hugo renders this HTML:
|
||||
|
||||
```html
|
||||
<ul>
|
||||
<li><a href="/products/">Products</a></li>
|
||||
<li><a href="/services">Services</a></li>
|
||||
</ul>
|
||||
```
|
||||
|
||||
In the above note that Hugo populates the `href` attribute of the second `anchor` element with the `pageRef` property as defined in the site configuration because the template code falls back to the `PageRef` method.
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
# Do not remove front matter.
|
||||
_comment: Do not remove front matter.
|
||||
---
|
||||
|
||||
In this site configuration we enable rendering of [emoji shortcodes], and add emoji shortcodes before (pre) and after (post) each menu entry:
|
||||
|
|
|
@ -16,8 +16,6 @@ action:
|
|||
signatures: [PAGE.Ancestors]
|
||||
---
|
||||
|
||||
{{< new-in 0.109.0 >}}
|
||||
|
||||
{{% include "methods/page/_common/definition-of-section.md" %}}
|
||||
|
||||
With this content structure:
|
||||
|
|
|
@ -141,6 +141,7 @@ Some providers perform deep clones by default, others allow you to configure the
|
|||
|
||||
Hosting service | Default clone depth | Configurable
|
||||
:-- | :-- | :--
|
||||
AWS Amplify | Deep | N/A
|
||||
Cloudflare Pages | Shallow | Yes [^CFP]
|
||||
DigitalOcean App Platform | Deep | N/A
|
||||
GitHub Pages | Shallow | Yes [^GHP]
|
||||
|
|
|
@ -28,4 +28,8 @@ If the `Page` object associated with the menu entry is a section, this method al
|
|||
|
||||
See [menu templates] for a complete example.
|
||||
|
||||
{{% note %}}
|
||||
When using this method you must either define the menu entry in front matter, or specify a `pageRef` property when defining the menu entry in your site configuration.
|
||||
{{% /note %}}
|
||||
|
||||
[menu templates]: /templates/menu/#example
|
||||
|
|
|
@ -26,4 +26,8 @@ aliases: [/functions/ismenucurrent]
|
|||
|
||||
See [menu templates] for a complete example.
|
||||
|
||||
{{% note %}}
|
||||
When using this method you must either define the menu entry in front matter, or specify a `pageRef` property when defining the menu entry in your site configuration.
|
||||
{{% /note %}}
|
||||
|
||||
[menu templates]: /templates/menu/#example
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
---
|
||||
title: Store
|
||||
linktitle: PAGE.Store
|
||||
description: Returns a persistent "scratch pad" on the given page to store and manipulate data.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
related:
|
||||
- methods/page/scratch
|
||||
- methods/site/store
|
||||
- functions/hugo/store
|
||||
- functions/collections/NewScratch
|
||||
returnType: maps.Scratch
|
||||
signatures: [PAGE.Store]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
# Do not remove front matter.
|
||||
_comment: Do not remove front matter.
|
||||
---
|
||||
|
||||
A _section_ is a top-level content directory, or any content directory with an _index.md file.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
# Do not remove front matter.
|
||||
_comment: Do not remove front matter.
|
||||
---
|
||||
|
||||
Hugo determines the _next_ and _previous_ page by sorting the site's collection of regular pages according to this sorting hierarchy:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
# Do not remove front matter.
|
||||
_comment: Do not remove front matter.
|
||||
---
|
||||
|
||||
Hugo determines the _next_ and _previous_ page by sorting the current section's regular pages according to this sorting hierarchy:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
# Do not remove front matter.
|
||||
_comment: Do not remove front matter.
|
||||
---
|
||||
Hugo generates one or more files per page when building a site. For example, when rendering home, [section], [taxonomy], and [term] pages, Hugo generates an HTML file and an RSS file. Both HTML and RSS are built-in _output formats_. Create multiple output formats, and control generation based on [page kind], or by enabling one or more output formats for one or more pages. See [details].
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
# Do not remove front matter.
|
||||
_comment: Do not remove front matter.
|
||||
---
|
||||
|
||||
Get IDENTIFIER
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
# Do not remove front matter.
|
||||
_comment: Do not remove front matter.
|
||||
---
|
||||
|
||||
## Methods
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue