All settings
Settings
- archetypeDir
- (
string
) The designated directory for archetypes. Default isarchetypes
. For a more flexible approach to configuring this directory, consult the section on module mounts. - assetDir
- (
string
) The designated directory for global resources. Default isassets
. For a more flexible approach to configuring this directory, consult the section on module mounts. - baseURL
- (
string
) The absolute URL of your published site including the protocol, host, path, and a trailing slash. - build
- See configure build.
- buildDrafts
- (
bool
) Whether to include draft content when building a site. Default isfalse
. - buildExpired
- (
bool
) Whether to include expired content when building a site. Default isfalse
. - buildFuture
- (
bool
) Whether to include future content when building a site. Default isfalse
. - cacheDir
- (
string
) The designated cache directory. See details. - caches
- See configure file caches.
- canonifyURLs
- (
bool
) See details before enabling this feature. Default isfalse
. - capitalizeListTitles
- New in v0.123.3
- (
bool
) Whether to capitalize automatic list titles. Applicable to section, taxonomy, and term pages. Default istrue
. Use thetitleCaseStyle
setting to configure capitalization rules. - cascade
- See configure cascade.
- cleanDestinationDir
- (
bool
) Whether to remove files from the site’s destination directory that do not have corresponding files in thestatic
directory during the build. Default isfalse
. - contentDir
- (
string
) The designated directory for content files. Default iscontent
. For a more flexible approach to configuring this directory, consult the section on module mounts. - copyright
- (
string
) The copyright notice for a site, typically displayed in the footer. - dataDir
- (
string
) The designated directory for data files. Default isdata
. For a more flexible approach to configuring this directory, consult the section on module mounts. - defaultContentLanguage
- (
string
) The project’s default language key, conforming to the syntax described in RFC 5646. This value must match one of the defined language keys. Default isen
. - defaultContentLanguageInSubdir
- (
bool
) Whether to publish the default language site to a subdirectory matching thedefaultContentLanguage
. Default isfalse
. - defaultOutputFormat
- (
string
) The default output format for the site. If unspecified, the first available format in the defined order (by weight, then alphabetically) will be used. - deployment
- See configure deployment.
- disableAliases
- (
bool
) Whether to disable generation of alias redirects. Even if this option is enabled, the defined aliases will still be present on the page. This allows you to manage redirects separately, for example, by generating 301 redirects in an.htaccess
file or a Netlify_redirects
file using a custom output format. Default isfalse
. - disableDefaultLanguageRedirect
- New in v0.140.0
- (
bool
) Whether to disable generation of the alias redirect to the default language whenDefaultContentLanguageInSubdir
istrue
. Default isfalse
. - disableHugoGeneratorInject
- (
bool
) Whether to disable injection of a<meta name="generator">
tag into the home page. Default isfalse
. - disableKinds
- (
[]string
) A slice of page kinds to disable during the build process, any of404
,home
,page
,robotstxt
,rss
,section
,sitemap
,taxonomy
, orterm
. - disableLanguages
- (
[]string]
) A slice of language keys representing the languages to disable during the build process. Although this is functional, consider using thedisabled
key under each language instead. - disableLiveReload
- (
bool
) Whether to disable automatic live reloading of the browser window. Default isfalse
. - disablePathToLower
- (
bool
) Whether to disable transformation of page URLs to lower case. - enableEmoji
- (
bool
) Whether to allow emoji in Markdown. Default isfalse
. - enableGitInfo
- (
bool
) For sites under Git version control, whether to enable theGitInfo
object for each page. With the default front matter configuration, theLastmod
method on aPage
object will return the Git author date. Default isfalse
. - enableMissingTranslationPlaceholders
- (
bool
) Whether to show a placeholder instead of the default value or an empty string if a translation is missing. Default isfalse
. - enableRobotsTXT
- (
bool
) Whether to enable generation of arobots.txt
file. Default isfalse
. - environment
- (
string
) The build environment. Default isproduction
when runninghugo
anddevelopment
when runninghugo server
. - frontmatter
- See configure front matter.
- hasCJKLanguage
- (
bool
) Whether to automatically detect CJK languages in content. Affects the values returned by theWordCount
andFuzzyWordCount
methods. Default isfalse
. - HTTPCache
- See configure HTTP cache.
- i18nDir
- (
string
) The designated directory for translation tables. Default isi18n
. For a more flexible approach to configuring this directory, consult the section on module mounts. - ignoreCache
- (
bool
) Whether to ignore the cache directory. Default isfalse
. - ignoreFiles
- (
[]string]
) A slice of regular expressions used to exclude specific files from a build. These expressions are matched against the absolute file path and apply to files within thecontent
,data
, andi18n
directories. For more advanced file exclusion options, see the section on module mounts. - ignoreLogs
- (
[]string
) A slice of message identifiers corresponding to warnings and errors you wish to suppress. Seeerroridf
andwarnidf
. - ignoreVendorPaths
- (
string
) A glob pattern matching the module paths to exclude from the_vendor
directory. - imaging
- See configure imaging.
- languageCode
- (
string
) The site’s language tag, conforming to the syntax described in RFC 5646. This value does not affect translations or localization. Hugo uses this value to populate:- The
language
element in the embedded RSS template - The
lang
attribute of thehtml
element in the embedded alias template - The
og:locale
meta
element in the embedded Open Graph template
When present in the root of the configuration, this value is ignored if one or more language keys exists. Please specify this value independently for each language key.
- The
- languages
- See configure languages.
- layoutDir
- (
string
) The designated directory for templates. Default islayouts
. For a more flexible approach to configuring this directory, consult the section on module mounts. - mainSections
- (
string
or[]string
) The main sections of a site. If set, theMainSections
method on theSite
object returns the given sections, otherwise it returns the section with the most pages. - markup
- See configure markup.
- mediaTypes
- See configure media types.
- See configure menus.
- minify
- See configure minify.
- module
- See configure modules.
- newContentEditor
- (
string
) The editor to use when creating new content. - noBuildLock
- (
bool
) Whether to disable creation of the.hugo_build.lock
file. Default isfalse
. - noChmod
- (
bool
) Whether to disable synchronization of file permission modes. Default isfalse
. - noTimes
- (
bool
) Whether to disable synchronization of file modification times. Default isfalse
. - outputFormats
- See configure output formats.
- outputs
- See configure outputs.
- page
- See configure page.
- pagination
- See configure pagination.
- panicOnWarning
- (
bool
) Whether to panic on the first WARNING. Default isfalse
. - params
- See configure params.
- permalinks
- See configure permalinks.
- pluralizeListTitles
- (
bool
) Whether to pluralize automatic list titles. Applicable to section pages. Default istrue
. - printI18nWarnings
- (
bool
) Whether to log WARNINGs for each missing translation. Default isfalse
. - printPathWarnings
- (
bool
) Whether to log WARNINGs when Hugo publishes two or more files to the same path. Default isfalse
. - printUnusedTemplates
- (
bool
) Whether to log WARNINGs for each unused template. Default isfalse
. - privacy
- See configure privacy.
- publishDir
- (
string
) The designated directory for publishing the site. Default ispublic
. - refLinksErrorLevel
- (
string
) The logging error level to use when theref
andrelref
functions, methods, and shortcodes are unable to resolve a reference to a page. EitherERROR
orWARNING
. AnyERROR
will fail the build. Default isERROR
. - refLinksNotFoundURL
- (
string
) The URL to return when theref
andrelref
functions, methods, and shortcodes are unable to resolve a reference to a page. - See configure related content.
- relativeURLs
- (
bool
) See details before enabling this feature. Default isfalse
. - removePathAccents
- (
bool
) Whether to remove non-spacing marks from composite characters in content paths. Default isfalse
. - renderSegments
- New in v0.124.0
- (
[]string
) A slice of segments to render. If omitted, all segments are rendered. This option is typically set via a command-line flag, such ashugo --renderSegments segment1,segment2
. The provided segment names must correspond to those defined in thesegments
configuration. - resourceDir
- (
string
) The designated directory for caching output from asset pipelines. Default isresources
. - security
- See configure security.
- (
string
) When set, each top-level section will be added to the menu identified by the provided value. See details. - segments
- See configure segments.
- server
- See configure server.
- services
- See configure services.
- sitemap
- See configure sitemap.
- staticDir
- (
string
) The designated directory for static files. Default isstatic
. For a more flexible approach to configuring this directory, consult the section on module mounts. - summaryLength
- (
int
) Applicable to automatic summaries, the minimum number of words returned by theSummary
method on aPage
object. TheSummary
method will return content truncated at the paragraph boundary closest to the specifiedsummaryLength
, but at least this minimum number of words. - taxonomies
- See configure taxonomies.
- templateMetrics
- (
bool
) Whether to print template execution metrics to the console. Default isfalse
. See details. - templateMetricsHints
- (
bool
) Whether to print template execution improvement hints to the console. Applicable whentemplateMetrics
istrue
. Default isfalse
. See details. - theme
- (
string
or[]string
) The theme to use. Multiple themes can be listed, with precedence given from left to right. See details. - themesDir
- (
string
) The designated directory for themes. Default isthemes
. - timeout
- (
string
) The timeout for generating page content, either as a duration or in seconds. This timeout is used to prevent infinite recursion during content generation. You may need to increase this value if your pages take a long time to generate, for example, due to extensive image processing or reliance on remote content. Default is30s
. - timeZone
- (
string
) The time zone used to parse dates without time zone offsets, including front matter date fields and values passed to thetime.AsTime
andtime.Format
template functions. The list of valid values may be system dependent, but should includeUTC
,Local
, and any location in the IANA Time Zone Database. For example,America/Los_Angeles
andEurope/Oslo
are valid time zones. - title
- (
string
) The site title. - titleCaseStyle
- (
string
) The capitalization rules to follow when Hugo automatically generates a section title, or when using thestrings.Title
function. One ofap
,chicago
,go
,firstupper
, ornone
. Default isap
. See details. - uglyurls
- See configure ugly URLs.
Cache directory
Hugo’s file cache directory is configurable via the cacheDir
configuration option or the HUGO_CACHEDIR
environment variable. If neither is set, Hugo will use, in order of preference:
- If running on Netlify:
/opt/build/cache/hugo_cache/
. This means that if you run your builds on Netlify, all caches configured with:cacheDir
will be saved and restored on the next build. For other CI vendors, please read their documentation. For an CircleCI example, see this configuration. - In a
hugo_cache
directory below the OS user cache directory as defined by Go’s os.UserCacheDir. On Unix systems, per the XDG base directory specification, this is$XDG_CACHE_HOME
if non-empty, else$HOME/.cache
. On MacOS, this is$HOME/Library/Caches
. On Windows, this is%LocalAppData%
. On Plan 9, this is$home/lib/cache
. - In a
hugo_cache_$USER
directory below the OS temp dir.
To determine the current cacheDir
:
hugo config | grep cachedir
Title case style
Hugo’s titleCaseStyle
setting governs capitalization for automatically generated section titles and the strings.Title
function. By default, it follows the capitalization rules published in the Associated Press Stylebook. Change this setting to use other capitalization rules.
- ap
- Use the capitalization rules published in the Associated Press Stylebook. This is the default.
- chicago
- Use the capitalization rules published in the Chicago Manual of Style.
- go
- Capitalize the first letter of every word.
- firstupper
- Capitalize the first letter of the first word.
- none
- Disable transformation of automatic section titles, and disable the transformation performed by the
strings.Title
function. This is useful if you would prefer to manually capitalize section titles as needed, and to bypass opinionated theme usage of thestrings.Title
function.
Localized settings
Some configuration settings, such as menus and custom parameters, can be defined separately for each language. See configure languages.