Project Configuration

Configure your Doks site. Doks uses Hugo's default config/ directory structure.

..
├── _default/
│   ├── config.toml
│   ├── menus.toml
│   └── params.toml
├── next/
│   └── config.toml
├── production/
│   └── config.toml
└── postcss.config.js

See also the Hugo docs: Configure Hugo.

_default

Environments default configuration.

config.toml

Basics

baseurl = "/"
canonifyURLs = false
disableAliases = true
disableHugoGeneratorInject = true
enableEmoji = true
enableGitInfo = false
enableRobotsTXT = true
languageCode = "en-US"
paginate = 7
rssLimit = 10

Netlify

# add redirects/headers
[outputs]
home = ["HTML", "RSS", "REDIRECTS", "HEADERS"]
section = ["HTML", "RSS", "SITEMAP"]

# remove .{ext} from text/netlify
[mediaTypes."text/netlify"]
suffixes = [""]
delimiter = ""

# add output format for netlify _redirects
[outputFormats.REDIRECTS]
mediaType = "text/netlify"
baseName = "_redirects"
isPlainText = true
notAlternative = true

# add output format for netlify _headers
[outputFormats.HEADERS]
mediaType = "text/netlify"
baseName = "_headers"
isPlainText = true
notAlternative = true

Markup

[markup]
  [markup.goldmark]
    [markup.goldmark.extensions]
      linkify = false
    [markup.goldmark.parser]
      autoHeadingID = true
      autoHeadingIDType = "github"
      [markup.goldmark.parser.attribute]
        block = true
        title = true
    [markup.goldmark.renderer]
      unsafe = true
  [markup.highlight]
    codeFences = false
    guessSyntax = false
    hl_Lines = ""
    lineNoStart = 1
    lineNos = false
    lineNumbersInTable = true
    noClasses = false
    style = "dracula"
    tabWidth = 4

Sitemap

[sitemap]
  changefreq = "weekly"
  filename = "sitemap.xml"
  priority = 0.5

Taxonomies

[taxonomies]
  contributor = "contributors"
[permalinks]
  blog = "/blog/:title/"

Modules

Doks child theme
[module]
  [[module.mounts]]
    source = "node_modules/@hyas/doks/archetypes"
    target = "archetypes"
  [[module.mounts]]
    source = "node_modules/@hyas/doks/assets"
    target = "assets"
#  [[module.mounts]]
#    source = "node_modules/@hyas/doks/content"
#    target = "content"
  [[module.mounts]]
    source = "node_modules/@hyas/doks/data"
    target = "data"
  [[module.mounts]]
    source = "node_modules/@hyas/doks/layouts"
    target = "layouts"
  [[module.mounts]]
    source = "node_modules/@hyas/doks/static"
    target = "static"
  [[module.mounts]]
    source = "node_modules/flexsearch"
    target = "assets/js/vendor/flexsearch"
  [[module.mounts]]
    source = "node_modules/katex"
    target = "assets/js/vendor/katex"
  [[module.mounts]]
    source = "assets"
    target = "assets"
  [[module.mounts]]
    source = "static"
    target = "static"
  [[module.mounts]]
    source = "content"
    target = "content"
  [[module.mounts]]
    source = "layouts"
    target = "layouts"
  [[module.mounts]]
    source = "archetypes"
    target = "archetypes"
  [[module.mounts]]
    source = "data"
    target = "data"
Doks starter theme
[module]
  [[module.mounts]]
    source = "assets"
    target = "assets"
  [[module.mounts]]
    source = "static"
    target = "static"
  [[module.mounts]]
    source = "node_modules/flexsearch"
    target = "assets/js/vendor/flexsearch"
  [[module.mounts]]
    source = "node_modules/katex"
    target = "assets/js/vendor/katex"

See: Menus

params.toml

Meta data

See also: SEO

