Squashed 'docs/' changes from 32cb8785e..4c1309cdf

4c1309cdf Fix broken link to front matter page (#1923)
8181fff20 Add footnote to Quick Start guide for Win users (#1922)
4fd934f61 Fix abslangurl.md (#1919)
bf2c45617 Quick start guide: fix broken links (#1915)
201b568df Update theme
874db199d Hide the news stripe on front page for now
aaf59e3e2 netlify: Hugo 0.107.0
79654c301 Merge branch 'tempv107'
8345e0347 docs: Regen docs helper
b5b4f15f9 Add assets directory to directory structure diagram (#1917)
76dd3a82a Follow-up: improve function signatures (#1914) (#1916)
656dc72ba Improving function signatures (#1914)
b715e8407 Explain how to create multilingual content (#1912)
8500ee417 Fix typo in Quick Start guide
ce60bb572 Add docu for undocumented functions (#1907)
372bf5e88 Improve Quick Start tutorial
71e81ec5f Remove asciicast from site
1e56c653f Update hosting-on-cloudflare-pages.md (#1903)
1686f60b1 Adding documentation page for function 'strings.FirstUpper' (#1901)
d533f7c9c Fixing typos (#1900)
2563eee45 Update multilingual.md (#1899)
2173ed799 Update theme
5591b8875 Update urls.md (#1897)
4a88890b5 netlify: Hugo 0.106.0
512879fdd docs: Regen CLI docs
f74b1d87d docs: Regenerate docs helper
9feacb48f Merge commit '00c4484c7092181729f6f470805bc7d72e8ad17b'

git-subtree-dir: docs
git-subtree-split: 4c1309cdfe9858434684352f9d544bf0c5c9d646
This commit is contained in:
Bjørn Erik Pedersen 2022-12-02 09:19:23 +01:00
parent 00c4484c70
commit da16527896
50 changed files with 709 additions and 452 deletions

View file

@ -1,7 +1,8 @@
var docsearch = require('docsearch.js/dist/cdn/docsearch.js'); var docsearch = require('docsearch.js/dist/cdn/docsearch.js');
docsearch({ docsearch({
apiKey: '167e7998590aebda7f9fedcf86bc4a55', appId: 'D1BPLZHGYQ',
indexName: 'hugodocs', apiKey: '6df94e1e5d55d258c56f60d974d10314',
inputSelector: '#search-input', indexName: 'hugodocs',
debug: true // Set debug to true if you want to inspect the dropdown inputSelector: '#search-input',
debug: true, // Set debug to true if you want to inspect the dropdown
}); });

File diff suppressed because one or more lines are too long

View file

@ -41,7 +41,7 @@
<img src="/images/gopher-side_color.svg" alt="" class="absolute-l bottom-0 dn db-l h4 right-0 z-999"/> <img src="/images/gopher-side_color.svg" alt="" class="absolute-l bottom-0 dn db-l h4 right-0 z-999"/>
<div class="bg-primary-color-dark bottom-0 left-0 right-0 dn-l fixed pb3 ph3 pt3 w-100"> <div class="bg-primary-color-dark bottom-0 left-0 right-0 dn-l fixed pb3 ph3 pt3 w-100 z-2">
{{- partial "nav-mobile.html" . -}} {{- partial "nav-mobile.html" . -}}
</div> </div>

View file

@ -1 +1 @@
# github.com/gohugoio/gohugoioTheme v0.0.0-20221116211530-5ae8dcdd68d6 # github.com/gohugoio/gohugoioTheme v0.0.0-20221124154621-1451a01f406b

View file

@ -1,16 +1,12 @@
--- ---
linktitle: "" linktitle: ""
description: "" description: ""
publishdate: ""
lastmod: ""
categories: [functions] categories: [functions]
tags: [] tags: []
ns: "" ns: ""
signature: [] signature: []
workson: []
hugoversion: "" hugoversion: ""
aliases: [] aliases: []
relatedfuncs: [] relatedfuncs: []
toc: false toc: false
deprecated: false
--- ---

View file

@ -18,25 +18,25 @@ hugo config [flags]
### Options ### Options
``` ```
-h, --help help for config --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
-e, --environment string build environment
-h, --help help for config
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
-s, --source string filesystem path to read files relative from
--themesDir string filesystem path to themes directory
``` ```
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--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 path/config.yaml|json|toml)
--config string config file (default is path/config.yaml|json|toml) --configDir string config dir (default "config")
--configDir string config dir (default "config") --debug debug output
--debug debug output --log enable Logging
-e, --environment string build environment --logFile string log File path (if set, logging enabled automatically)
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern --quiet build in quiet mode
--log enable Logging -v, --verbose verbose output
--logFile string log File path (if set, logging enabled automatically) --verboseLog verbose logging
--quiet build in quiet mode
-s, --source string filesystem path to read files relative from
--themesDir string filesystem path to themes directory
-v, --verbose verbose output
--verboseLog verbose logging
``` ```
### SEE ALSO ### SEE ALSO

View file

@ -16,27 +16,27 @@ See convert's subcommands toJSON, toTOML and toYAML for more information.
### Options ### Options
``` ```
-h, --help help for convert --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
-o, --output string filesystem path to write files to -e, --environment string build environment
--unsafe enable less safe operations, please backup first -h, --help help for convert
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
-o, --output string filesystem path to write files to
-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
``` ```
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--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 path/config.yaml|json|toml)
--config string config file (default is path/config.yaml|json|toml) --configDir string config dir (default "config")
--configDir string config dir (default "config") --debug debug output
--debug debug output --log enable Logging
-e, --environment string build environment --logFile string log File path (if set, logging enabled automatically)
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern --quiet build in quiet mode
--log enable Logging -v, --verbose verbose output
--logFile string log File path (if set, logging enabled automatically) --verboseLog verbose logging
--quiet build in quiet mode
-s, --source string filesystem path to read files relative from
--themesDir string filesystem path to themes directory
-v, --verbose verbose output
--verboseLog verbose logging
``` ```
### SEE ALSO ### SEE ALSO

View file

@ -22,31 +22,31 @@ hugo deploy [flags]
### Options ### Options
``` ```
--confirm ask for confirmation before making changes to the target --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
--dryRun dry run --confirm ask for confirmation before making changes to the target
--force force upload of all files --dryRun dry run
-h, --help help for deploy -e, --environment string build environment
--invalidateCDN invalidate the CDN cache listed in the deployment target (default true) --force force upload of all files
--maxDeletes int maximum # of files to delete, or -1 to disable (default 256) -h, --help help for deploy
--target string target deployment from deployments section in config file; defaults to the first one --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--invalidateCDN invalidate the CDN cache listed in the deployment target (default true)
--maxDeletes int maximum # of files to delete, or -1 to disable (default 256)
-s, --source string filesystem path to read files relative from
--target string target deployment from deployments section in config file; defaults to the first one
--themesDir string filesystem path to themes directory
``` ```
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--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 path/config.yaml|json|toml)
--config string config file (default is path/config.yaml|json|toml) --configDir string config dir (default "config")
--configDir string config dir (default "config") --debug debug output
--debug debug output --log enable Logging
-e, --environment string build environment --logFile string log File path (if set, logging enabled automatically)
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern --quiet build in quiet mode
--log enable Logging -v, --verbose verbose output
--logFile string log File path (if set, logging enabled automatically) --verboseLog verbose logging
--quiet build in quiet mode
-s, --source string filesystem path to read files relative from
--themesDir string filesystem path to themes directory
-v, --verbose verbose output
--verboseLog verbose logging
``` ```
### SEE ALSO ### SEE ALSO

View file

@ -16,25 +16,25 @@ List requires a subcommand, e.g. `hugo list drafts`.
### Options ### Options
``` ```
-h, --help help for list --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
-e, --environment string build environment
-h, --help help for list
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
-s, --source string filesystem path to read files relative from
--themesDir string filesystem path to themes directory
``` ```
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--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 path/config.yaml|json|toml)
--config string config file (default is path/config.yaml|json|toml) --configDir string config dir (default "config")
--configDir string config dir (default "config") --debug debug output
--debug debug output --log enable Logging
-e, --environment string build environment --logFile string log File path (if set, logging enabled automatically)
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern --quiet build in quiet mode
--log enable Logging -v, --verbose verbose output
--logFile string log File path (if set, logging enabled automatically) --verboseLog verbose logging
--quiet build in quiet mode
-s, --source string filesystem path to read files relative from
--themesDir string filesystem path to themes directory
-v, --verbose verbose output
--verboseLog verbose logging
``` ```
### SEE ALSO ### SEE ALSO

View file

@ -26,53 +26,53 @@ See https://gohugo.io/hugo-modules/ for more information.
### Options ### Options
``` ```
-b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/ -b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
-D, --buildDrafts include content marked as draft -D, --buildDrafts include content marked as draft
-E, --buildExpired include expired content -E, --buildExpired include expired content
-F, --buildFuture include content with publishdate in the future -F, --buildFuture include content with publishdate in the future
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/ --cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
--cleanDestinationDir remove files from destination not found in static directories --cleanDestinationDir remove files from destination not found in static directories
-c, --contentDir string filesystem path to content directory --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
-d, --destination string filesystem path to write files to -c, --contentDir string filesystem path to content directory
--disableKinds strings disable different kind of pages (home, RSS etc.) -d, --destination string filesystem path to write files to
--enableGitInfo add Git revision, date, author, and CODEOWNERS info to the pages --disableKinds strings disable different kind of pages (home, RSS etc.)
--forceSyncStatic copy all files when static is changed. --enableGitInfo add Git revision, date, author, and CODEOWNERS info to the pages
--gc enable to run some cleanup tasks (remove unused cache files) after the build -e, --environment string build environment
-h, --help help for mod --forceSyncStatic copy all files when static is changed.
--ignoreCache ignores the cache directory --gc enable to run some cleanup tasks (remove unused cache files) after the build
-l, --layoutDir string filesystem path to layout directory -h, --help help for mod
--minify minify any supported output format (HTML, XML etc.) --ignoreCache ignores the cache directory
--noBuildLock don't create .hugo_build.lock file --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--noChmod don't sync permission mode of files -l, --layoutDir string filesystem path to layout directory
--noTimes don't sync modification time of files --minify minify any supported output format (HTML, XML etc.)
--panicOnWarning panic on first WARNING log --noBuildLock don't create .hugo_build.lock file
--poll string set this to a poll interval, e.g --poll 700ms, to use a poll based approach to watch for file system changes --noChmod don't sync permission mode of files
--printI18nWarnings print missing translations --noTimes don't sync modification time of files
--printMemoryUsage print memory usage to screen at intervals --panicOnWarning panic on first WARNING log
--printPathWarnings print warnings on duplicate target paths etc. --poll string set this to a poll interval, e.g --poll 700ms, to use a poll based approach to watch for file system changes
--printUnusedTemplates print warnings on unused templates. --printI18nWarnings print missing translations
--templateMetrics display metrics about template executions --printMemoryUsage print memory usage to screen at intervals
--templateMetricsHints calculate some improvement hints when combined with --templateMetrics --printPathWarnings print warnings on duplicate target paths etc.
-t, --theme strings themes to use (located in /themes/THEMENAME/) --printUnusedTemplates print warnings on unused templates.
--trace file write trace to file (not useful in general) -s, --source string filesystem path to read files relative from
--templateMetrics display metrics about template executions
--templateMetricsHints calculate some improvement hints when combined with --templateMetrics
-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)
``` ```
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--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 path/config.yaml|json|toml)
--config string config file (default is path/config.yaml|json|toml) --configDir string config dir (default "config")
--configDir string config dir (default "config") --debug debug output
--debug debug output --log enable Logging
-e, --environment string build environment --logFile string log File path (if set, logging enabled automatically)
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern --quiet build in quiet mode
--log enable Logging -v, --verbose verbose output
--logFile string log File path (if set, logging enabled automatically) --verboseLog verbose logging
--quiet build in quiet mode
-s, --source string filesystem path to read files relative from
--themesDir string filesystem path to themes directory
-v, --verbose verbose output
--verboseLog verbose logging
``` ```
### SEE ALSO ### SEE ALSO

View file

@ -25,56 +25,56 @@ hugo new [path] [flags]
### Options ### Options
``` ```
-b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/ -b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
-D, --buildDrafts include content marked as draft -D, --buildDrafts include content marked as draft
-E, --buildExpired include expired content -E, --buildExpired include expired content
-F, --buildFuture include content with publishdate in the future -F, --buildFuture include content with publishdate in the future
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/ --cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
--cleanDestinationDir remove files from destination not found in static directories --cleanDestinationDir remove files from destination not found in static directories
-c, --contentDir string filesystem path to content directory --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
-d, --destination string filesystem path to write files to -c, --contentDir string filesystem path to content directory
--disableKinds strings disable different kind of pages (home, RSS etc.) -d, --destination string filesystem path to write files to
--editor string edit new content with this editor, if provided --disableKinds strings disable different kind of pages (home, RSS etc.)
--enableGitInfo add Git revision, date, author, and CODEOWNERS info to the pages --editor string edit new content with this editor, if provided
-f, --force overwrite file if it already exists --enableGitInfo add Git revision, date, author, and CODEOWNERS info to the pages
--forceSyncStatic copy all files when static is changed. -e, --environment string build environment
--gc enable to run some cleanup tasks (remove unused cache files) after the build -f, --force overwrite file if it already exists
-h, --help help for new --forceSyncStatic copy all files when static is changed.
--ignoreCache ignores the cache directory --gc enable to run some cleanup tasks (remove unused cache files) after the build
-k, --kind string content type to create -h, --help help for new
-l, --layoutDir string filesystem path to layout directory --ignoreCache ignores the cache directory
--minify minify any supported output format (HTML, XML etc.) --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--noBuildLock don't create .hugo_build.lock file -k, --kind string content type to create
--noChmod don't sync permission mode of files -l, --layoutDir string filesystem path to layout directory
--noTimes don't sync modification time of files --minify minify any supported output format (HTML, XML etc.)
--panicOnWarning panic on first WARNING log --noBuildLock don't create .hugo_build.lock file
--poll string set this to a poll interval, e.g --poll 700ms, to use a poll based approach to watch for file system changes --noChmod don't sync permission mode of files
--printI18nWarnings print missing translations --noTimes don't sync modification time of files
--printMemoryUsage print memory usage to screen at intervals --panicOnWarning panic on first WARNING log
--printPathWarnings print warnings on duplicate target paths etc. --poll string set this to a poll interval, e.g --poll 700ms, to use a poll based approach to watch for file system changes
--printUnusedTemplates print warnings on unused templates. --printI18nWarnings print missing translations
--templateMetrics display metrics about template executions --printMemoryUsage print memory usage to screen at intervals
--templateMetricsHints calculate some improvement hints when combined with --templateMetrics --printPathWarnings print warnings on duplicate target paths etc.
-t, --theme strings themes to use (located in /themes/THEMENAME/) --printUnusedTemplates print warnings on unused templates.
--trace file write trace to file (not useful in general) -s, --source string filesystem path to read files relative from
--templateMetrics display metrics about template executions
--templateMetricsHints calculate some improvement hints when combined with --templateMetrics
-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)
``` ```
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--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 path/config.yaml|json|toml)
--config string config file (default is path/config.yaml|json|toml) --configDir string config dir (default "config")
--configDir string config dir (default "config") --debug debug output
--debug debug output --log enable Logging
-e, --environment string build environment --logFile string log File path (if set, logging enabled automatically)
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern --quiet build in quiet mode
--log enable Logging -v, --verbose verbose output
--logFile string log File path (if set, logging enabled automatically) --verboseLog verbose logging
--quiet build in quiet mode
-s, --source string filesystem path to read files relative from
--themesDir string filesystem path to themes directory
-v, --verbose verbose output
--verboseLog verbose logging
``` ```
### SEE ALSO ### SEE ALSO

View file

@ -20,27 +20,27 @@ hugo new site [path] [flags]
### Options ### Options
``` ```
--force init inside non-empty directory --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
-f, --format string config file format (default "toml") -e, --environment string build environment
-h, --help help for site --force init inside non-empty directory
-f, --format string config file format (default "toml")
-h, --help help for site
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
-s, --source string filesystem path to read files relative from
--themesDir string filesystem path to themes directory
``` ```
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--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 path/config.yaml|json|toml)
--config string config file (default is path/config.yaml|json|toml) --configDir string config dir (default "config")
--configDir string config dir (default "config") --debug debug output
--debug debug output --log enable Logging
-e, --environment string build environment --logFile string log File path (if set, logging enabled automatically)
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern --quiet build in quiet mode
--log enable Logging -v, --verbose verbose output
--logFile string log File path (if set, logging enabled automatically) --verboseLog verbose logging
--quiet build in quiet mode
-s, --source string filesystem path to read files relative from
--themesDir string filesystem path to themes directory
-v, --verbose verbose output
--verboseLog verbose logging
``` ```
### SEE ALSO ### SEE ALSO

View file

@ -21,25 +21,25 @@ hugo new theme [name] [flags]
### Options ### Options
``` ```
-h, --help help for theme --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
-e, --environment string build environment
-h, --help help for theme
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
-s, --source string filesystem path to read files relative from
--themesDir string filesystem path to themes directory
``` ```
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--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 path/config.yaml|json|toml)
--config string config file (default is path/config.yaml|json|toml) --configDir string config dir (default "config")
--configDir string config dir (default "config") --debug debug output
--debug debug output --log enable Logging
-e, --environment string build environment --logFile string log File path (if set, logging enabled automatically)
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern --quiet build in quiet mode
--log enable Logging -v, --verbose verbose output
--logFile string log File path (if set, logging enabled automatically) --verboseLog verbose logging
--quiet build in quiet mode
-s, --source string filesystem path to read files relative from
--themesDir string filesystem path to themes directory
-v, --verbose verbose output
--verboseLog verbose logging
``` ```
### SEE ALSO ### SEE ALSO

View file

@ -29,67 +29,67 @@ hugo server [flags]
### Options ### Options
``` ```
--appendPort append port to baseURL (default true) --appendPort append port to baseURL (default true)
-b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/ -b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
--bind string interface to which the server will bind (default "127.0.0.1") --bind string interface to which the server will bind (default "127.0.0.1")
-D, --buildDrafts include content marked as draft -D, --buildDrafts include content marked as draft
-E, --buildExpired include expired content -E, --buildExpired include expired content
-F, --buildFuture include content with publishdate in the future -F, --buildFuture include content with publishdate in the future
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/ --cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
--cleanDestinationDir remove files from destination not found in static directories --cleanDestinationDir remove files from destination not found in static directories
-c, --contentDir string filesystem path to content directory --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
-d, --destination string filesystem path to write files to -c, --contentDir string filesystem path to content directory
--disableBrowserError do not show build errors in the browser -d, --destination string filesystem path to write files to
--disableFastRender enables full re-renders on changes --disableBrowserError do not show build errors in the browser
--disableKinds strings disable different kind of pages (home, RSS etc.) --disableFastRender enables full re-renders on changes
--disableLiveReload watch without enabling live browser reload on rebuild --disableKinds strings disable different kind of pages (home, RSS etc.)
--enableGitInfo add Git revision, date, author, and CODEOWNERS info to the pages --disableLiveReload watch without enabling live browser reload on rebuild
--forceSyncStatic copy all files when static is changed. --enableGitInfo add Git revision, date, author, and CODEOWNERS info to the pages
--gc enable to run some cleanup tasks (remove unused cache files) after the build -e, --environment string build environment
-h, --help help for server --forceSyncStatic copy all files when static is changed.
--ignoreCache ignores the cache directory --gc enable to run some cleanup tasks (remove unused cache files) after the build
-l, --layoutDir string filesystem path to layout directory -h, --help help for server
--liveReloadPort int port for live reloading (i.e. 443 in HTTPS proxy situations) (default -1) --ignoreCache ignores the cache directory
--meminterval string interval to poll memory usage (requires --memstats), valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". (default "100ms") --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--memstats string log memory usage to this file -l, --layoutDir string filesystem path to layout directory
--minify minify any supported output format (HTML, XML etc.) --liveReloadPort int port for live reloading (i.e. 443 in HTTPS proxy situations) (default -1)
--navigateToChanged navigate to changed content file on live browser reload --meminterval string interval to poll memory usage (requires --memstats), valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". (default "100ms")
--noBuildLock don't create .hugo_build.lock file --memstats string log memory usage to this file
--noChmod don't sync permission mode of files --minify minify any supported output format (HTML, XML etc.)
--noHTTPCache prevent HTTP caching --navigateToChanged navigate to changed content file on live browser reload
--noTimes don't sync modification time of files --noBuildLock don't create .hugo_build.lock file
--panicOnWarning panic on first WARNING log --noChmod don't sync permission mode of files
--poll string set this to a poll interval, e.g --poll 700ms, to use a poll based approach to watch for file system changes --noHTTPCache prevent HTTP caching
-p, --port int port on which the server will listen (default 1313) --noTimes don't sync modification time of files
--printI18nWarnings print missing translations --panicOnWarning panic on first WARNING log
--printMemoryUsage print memory usage to screen at intervals --poll string set this to a poll interval, e.g --poll 700ms, to use a poll based approach to watch for file system changes
--printPathWarnings print warnings on duplicate target paths etc. -p, --port int port on which the server will listen (default 1313)
--printUnusedTemplates print warnings on unused templates. --printI18nWarnings print missing translations
--renderStaticToDisk serve static files from disk and dynamic files from memory --printMemoryUsage print memory usage to screen at intervals
--renderToDisk serve all files from disk (default is from memory) --printPathWarnings print warnings on duplicate target paths etc.
--templateMetrics display metrics about template executions --printUnusedTemplates print warnings on unused templates.
--templateMetricsHints calculate some improvement hints when combined with --templateMetrics --renderStaticToDisk serve static files from disk and dynamic files from memory
-t, --theme strings themes to use (located in /themes/THEMENAME/) --renderToDisk serve all files from disk (default is from memory)
--trace file write trace to file (not useful in general) -s, --source string filesystem path to read files relative from
-w, --watch watch filesystem for changes and recreate as needed (default true) --templateMetrics display metrics about template executions
--templateMetricsHints calculate some improvement hints when combined with --templateMetrics
-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)
-w, --watch watch filesystem for changes and recreate as needed (default true)
``` ```
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--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 path/config.yaml|json|toml)
--config string config file (default is path/config.yaml|json|toml) --configDir string config dir (default "config")
--configDir string config dir (default "config") --debug debug output
--debug debug output --log enable Logging
-e, --environment string build environment --logFile string log File path (if set, logging enabled automatically)
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern --quiet build in quiet mode
--log enable Logging -v, --verbose verbose output
--logFile string log File path (if set, logging enabled automatically) --verboseLog verbose logging
--quiet build in quiet mode
-s, --source string filesystem path to read files relative from
--themesDir string filesystem path to themes directory
-v, --verbose verbose output
--verboseLog verbose logging
``` ```
### SEE ALSO ### SEE ALSO

View file

@ -368,7 +368,7 @@ In case you need to pass a custom data: (`(dict "Count" numeric_value_only)` is
The following localization examples assume your site's primary language is English, with translations to French and German. The following localization examples assume your site's primary language is English, with translations to French and German.
{{< code-toggle file="config" >}} {{< code-toggle file="config" >}}
defaultContentLang = 'en' defaultContentLanguage = 'en'
[languages] [languages]
[languages.en] [languages.en]
@ -568,7 +568,19 @@ If there is more than one language defined, the `LanguagePrefix` variable will e
## Generate multilingual content with `hugo new` ## Generate multilingual content with `hugo new`
Currently, `hugo new` is not ready to support generating multilingual content. But there is a [proposal topic](https://github.com/gohugoio/hugo/issues/7732) about this in GitHub issue to discuss how it should work. If you organize content with translations in the same directory:
```text
hugo new post/test.en.md
hugo new post/test.de.md
```
If you organize content with translations in different directories:
```text
hugo new content/en/post/test.md
hugo new content/de/post/test.md
```
[abslangurl]: /functions/abslangurl [abslangurl]: /functions/abslangurl
[config]: /getting-started/configuration/ [config]: /getting-started/configuration/

View file

@ -79,7 +79,7 @@ The following is a list of values that can be used in a `permalink` definition i
: the content's section : the content's section
`:sections` `:sections`
: the content's sections hierarchy. Uou can use a selection of the sections using _slice syntax_: `:sections[1:]` includes all but the first, `:sections[:last]` includes all but the last, `:sections[last]` includes only the last, `:sections[1:2]` includes section 2 and 3. Note that this slice access will not throw any out-of-bounds errors, so you don't have to be exact. : the content's sections hierarchy. You can use a selection of the sections using _slice syntax_: `:sections[1:]` includes all but the first, `:sections[:last]` includes all but the last, `:sections[last]` includes only the last, `:sections[1:2]` includes section 2 and 3. Note that this slice access will not throw any out-of-bounds errors, so you don't have to be exact.
`:title` `:title`
: the content's title : the content's title

View file

@ -55,6 +55,7 @@ With `baseURL = https://example.org/docs/`
{{ absLangURL "/" }} → https://example.org/en/ {{ absLangURL "/" }} → https://example.org/en/
{{ absLangURL "/articles" }} → https://example.org/en/articles {{ absLangURL "/articles" }} → https://example.org/en/articles
{{ absLangURL "/style.css" }} → https://example.org/en/style.css {{ absLangURL "/style.css" }} → https://example.org/en/style.css
```
{{% note %}} {{% note %}}
The last three examples are not desirable in most situations. As a best practice, never include a leading slash when using this function. The last three examples are not desirable in most situations. As a best practice, never include a leading slash when using this function.

View file

@ -10,7 +10,9 @@ menu:
docs: docs:
parent: "functions" parent: "functions"
keywords: [trim] keywords: [trim]
signature: ["chomp INPUT"] signature:
- "chomp INPUT"
- "strings.Chomp INPUT"
workson: [] workson: []
hugoversion: hugoversion:
relatedfuncs: [truncate] relatedfuncs: [truncate]

View file

@ -9,7 +9,9 @@ menu:
docs: docs:
parent: "functions" parent: "functions"
keywords: [counting, word count] keywords: [counting, word count]
signature: ["countrunes INPUT"] signature:
- "countrunes INPUT"
- "strings.CountRunes INPUT"
workson: [] workson: []
hugoversion: hugoversion:
relatedfuncs: [] relatedfuncs: []

View file

@ -0,0 +1,15 @@
---
title: crypto.FNV32a
description: Returns the FNV (FowlerNollVo) 32 bit hash of a given string.
categories: [functions]
menu:
docs:
parent: "functions"
keywords: [crypto hash FNV32 Fowler-Noll-Vo]
signature: ["crypto.FNV32a STRING"]
aliases: []
---
This function calculates the 32 bit [FNV1a hash](https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function#FNV-1a_hash) of a given string according to the [specification](https://datatracker.ietf.org/doc/html/draft-eastlake-fnv-12):
{{ crypto.FNV32a "Hello world" }} → 1498229191

View file

@ -9,7 +9,9 @@ menu:
docs: docs:
parent: "functions" parent: "functions"
keywords: [dates,time,strings] keywords: [dates,time,strings]
signature: ["time.Format LAYOUT INPUT"] signature:
- "time.Format LAYOUT INPUT"
- "dateFormat LAYOUT INPUT"
workson: [] workson: []
hugoversion: hugoversion:
relatedfuncs: [Format,now,Unix,time] relatedfuncs: [Format,now,Unix,time]

View file

@ -0,0 +1,32 @@
---
title: duration
description: Returns a `time.Duration` structure, using the given time unit and duration number.
categories: [functions]
menu:
docs:
parent: "functions"
keywords: [time duration]
signature: ["duration TIME_UNIT DURATION_NUMBER"]
aliases: []
---
`time.Duration` converts a given number into a [`time.Duration`](https://pkg.go.dev/time#Duration) structure so you can access its fields. E.g. you can perform [time operations](https://pkg.go.dev/time#Duration) on the returned `time.Duration` value:
{{ printf "There are %.0f seconds in one day." (duration "hour" 24).Seconds }}
<!-- Output: There are 86400 seconds in one day. -->
Make your code simpler to understand by using a [chained pipeline](https://pkg.go.dev/text/template#hdr-Pipelines):
{{ mul 7.75 60 | duration "minute" }} → 7h45m0s
{{ mul 120 60 | mul 1000 | duration "millisecond" }} → 2h0m0s
You have to specify a time unit for the number given to the function. Valid time units are:
Duration|Valid time units
:--|:--
hours|`hour`, `h`
minutes|`minute`, `m`
seconds|`second`, `s`
milliseconds|`millisecond`, `ms`
microseconds|`microsecond`, `us`, `µs`
nanoseconds|`nanosecond`, `ns`

View file

@ -16,7 +16,7 @@ relatedfuncs: []
deprecated: false deprecated: false
--- ---
`emoji` runs a passed string through the Emoji emoticons processor. `emojify` runs a passed string through the Emoji emoticons processor.
See the [Emoji cheat sheet][emojis] for available emoticons. See the [Emoji cheat sheet][emojis] for available emoticons.

View file

@ -12,7 +12,7 @@ signature:
relatedfuncs: [replaceRE] relatedfuncs: [replaceRE]
aliases: [] aliases: []
--- ---
By default, the `findRE` function finds all matches. You can limit the number of matches with an optional LIMIT paramater. By default, the `findRE` function finds all matches. You can limit the number of matches with an optional LIMIT parameter.
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. 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.

View file

@ -22,7 +22,7 @@ aliases: []
`hugo` returns an instance that contains the following functions: `hugo` returns an instance that contains the following functions:
hugo.Generator hugo.Generator
: `<meta>` tag for the version of Hugo that generated the site. `hugo.Generator` outputs a *complete* HTML tag; e.g. `<meta name="generator" content="Hugo 0.99.1" />` : `<meta>` tag for the version of Hugo that generated the site. `hugo.Generator` outputs a *complete* HTML tag; e.g. `<meta name="generator" content="Hugo 0.63.2">`
hugo.Version hugo.Version
: the current version of the Hugo binary you are using e.g. `0.99.1` : the current version of the Hugo binary you are using e.g. `0.99.1`

View file

@ -10,7 +10,10 @@ menu:
docs: docs:
parent: "functions" parent: "functions"
keywords: [internationalization,i18n,multilingual] keywords: [internationalization,i18n,multilingual]
signature: ["i18n KEY", "T KEY"] signature:
- "i18n KEY"
- "T KEY"
- "lang.Translate KEY"
workson: [] workson: []
hugoversion: hugoversion:
relatedfuncs: [] relatedfuncs: []

View file

@ -10,7 +10,9 @@ menu:
docs: docs:
parent: "functions" parent: "functions"
keywords: [strings,casing] keywords: [strings,casing]
signature: ["lower INPUT"] signature:
- "lower INPUT"
- "strings.ToLower INPUT"
workson: [] workson: []
hugoversion: hugoversion:
relatedfuncs: [] relatedfuncs: []
@ -18,6 +20,10 @@ deprecated: false
aliases: [] aliases: []
--- ---
```
{{lower "BatMan"}} → "batman" Note that `lower` can be applied in your templates in more than one way:
```go-html-template
{{ lower "BatMan" }} → "batman"
{{ "BatMan" | lower }} → "batman"
``` ```

View file

@ -8,11 +8,13 @@ categories: [functions]
menu: menu:
docs: docs:
parent: "functions" parent: "functions"
keywords: [] keywords: [replace]
signature: ["strings.Replace INPUT OLD NEW [LIMIT]", "replace INPUT OLD NEW [LIMIT]"] signature:
- "replace INPUT OLD NEW [LIMIT]"
- "strings.Replace INPUT OLD NEW [LIMIT]"
workson: [] workson: []
hugoversion: hugoversion:
relatedfuncs: [] relatedfuncs: [replaceRE]
deprecated: false deprecated: false
aliases: [] aliases: []
--- ---

View file

@ -5,14 +5,14 @@ categories: [functions]
menu: menu:
docs: docs:
parent: functions parent: functions
keywords: [regex] keywords: [replace regex]
signature: signature:
- "replaceRE PATTERN REPLACEMENT INPUT [LIMIT]" - "replaceRE PATTERN REPLACEMENT INPUT [LIMIT]"
- "strings.ReplaceRE PATTERN REPLACEMENT INPUT [LIMIT]" - "strings.ReplaceRE PATTERN REPLACEMENT INPUT [LIMIT]"
relatedfuncs: [findRE] relatedfuncs: [replace,findRE]
aliases: [] aliases: []
--- ---
By default, the `replaceRE` function replaces all matches. You can limit the number of matches with an optional LIMIT paramater. By default, the `replaceRE` function replaces all matches. You can limit the number of matches with an optional LIMIT parameter.
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. 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.

View file

@ -10,7 +10,9 @@ menu:
docs: docs:
parent: "functions" parent: "functions"
keywords: [strings] keywords: [strings]
signature: ["slicestr STRING START [END]"] signature:
- "slicestr STRING START [END]"
- "strings.SliceString STRING START [END]"
workson: [] workson: []
hugoversion: hugoversion:
relatedfuncs: [] relatedfuncs: []

View file

@ -0,0 +1,18 @@
---
title: strings.Contains
description: Reports whether a string contains a substring.
categories: [functions]
menu:
docs:
parent: "functions"
keywords: [string strings substring contains]
signature: ["strings.Contains STRING SUBSTRING"]
aliases: []
relatedfuncs: [strings.ContainsAny]
---
{{ strings.Contains "Hugo" "go" }} → true
The check is case sensitive:
{{ strings.Contains "Hugo" "Go" }} → false

View file

@ -0,0 +1,18 @@
---
title: strings.ContainsAny
description: Reports whether a string contains any character from a given string.
categories: [functions]
menu:
docs:
parent: "functions"
keywords: [string strings substring contains any]
signature: ["strings.ContainsAny STRING CHARACTERS"]
aliases: []
relatedfuncs: [strings.Contains]
---
{{ strings.ContainsAny "Hugo" "gm" }} → true
The check is case sensitive:
{{ strings.ContainsAny "Hugo" "Gm" }} → false

View file

@ -0,0 +1,14 @@
---
title: strings.FirstUpper
description: Capitalizes the first character of a given string.
categories: [functions]
menu:
docs:
parent: "functions"
keywords: [strings capitalize uppercase first]
signature: ["strings.FirstUpper STRING"]
hugoversion:
aliases: []
---
{{ strings.FirstUpper "foo" }} → "Foo"

View file

@ -11,7 +11,9 @@ menu:
parent: "functions" parent: "functions"
keywords: [strings] keywords: [strings]
aliases: [] aliases: []
signature: ["substr STRING START [LENGTH]"] signature:
- "substr STRING START [LENGTH]"
- "strings.Substr STRING START [LENGTH]"
workson: [] workson: []
hugoversion: hugoversion:
relatedfuncs: [] relatedfuncs: []

View file

@ -0,0 +1,20 @@
---
title: time.ParseDuration
description: Parses a given duration string into a `time.Duration` structure.
categories: [functions]
menu:
docs:
parent: "functions"
keywords: [time parse duration]
signature: ["time.ParseDuration DURATION"]
hugoversion:
aliases: []
---
`time.ParseDuration` parses a duration string into a [`time.Duration`](https://pkg.go.dev/time#Duration) structure so you can access its fields.
A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as `300ms`, `-1.5h` or `2h45m`. Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`.
You can perform [time operations](https://pkg.go.dev/time#Duration) on the returned `time.Duration` value:
{{ printf "There are %.0f seconds in one day." (time.ParseDuration "24h").Seconds }}
<!-- Output: There are 86400 seconds in one day. -->

View file

@ -10,7 +10,9 @@ menu:
docs: docs:
parent: "functions" parent: "functions"
keywords: [strings] keywords: [strings]
signature: ["title INPUT"] signature:
- "title INPUT"
- "strings.Title INPUT"
workson: [] workson: []
hugoversion: hugoversion:
relatedfuncs: [] relatedfuncs: []

View file

@ -10,7 +10,9 @@ menu:
docs: docs:
parent: "functions" parent: "functions"
keywords: [strings] keywords: [strings]
signature: ["trim INPUT CUTSET"] signature:
- "trim INPUT CUTSET"
- "strings.Trim INPUT CUTSET"
workson: [] workson: []
hugoversion: hugoversion:
relatedfuncs: [] relatedfuncs: []

View file

@ -10,7 +10,9 @@ menu:
docs: docs:
parent: "functions" parent: "functions"
keywords: [strings] keywords: [strings]
signature: ["truncate SIZE INPUT", "truncate SIZE ELLIPSIS INPUT"] signature:
- "truncate SIZE [ELLIPSIS] INPUT"
- "strings.Truncate SIZE [ELLIPSIS] INPUT"
workson: [] workson: []
hugoversion: 19 hugoversion: 19
relatedfuncs: [] relatedfuncs: []

View file

@ -11,7 +11,9 @@ menu:
docs: docs:
parent: "functions" parent: "functions"
toc: toc:
signature: ["upper INPUT"] signature:
- "upper INPUT"
- "strings.ToUpper INPUT"
workson: [] workson: []
hugoversion: hugoversion:
relatedfuncs: [] relatedfuncs: []

View file

@ -567,6 +567,19 @@ Hugo will, by default, render all 404 errors when running `hugo server` with the
status = 404 status = 404
``` ```
## 404 Server Error Page
{{< new-in "0.103.0" >}}
Hugo will, by default, render all 404 errors when running `hugo server` with the `404.html` template. Note that if you have already added one or more redirects to your [Server Config](#server-config), you need to add the 404 redirect explicitly, e.g:
```toml
[[redirects]]
from = "/**"
to = "/404.html"
status = 404
```
## Configure Title Case ## Configure Title Case
Set `titleCaseStyle` to specify the title style used by the [title](/functions/title/) template function and the automatic section titles in Hugo. It defaults to [AP Stylebook](https://www.apstylebook.com/) for title casing, but you can also set it to `Chicago` or `Go` (every word starts with a capital letter). Set `titleCaseStyle` to specify the title style used by the [title](/functions/title/) template function and the automatic section titles in Hugo. It defaults to [AP Stylebook](https://www.apstylebook.com/) for title casing, but you can also set it to `Chicago` or `Go` (every word starts with a capital letter).

View file

@ -20,18 +20,20 @@ toc: true
{{< youtube sB0HLHjgQ7E >}} {{< youtube sB0HLHjgQ7E >}}
Running the `hugo new site` generator from the command-line will create a directory structure with the following elements: Running `hugo new site example` from the command line creates a directory structure with the following elements:
```txt ```txt
. example/
├── archetypes ├── archetypes/
├── config.toml │   └── default.md
├── content ├── assets/
├── data ├── content/
├── layouts ├── data/
├── public ├── layouts/
├── static ├── public/
└── themes ├── static/
├── themes/
└── config.toml
``` ```
## Directory Structure Explained ## Directory Structure Explained
@ -43,7 +45,7 @@ The following is a high-level overview of each of the directories with links to
By default, Hugo will create new content files with at least `date`, `title` (inferred from the filename), and `draft = true`. This saves time and promotes consistency for sites using multiple content types. You can create your own [archetypes][] with custom preconfigured front matter fields as well. By default, Hugo will create new content files with at least `date`, `title` (inferred from the filename), and `draft = true`. This saves time and promotes consistency for sites using multiple content types. You can create your own [archetypes][] with custom preconfigured front matter fields as well.
[`assets`][] [`assets`][]
: Stores all the files which need be processed by [Hugo Pipes](/hugo-pipes/). Only the files whose `.Permalink` or `.RelPermalink` are used will be published to the `public` directory. Note: assets directory is not created by default. : Stores all the files which need be processed by [Hugo Pipes](/hugo-pipes/). Only the files whose `.Permalink` or `.RelPermalink` are used will be published to the `public` directory.
[`config`](/getting-started/configuration/) [`config`](/getting-started/configuration/)
: Hugo ships with a large number of [configuration directives][]. : Hugo ships with a large number of [configuration directives][].

View file

@ -1,176 +1,216 @@
--- ---
title: Quick Start title: Quick Start
linktitle: Quick Start linktitle: Quick Start
description: Create a Hugo site using the beautiful Ananke theme. description: Learn to create a Hugo site in minutes.
date: 2013-07-01
publishdate: 2013-07-01
categories: [getting started] categories: [getting started]
keywords: [quick start,usage] keywords: [quick start,usage]
authors: [Shekhar Gulati, Ryan Watters]
menu: menu:
docs: docs:
parent: "getting-started" parent: getting-started
weight: 10 weight: 10
weight: 10 weight: 10
sections_weight: 10
draft: false
aliases: [/quickstart/,/overview/quickstart/]
toc: true toc: true
aliases: [/quickstart/,/overview/quickstart/]
--- ---
{{% note %}} In this tutorial you will:
This quick start uses `macOS` in the examples. For instructions about how to install Hugo on other operating systems, see [install](/installation/).
It is required to have [Git installed](https://git-scm.com/downloads) to run this tutorial. 1. Create a site
2. Add content
3. Configure the site
4. Publish the site
For other approaches to learning Hugo (like books or video tutorials), refer to the [external learning resources](/getting-started/external-learning-resources/) page. ## Prerequisites
{{% /note %}}
## Step 1: Install Hugo Before you begin this tutorial you must:
Install the **extended version of Hugo** (this is required for the current theme used). 1. [Install Hugo] (the extended edition)
1. [Install Git]
{{% note %}} You must also be comfortable working from the command line.
`Homebrew` and `MacPorts`, package managers for `macOS`, can be installed from [brew.sh](https://brew.sh/) or [macports.org](https://www.macports.org/) respectively. See [install](/installation/) if you are running Windows etc.
{{% /note %}}
```bash ## Create a site
brew install hugo
# or ### Commands
port install hugo
Run these commands[^1] to create a Hugo site with the [Ananke] theme. The next section provides an explanation of each command.
[^1]: If you are a Windows user, you must run these commands with [PowerShell]. You cannot use Windows Powershell, which is a different application, or the Command Prompt.
```text
hugo new site quickstart
cd quickstart
git init
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke themes/ananke
echo "theme = 'ananke'" >> config.toml
hugo server
``` ```
To verify your new install: View your site at the URL displayed in your terminal. Press `Ctrl + C` to stop Hugo's development server.
```bash ### Explanation of commands
hugo version
# Example output: hugo v0.104.2+extended darwin/amd64 BuildDate=unknown
```
It should state that it is `extended`. If it does not, uninstall it and try another installation method. Create the [directory structure] for your project in the `quickstart` directory.
{{< asciicast ItACREbFgvJ0HjnSNeTknxWy9 >}} ```text
## Step 2: Create a New Site
```bash
hugo new site quickstart hugo new site quickstart
``` ```
The above will create a new Hugo site in a folder named `quickstart`. Change the current directory to the root of your project.
{{< asciicast 3mf1JGaN0AX0Z7j5kLGl3hSh8 >}} ```text
## Step 3: Add a Theme
See [themes.gohugo.io](https://themes.gohugo.io/) for a list of themes to consider. This quickstart uses the beautiful [Ananke theme](https://themes.gohugo.io/gohugo-theme-ananke/).
First, download the theme from GitHub and add it to your site's `themes` directory:
```bash
cd quickstart cd quickstart
```
Initialize an empty Git repository in the current directory.
```text
git init git init
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke
``` ```
Then, add the theme to the site configuration: Clone the [Ananke] theme into the `themes` directory, adding it to your project as a [Git submodule].
```bash ```text
echo theme = \"ananke\" >> config.toml git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke themes/ananke
``` ```
{{< asciicast 7naKerRYUGVPj8kiDmdh5k5h9 >}} Append a line to the site configuration file, indicating the current theme.
## Step 4: Add Some Content ```text
echo "theme = 'ananke'" >> config.toml
```
You can manually create content files (for example as `content/<CATEGORY>/<FILE>.<FORMAT>`) and provide metadata in them, however you can use the `new` command to do a few things for you (like add title and date): Start Hugo's development server to view the site.
```txt ```text
hugo server
```
Press `Ctrl + C` to stop Hugo's development server.
## Add content
Add a new page to your site.
```text
hugo new posts/my-first-post.md hugo new posts/my-first-post.md
``` ```
{{< asciicast eUojYCfRTZvkEiqc52fUsJRBR >}} Hugo created the file in the `content/posts` directory. Open the file with your editor.
Edit the newly created content file if you want, it will start with something like this: ```text
```md
--- ---
title: "My First Post" title: "My First Post"
date: 2019-03-26T08:47:11+01:00 date: 2022-11-20T09:03:20-08:00
draft: true draft: true
--- ---
```
Notice the `draft` value in the [front matter] is `true`. By default, Hugo does not publish draft content when you build the site. Learn more about [draft, future, and expired content].
Add some [markdown] to the body of the post, but do not change the `draft` value.
[markdown]: https://commonmark.org/help/
```text
---
title: "My First Post"
date: 2022-11-20T09:03:20-08:00
draft: true
---
## Introduction
This is **bold** text, and this is *emphasized* text.
Visit the [Hugo](https://gohugo.io) website!
```
Save the file, then start Hugos development server to view the site. You can run either of the following commands to include draft content.
```text
hugo server --buildDrafts
hugo server -D
```
View your site at the URL displayed in your terminal. Keep the development server running as you continue to add and change content.
{{% note %}}
Hugo's rendering engine conforms to the CommonMark [specification] for markdown. The CommonMark organization provides a useful [live testing tool] powered by the reference implementation.
[live testing tool]: https://spec.commonmark.org/dingus/
[specification]: https://spec.commonmark.org/
{{% /note %}}
## Configure the site
With your editor, open the [site configuration] file (`config.toml`) in the root of your project.
```text
baseURL = 'http://example.org/'
languageCode = 'en-us'
title = 'My New Hugo Site'
theme = 'ananke'
```
Make the following changes:
1. Set the `baseURL` for your production site. This value must begin with the protocol and end with a slash, as shown above.
2. Set the `languageCode` to your language and region.
3. Set the `title` for your production site.
Start Hugo's development server to see your changes, remembering to include draft content.
```text
hugo server -D
``` ```
{{% note %}} {{% note %}}
Drafts do not get deployed; once you finish a post, update the header of the post to say `draft: false`. More info [here](/getting-started/usage/#draft-future-and-expired-content). Most theme authors provide configuration guidelines and options. Make sure to visit your theme's repository or documentation site for details.
[The New Dynamic], authors of the Ananke theme, provide [documentation] for configuration and usage. They also provide a [demonstration site].
[demonstration site]: https://gohugo-ananke-theme-demo.netlify.app/
[documentation]: https://github.com/theNewDynamic/gohugo-theme-ananke#readme
[The New Dynamic]: https://www.thenewdynamic.com/
{{% /note %}} {{% /note %}}
## Step 5: Start the Hugo server ## Publish the site
Now, start the Hugo server with [drafts](/getting-started/usage/#draft-future-and-expired-content) enabled: In this step you will _publish_ your site, but you will not _deploy_ it.
{{< asciicast BvJBsF6egk9c163bMsObhuNXj >}} When you _publish_ your site, Hugo creates the entire static site in the `public` directory in the root of your project. This includes the HTML files, and assets such as images, CSS files, and JavaScript files.
```txt When you publish your site, you typically do _not_ want to include [draft, future, or expired content]. The command is simple.
▶ hugo server -D
| EN ```text
+------------------+----+ hugo
Pages | 10
Paginator pages | 0
Non-page files | 0
Static files | 3
Processed images | 0
Aliases | 1
Sitemaps | 1
Cleaned | 0
Total in 11 ms
Watching for changes in /Users/bep/quickstart/{content,data,layouts,static,themes}
Watching for config changes in /Users/bep/quickstart/config.toml
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop
``` ```
**Navigate to your new site at [http://localhost:1313/](http://localhost:1313/).** To learn how to _deploy_ your site, see the [hosting and deployment] section.
Feel free to edit or add new content and you will see the changes in the browser right away while the Hugo server is running. (You might need to force refresh your web browser, something like Ctrl-R usually works.) ## Ask for help
## Step 6: Customize the Theme Hugo's [forum] is an active community of users and developers who answer questions, share knowledge, and provide examples. A quick search of over 20,000 topics will often answer your question. Please be sure to read about [requesting help] before asking your first question.
Your new site already looks great, but you will want to tweak it a little before you release it to the public. ## Other resources
### Site Configuration For other resources to help you learn Hugo, including books and video tutorials, see the [external learning resources](/getting-started/external-learning-resources/) page.
Open up `config.toml` in a text editor: [Ananke]: https://github.com/theNewDynamic/gohugo-theme-ananke
[directory structure]: /getting-started/directory-structure
```toml [draft, future, and expired content]: /getting-started/usage/#draft-future-and-expired-content
baseURL = "https://example.org/" [draft, future, or expired content]: /getting-started/usage/#draft-future-and-expired-content
languageCode = "en-us" [external learning resources]:/getting-started/external-learning-resources/
title = "My New Hugo Site" [forum]: https://discourse.gohugo.io/
theme = "ananke" [forum]: https://discourse.gohugo.io/
``` [front matter]: /content-management/front-matter
[Git submodule]: https://git-scm.com/book/en/v2/Git-Tools-Submodules
Replace the `title` above with something more personal. Also, if you already have a domain ready, set the `baseURL`. Note that this value is not needed when running the local development server. [hosting and deployment]: /hosting-and-deployment/
[Install Git]: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
{{% note %}} [Install Hugo]: /installation/
**Tip:** Make the changes to the site configuration or any other file in your site while the Hugo server is running, and you will see the changes in the browser right away, though you may need to [clear your cache](https://kb.iu.edu/d/ahic). [PowerShell]: https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows
{{% /note %}} [Requesting Help]: https://discourse.gohugo.io/t/requesting-help/9132
[Requesting Help]: https://discourse.gohugo.io/t/requesting-help/9132
For theme specific configuration options, see the [theme site](https://github.com/theNewDynamic/gohugo-theme-ananke). [site configuration]: /getting-started/configuration/
**For further theme customization, see [Customize a Theme](/themes/customizing/).**
### Step 7: Build static pages
It is simple. Just call:
```txt
hugo -D
```
Output will be in `./public/` directory by default (`-d`/`--destination` flag to change it, or set `publishdir` in the config file).

View file

@ -14,6 +14,6 @@ sections_weight: 50
toc: true toc: true
--- ---
You can host your Hugo site using [Cloudflare Pages](https://developers.cloudflare.com/pages/). Pages are super fast, always up-to-date, and deployed directly from your Git provider (currently supports only GitHub and GitLab). [Cloudflare Pages](https://developers.cloudflare.com/pages/) are super fast, always up-to-date, and deployed directly from your Git provider (currently supports only GitHub and GitLab).
Cloudflare Pages has a handy tutorial on [how to deploy a Hugo site](https://developers.cloudflare.com/pages/framework-guides/deploy-a-hugo-site/). Cloudflare Pages docs have a detailed tutorial on [how to deploy a Hugo site](https://developers.cloudflare.com/pages/framework-guides/deploy-a-hugo-site/).

View file

@ -12,8 +12,6 @@ images:
Hugo has been caching the highlighter output to disk, so for repeated builds it has been fine, but this little snippet, showing a build of the [gohugo.io](https://gohugo.io/) site without cache and with both Pygments and Chroma, should illustrate the improvement: Hugo has been caching the highlighter output to disk, so for repeated builds it has been fine, but this little snippet, showing a build of the [gohugo.io](https://gohugo.io/) site without cache and with both Pygments and Chroma, should illustrate the improvement:
{{< asciicast Lc5iwTVny2kuUC8lqvNnL6oDU >}}
See the [Updated Documentation](https://gohugo.io/content-management/syntax-highlighting/) for more information about how this works. See the [Updated Documentation](https://gohugo.io/content-management/syntax-highlighting/) for more information about how this works.
Worth mentioning is also the `liveReloadPort` flag on `hugo server`, which makes it possible to do "live reloads" behind a HTTPS proxy, which makes for very cool remote customer demos. Worth mentioning is also the `liveReloadPort` flag on `hugo server`, which makes it possible to do "live reloads" behind a HTTPS proxy, which makes for very cool remote customer demos.
@ -61,4 +59,3 @@ Hugo now has:
* Add `liveReloadPort` flag to server [b1804776](https://github.com/gohugoio/hugo/commit/b180477631555824a06293053e2b6e63c5f07361) [@bep](https://github.com/bep) [#3882](https://github.com/gohugoio/hugo/issues/3882) * Add `liveReloadPort` flag to server [b1804776](https://github.com/gohugoio/hugo/commit/b180477631555824a06293053e2b6e63c5f07361) [@bep](https://github.com/bep) [#3882](https://github.com/gohugoio/hugo/issues/3882)
* Add `noHTTPCache` flag to hugo server (default on) [0b34af21](https://github.com/gohugoio/hugo/commit/0b34af216154367af7f53ce93d44e6b3d58c3f34) [@bep](https://github.com/bep) [#3897](https://github.com/gohugoio/hugo/issues/3897) * Add `noHTTPCache` flag to hugo server (default on) [0b34af21](https://github.com/gohugoio/hugo/commit/0b34af216154367af7f53ce93d44e6b3d58c3f34) [@bep](https://github.com/bep) [#3897](https://github.com/gohugoio/hugo/issues/3897)
* Make `noHTTPCache` default on [80c7ea60](https://github.com/gohugoio/hugo/commit/80c7ea60a0e0f488563a6b7311f3d4c23457aac7) [@bep](https://github.com/bep) [#3897](https://github.com/gohugoio/hugo/issues/3897) * Make `noHTTPCache` default on [80c7ea60](https://github.com/gohugoio/hugo/commit/80c7ea60a0e0f488563a6b7311f3d4c23457aac7) [@bep](https://github.com/bep) [#3897](https://github.com/gohugoio/hugo/issues/3897)

View file

@ -100,15 +100,6 @@
"ballerina" "ballerina"
] ]
}, },
{
"Name": "Base Makefile",
"Aliases": [
"make",
"makefile",
"mf",
"bsdmake"
]
},
{ {
"Name": "Bash", "Name": "Bash",
"Aliases": [ "Aliases": [
@ -163,6 +154,12 @@
"bnf" "bnf"
] ]
}, },
{
"Name": "BQN",
"Aliases": [
"bqn"
]
},
{ {
"Name": "Brainfuck", "Name": "Brainfuck",
"Aliases": [ "Aliases": [
@ -611,6 +608,12 @@
"hlb" "hlb"
] ]
}, },
{
"Name": "HLSL",
"Aliases": [
"hlsl"
]
},
{ {
"Name": "HTML", "Name": "HTML",
"Aliases": [ "Aliases": [
@ -720,6 +723,15 @@
"lua" "lua"
] ]
}, },
{
"Name": "Makefile",
"Aliases": [
"make",
"makefile",
"mf",
"bsdmake"
]
},
{ {
"Name": "Mako", "Name": "Mako",
"Aliases": [ "Aliases": [
@ -1004,7 +1016,8 @@
"posh", "posh",
"ps1", "ps1",
"psm1", "psm1",
"psd1" "psd1",
"pwsh"
] ]
}, },
{ {
@ -1032,6 +1045,12 @@
"proto" "proto"
] ]
}, },
{
"Name": "PSL",
"Aliases": [
"psl"
]
},
{ {
"Name": "Puppet", "Name": "Puppet",
"Aliases": [ "Aliases": [
@ -1185,6 +1204,14 @@
"scss" "scss"
] ]
}, },
{
"Name": "Sed",
"Aliases": [
"sed",
"gsed",
"ssed"
]
},
{ {
"Name": "Sieve", "Name": "Sieve",
"Aliases": [ "Aliases": [
@ -1244,6 +1271,10 @@
"sml" "sml"
] ]
}, },
{
"Name": "stas",
"Aliases": null
},
{ {
"Name": "Stylus", "Name": "Stylus",
"Aliases": [ "Aliases": [
@ -1410,6 +1441,13 @@
"vshell" "vshell"
] ]
}, },
{
"Name": "Vala",
"Aliases": [
"vala",
"vapi"
]
},
{ {
"Name": "VB.net", "Name": "VB.net",
"Aliases": [ "Aliases": [
@ -1430,6 +1468,14 @@
"vhdl" "vhdl"
] ]
}, },
{
"Name": "VHS",
"Aliases": [
"vhs",
"tape",
"cassette"
]
},
{ {
"Name": "VimL", "Name": "VimL",
"Aliases": [ "Aliases": [
@ -1691,22 +1737,6 @@
}, },
"media": { "media": {
"types": [ "types": [
{
"mainType": "application",
"subType": "javascript",
"delimiter": ".",
"firstSuffix": {
"suffix": "js",
"fullSuffix": ".js"
},
"type": "application/javascript",
"string": "application/javascript",
"suffixes": [
"js",
"jsm",
"mjs"
]
},
{ {
"mainType": "application", "mainType": "application",
"subType": "json", "subType": "json",
@ -1792,20 +1822,6 @@
"toml" "toml"
] ]
}, },
{
"mainType": "application",
"subType": "typescript",
"delimiter": ".",
"firstSuffix": {
"suffix": "ts",
"fullSuffix": ".ts"
},
"type": "application/typescript",
"string": "application/typescript",
"suffixes": [
"ts"
]
},
{ {
"mainType": "application", "mainType": "application",
"subType": "xml", "subType": "xml",
@ -2007,6 +2023,22 @@
"html" "html"
] ]
}, },
{
"mainType": "text",
"subType": "javascript",
"delimiter": ".",
"firstSuffix": {
"suffix": "js",
"fullSuffix": ".js"
},
"type": "text/javascript",
"string": "text/javascript",
"suffixes": [
"js",
"jsm",
"mjs"
]
},
{ {
"mainType": "text", "mainType": "text",
"subType": "jsx", "subType": "jsx",
@ -2064,6 +2096,20 @@
"tsx" "tsx"
] ]
}, },
{
"mainType": "text",
"subType": "typescript",
"delimiter": ".",
"firstSuffix": {
"suffix": "ts",
"fullSuffix": ".ts"
},
"type": "text/typescript",
"string": "text/typescript",
"suffixes": [
"ts"
]
},
{ {
"mainType": "text", "mainType": "text",
"subType": "x-sass", "subType": "x-sass",

2
go.mod
View file

@ -2,4 +2,4 @@ module github.com/gohugoio/hugoDocs
go 1.16 go 1.16
require github.com/gohugoio/gohugoioTheme v0.0.0-20221116211530-5ae8dcdd68d6 // indirect require github.com/gohugoio/gohugoioTheme v0.0.0-20221124154621-1451a01f406b // indirect

4
go.sum
View file

@ -41,3 +41,7 @@ github.com/gohugoio/gohugoioTheme v0.0.0-20220914071648-0ef1c51685bf h1:A8Ksnvp8
github.com/gohugoio/gohugoioTheme v0.0.0-20220914071648-0ef1c51685bf/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs= github.com/gohugoio/gohugoioTheme v0.0.0-20220914071648-0ef1c51685bf/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
github.com/gohugoio/gohugoioTheme v0.0.0-20221116211530-5ae8dcdd68d6 h1:eG53kL1LkQuKmrDdzbvvx6d60qM07zp2Wjo/tYxkDOY= github.com/gohugoio/gohugoioTheme v0.0.0-20221116211530-5ae8dcdd68d6 h1:eG53kL1LkQuKmrDdzbvvx6d60qM07zp2Wjo/tYxkDOY=
github.com/gohugoio/gohugoioTheme v0.0.0-20221116211530-5ae8dcdd68d6/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs= github.com/gohugoio/gohugoioTheme v0.0.0-20221116211530-5ae8dcdd68d6/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
github.com/gohugoio/gohugoioTheme v0.0.0-20221118083537-967e29e21382 h1:e30rl1dxWkYOcgdl0omeOK0HBzgDLI/b9MfYHrINjzU=
github.com/gohugoio/gohugoioTheme v0.0.0-20221118083537-967e29e21382/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
github.com/gohugoio/gohugoioTheme v0.0.0-20221124154621-1451a01f406b h1:TRrIisSY7ckt9FVHOOQtmKG4jsnORCYn72UMvMu+IQ0=
github.com/gohugoio/gohugoioTheme v0.0.0-20221124154621-1451a01f406b/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=

View file

@ -0,0 +1 @@
{{/* Empty for now. */}}

View file

@ -1,2 +0,0 @@
{{ $id := .Get 0 }}
<script type="text/javascript" src="https://asciinema.org/a/{{ $id }}.js" id="asciicast-{{ $id }}" data-rows="10" async></script>

View file

@ -3,7 +3,7 @@ publish = "public"
command = "hugo --gc --minify" command = "hugo --gc --minify"
[context.production.environment] [context.production.environment]
HUGO_VERSION = "0.105.0" HUGO_VERSION = "0.107.0"
HUGO_ENV = "production" HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true" HUGO_ENABLEGITINFO = "true"
@ -11,20 +11,20 @@ HUGO_ENABLEGITINFO = "true"
command = "hugo --gc --minify --enableGitInfo" command = "hugo --gc --minify --enableGitInfo"
[context.split1.environment] [context.split1.environment]
HUGO_VERSION = "0.105.0" HUGO_VERSION = "0.107.0"
HUGO_ENV = "production" HUGO_ENV = "production"
[context.deploy-preview] [context.deploy-preview]
command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL" command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL"
[context.deploy-preview.environment] [context.deploy-preview.environment]
HUGO_VERSION = "0.105.0" HUGO_VERSION = "0.107.0"
[context.branch-deploy] [context.branch-deploy]
command = "hugo --gc --minify -b $DEPLOY_PRIME_URL" command = "hugo --gc --minify -b $DEPLOY_PRIME_URL"
[context.branch-deploy.environment] [context.branch-deploy.environment]
HUGO_VERSION = "0.105.0" HUGO_VERSION = "0.107.0"
[context.next.environment] [context.next.environment]
HUGO_ENABLEGITINFO = "true" HUGO_ENABLEGITINFO = "true"