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 thetitleCaseStylesetting 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 thestaticdirectory 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.htaccessfile or a Netlify_redirectsfile 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 whenDefaultContentLanguageInSubdiristrue. 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 thedisabledkey 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 theGitInfoobject for each page. With the default front matter configuration, theLastmodmethod on aPageobject 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.txtfile. Default isfalse. - environment
- (
string) The build environment. Default isproductionwhen runninghugoanddevelopmentwhen runninghugo server. - frontmatter
- See configure front matter.
- hasCJKLanguage
- (
bool) Whether to automatically detect CJK languages in content. Affects the values returned by theWordCountandFuzzyWordCountmethods. 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, andi18ndirectories. 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. Seeerroridfandwarnidf. - ignoreVendorPaths
- (
string) A glob pattern matching the module paths to exclude from the_vendordirectory. - 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
languageelement in the embedded RSS template - The
langattribute of thehtmlelement in the embedded alias template - The
og:localemetaelement 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
- (
stringor[]string) The main sections of a site. If set, theMainSectionsmethod on theSiteobject 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.lockfile. 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 therefandrelreffunctions, methods, and shortcodes are unable to resolve a reference to a page. EitherERRORorWARNING. AnyERRORwill fail the build. Default isERROR. - refLinksNotFoundURL
- (
string) The URL to return when therefandrelreffunctions, 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 thesegmentsconfiguration. - 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 theSummarymethod on aPageobject. TheSummarymethod will return content truncated at the paragraph boundary closest to the specifiedsummaryLength, but at least this minimum number of words. Default is70. - 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 whentemplateMetricsistrue. Default isfalse. See details. - theme
- (
stringor[]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 is60s. - timeZone
- (
string) The time zone used to parse dates without time zone offsets, including front matter date fields and values passed to thetime.AsTimeandtime.Formattemplate 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_AngelesandEurope/Osloare 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.Titlefunction. 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:cacheDirwill be saved and restored on the next build. For other CI/CD vendors, please read their documentation. For an CircleCI example, see this configuration. - In a
hugo_cachedirectory below the OS user cache directory as defined by Go’s os.UserCacheDir function. On Unix systems, per the XDG base directory specification, this is$XDG_CACHE_HOMEif 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_$USERdirectory below the OS temp dir.
To determine the current cacheDir:
hugo config | grep cachedirTitle 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.Titlefunction. This is useful if you would prefer to manually capitalize section titles as needed, and to bypass opinionated theme usage of thestrings.Titlefunction.
Localized settings
Some configuration settings, such as menus and custom parameters, can be defined separately for each language. See configure languages.