Homepage
title = "Doks"
titleSeparator = "-"
titleAddition = "Modern Documentation Theme"
description = "Doks is a Hugo theme helping you build modern documentation websites that are secure, fast, and SEO-ready — by default."
Open Graph + Twitter Cards
images = ["doks.png"]
twitterSite = "henkverlinde"
twitterCreator = "henkverlinde"
facebookAuthor = "verlinde.henk"
facebookPublisher = "verlinde.henk"
ogLocale = "en_US"
JSON-LD
schemaType = "Organization"
schemaLogo = "logo-doks.png"
schemaTwitter = "https://twitter.com/henkverlinde"
schemaLinkedIn = "https://www.linkedin.com/in/henkverlinde/"
schemaGitHub = "https://github.com/h-enk"
schemaSection = "blog"
siteLinksSearchBox = false
Chrome Browser
themeColor = "#fff"

Images

quality = 85
bgColor = "#fff"
landscapePhotoWidths = [900, 800, 700, 600, 500]
portraitPhotoWidths = [800, 700, 600, 500]
lqipWidth = "20x"
smallLimit = "300"
footer = "Powered by <a href=\"https://www.netlify.com/\">Netlify</a>, <a href=\"https://gohugo.io/\">Hugo</a>, and <a href=\"https://getdoks.org/\">Doks</a>"

Alert

alert = false
alertText = "Like Doks? <a class=\"alert-link\" href=\"https://github.com/h-enk/doks/stargazers\">Star on GitHub</a>. Thanks!</a>"

Edit page

# repoHost [Github | Gitea | GitLab | Bitbucket | BitbucketServer ] is used for building the edit link based on git hoster
repoHost = "GitHub"
#repoHost = "Gitea"
docsRepo = "https://github.com/h-enk/doks"
docsRepoBranch = "master"
docsRepoSubPath = ""
editPage = false
lastMod = false
How to show the last modified date If you’d like to show the last modified date (the last Git revision date), make sure that both lastMod = true and enableGitInfo = true (see also Basics)

Options

Switch main functionalities on/off — also optimizing CSS + JS footprint.

[options]
  lazySizes = true
  clipBoard = true
  instantPage = true
  flexSearch = true
  darkMode = true
  bootStrapJs = false
  breadCrumb = false
  highLight = true
  kaTex = false
  fullWidth = false

next

Next environment specific configuration.

config.toml

baseurl = "https://next.example.com/"
canonifyURLs = true

production

Production environment specific configuration.

config.toml

baseurl = "https://example.com/"
canonifyURLs = true

postcss.config.js

Non development environments PostCSS configuration.

Doks child theme

const autoprefixer = require('autoprefixer');
const purgecss = require('@fullhuman/postcss-purgecss');
const whitelister = require('purgecss-whitelister');

module.exports = {
  plugins: [
    autoprefixer(),
    purgecss({
      content: [
        './node_modules/@hyas/doks/layouts/**/*.html',
        './node_modules/@hyas/doks/content/**/*.md',
        './layouts/**/*.html',
        './content/**/*.md',
      ],
      safelist: [
        'lazyloaded',
        'table',
        'thead',
        'tbody',
        'tr',
        'th',
        'td',
        ...whitelister([
          './node_modules/@hyas/doks/assets/scss/common/_variables.scss',
          './node_modules/@hyas/doks/assets/scss/components/_doks.scss',
          './node_modules/@hyas/doks/assets/scss/components/_code.scss',
          './node_modules/@hyas/doks/assets/scss/components/_buttons.scss',
          './node_modules/@hyas/doks/assets/scss/components/_search.scss',
          './node_modules/@hyas/doks/assets/scss/common/_dark.scss',
          './node_modules/katex/dist/katex.css',
        ]),
      ],
    }),
  ],
}

Doks starter theme

const autoprefixer = require('autoprefixer');
const purgecss = require('@fullhuman/postcss-purgecss');
const whitelister = require('purgecss-whitelister');

module.exports = {
  plugins: [
    autoprefixer(),
    purgecss({
      content: [
        './layouts/**/*.html',
        './content/**/*.md',
      ],
      safelist: [
        'lazyloaded',
        'table',
        'thead',
        'tbody',
        'tr',
        'th',
        'td',
        ...whitelister([
          './assets/scss/components/_doks.scss',
          './assets/scss/components/_code.scss',
          './assets/scss/components/_search.scss',
          './assets/scss/common/_dark.scss',
          './node_modules/katex/dist/katex.css',
        ]),
      ],
    }),
  ],
}

See also: Unused CSS removal.

Edit this page on GitHub