These are the main configurations resides under config/<ENV>/config.toml
. We will go through each of them in detail but not its values or
baseURL = "http://example.org/"
canonifyURLs = true
buildDrafts = true
buildExpired = false
buildFuture = false
theme = []
enableRobotsTXT = true
metaDataFormat = "toml"
googleAnalytics = ""
paginate = 10
summaryLength = 70
sectionPagesMenu = "sections"
archetypeDir = "./archetypes"
assetDir = "./assets"
dataDir = "./docs/.data"
staticDir = "./static"
layoutDir = "./layouts"
themesDir = "./themes"
publishDir = "./public"
i18nDir = "./i18n"
defaultContentLanguage = "en-us"
defaultContentLanguageInSubdir = true
hasCJKLanguage = true
The first sections are the core settings, the heart of Hugo.
Your main base URL. It can be a full domain name with or without default pathing, or as an empty string. If you're building multi-front website, you need to set this as empty string.
If there is a value, please make sure it ends with a slash.
This turns the relative URLs into absolute URLs.
Ask HUGO to build and publish draft version as well.
Ask HUGO to build expired version as well.
Ask HUGO to build future versions.
Specify the list of themes to deploy.
Enable robot.txt
generation for SEO.
Specify the format for the metadata.
Specify the Google Analytics ID for internal template inclusion.
Number of elements in a page
The maximum length of the page summary.
The menu for section pages.
Next is to set the sources directories. There are 2 sections for this:
archetypeDir = "./archetypes"
assetDir = "./assets"
dataDir = "./docs/.data"
staticDir = "./static"
layoutDir = "./layouts"
themesDir = "./themes"
publishDir = "./public"
i18nDir = "./i18n"
These are the general sources. You can specify them accordingly to point to your correct directory. However, keep in mind that if you want to generate a different public directly, say, it is now named as main
instead of public
, you need to add a trailing slash. Example:
publishDir = "./main/"
contentDir = "../docs/en-us"
These are the sources for Hugo to search for your content.
The last sections would be the generalized multilingual mode settings. These are the settings to tell HUGO to default into if there is an multilingual mode related error is found.
This is for Hugo to bounce back to the default language if content is missing.
Render the default root page to the default language sub-directory. In other word, redirect /
to /default-lang
.
Tell Hugo that the other languages has Chinese, Japanese, and Korean runes instead of the english. This is to correct things like word count function etc. to return the proper values.
That's all about main configurations in HUGO. You may proceed to the next section which is the languages configurations.