Project Configuration

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

On this page

  1. ..
  2. ├── _default/
  3. ├── config.toml
  4. ├── menus.toml
  5. └── params.toml
  6. ├── next/
  7. └── config.toml
  8. ├── production/
  9. └── config.toml
  10. └── postcss.config.js

See also the Hugo docs: Configure Hugo.

_default

Environments default configuration.

config.toml

Basics

  1. baseurl = "/"
  2. canonifyURLs = false
  3. disableAliases = true
  4. disableHugoGeneratorInject = true
  5. enableEmoji = true
  6. enableGitInfo = false
  7. enableRobotsTXT = true
  8. languageCode = "en-US"
  9. paginate = 7
  10. rssLimit = 10

Netlify

  1. # add redirects/headers
  2. [outputs]
  3. home = ["HTML", "RSS", "REDIRECTS", "HEADERS"]
  4. section = ["HTML", "RSS", "SITEMAP"]
  5. # remove .{ext} from text/netlify
  6. [mediaTypes."text/netlify"]
  7. suffixes = [""]
  8. delimiter = ""
  9. # add output format for netlify _redirects
  10. [outputFormats.REDIRECTS]
  11. mediaType = "text/netlify"
  12. baseName = "_redirects"
  13. isPlainText = true
  14. notAlternative = true
  15. # add output format for netlify _headers
  16. [outputFormats.HEADERS]
  17. mediaType = "text/netlify"
  18. baseName = "_headers"
  19. isPlainText = true
  20. notAlternative = true

Markup

  1. [markup]
  2. [markup.goldmark]
  3. [markup.goldmark.extensions]
  4. linkify = false
  5. [markup.goldmark.parser]
  6. autoHeadingID = true
  7. autoHeadingIDType = "github"
  8. [markup.goldmark.parser.attribute]
  9. block = true
  10. title = true
  11. [markup.goldmark.renderer]
  12. unsafe = true
  13. [markup.highlight]
  14. codeFences = false
  15. guessSyntax = false
  16. hl_Lines = ""
  17. lineNoStart = 1
  18. lineNos = false
  19. lineNumbersInTable = true
  20. noClasses = false
  21. style = "dracula"
  22. tabWidth = 4

Sitemap

  1. [sitemap]
  2. changefreq = "weekly"
  3. filename = "sitemap.xml"
  4. priority = 0.5

Taxonomies

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

Modules

Doks child theme
  1. [module]
  2. [[module.mounts]]
  3. source = "node_modules/@hyas/doks/archetypes"
  4. target = "archetypes"
  5. [[module.mounts]]
  6. source = "node_modules/@hyas/doks/assets"
  7. target = "assets"
  8. # [[module.mounts]]
  9. # source = "node_modules/@hyas/doks/content"
  10. # target = "content"
  11. [[module.mounts]]
  12. source = "node_modules/@hyas/doks/data"
  13. target = "data"
  14. [[module.mounts]]
  15. source = "node_modules/@hyas/doks/layouts"
  16. target = "layouts"
  17. [[module.mounts]]
  18. source = "node_modules/@hyas/doks/static"
  19. target = "static"
  20. [[module.mounts]]
  21. source = "node_modules/flexsearch"
  22. target = "assets/js/vendor/flexsearch"
  23. [[module.mounts]]
  24. source = "node_modules/katex"
  25. target = "assets/js/vendor/katex"
  26. [[module.mounts]]
  27. source = "assets"
  28. target = "assets"
  29. [[module.mounts]]
  30. source = "static"
  31. target = "static"
  32. [[module.mounts]]
  33. source = "content"
  34. target = "content"
  35. [[module.mounts]]
  36. source = "layouts"
  37. target = "layouts"
  38. [[module.mounts]]
  39. source = "archetypes"
  40. target = "archetypes"
  41. [[module.mounts]]
  42. source = "data"
  43. target = "data"
Doks starter theme
  1. [module]
  2. [[module.mounts]]
  3. source = "assets"
  4. target = "assets"
  5. [[module.mounts]]
  6. source = "static"
  7. target = "static"
  8. [[module.mounts]]
  9. source = "node_modules/flexsearch"
  10. target = "assets/js/vendor/flexsearch"
  11. [[module.mounts]]
  12. source = "node_modules/katex"
  13. target = "assets/js/vendor/katex"

menus.toml

See: Menus

params.toml

Meta data

See also: SEO

Homepage
  1. title = "Doks"
  2. titleSeparator = "-"
  3. titleAddition = "Modern Documentation Theme"
  4. 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
  1. images = ["doks.png"]
  2. twitterSite = "henkverlinde"
  3. twitterCreator = "henkverlinde"
  4. facebookAuthor = "verlinde.henk"
  5. facebookPublisher = "verlinde.henk"
  6. ogLocale = "en_US"
JSON-LD
  1. schemaType = "Organization"
  2. schemaLogo = "logo-doks.png"
  3. schemaTwitter = "https://twitter.com/henkverlinde"
  4. schemaLinkedIn = "https://www.linkedin.com/in/henkverlinde/"
  5. schemaGitHub = "https://github.com/h-enk"
  6. schemaSection = "blog"
  1. siteLinksSearchBox = false
Chrome Browser
  1. themeColor = "#fff"

Images

  1. quality = 85
  2. bgColor = "#fff"
  3. landscapePhotoWidths = [900, 800, 700, 600, 500]
  4. portraitPhotoWidths = [800, 700, 600, 500]
  5. lqipWidth = "20x"
  1. 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

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

Edit page

  1. docsRepo = "https://github.com/h-enk/doks"
  2. editPage = true

Options

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

  1. [options]
  2. lazySizes = true
  3. clipBoard = true
  4. instantPage = true
  5. flexSearch = true
  6. darkMode = true
  7. bootStrapJs = false
  8. breadCrumb = false
  9. highLight = true
  10. kaTex = false

next

Next environment specific configuration.

config.toml

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

production

Production environment specific configuration.

config.toml

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

postcss.config.js

Non development environments PostCSS configuration.

Doks child theme

  1. const autoprefixer = require('autoprefixer');
  2. const purgecss = require('@fullhuman/postcss-purgecss');
  3. const whitelister = require('purgecss-whitelister');
  4. module.exports = {
  5. plugins: [
  6. autoprefixer(),
  7. purgecss({
  8. content: [
  9. './node_modules/@hyas/doks/layouts/**/*.html',
  10. './node_modules/@hyas/doks/content/**/*.md',
  11. './layouts/**/*.html',
  12. './content/**/*.md',
  13. ],
  14. safelist: [
  15. 'lazyloaded',
  16. 'table',
  17. 'thead',
  18. 'tbody',
  19. 'tr',
  20. 'th',
  21. 'td',
  22. ...whitelister([
  23. './node_modules/@hyas/doks/assets/scss/common/_variables.scss',
  24. './node_modules/@hyas/doks/assets/scss/components/_doks.scss',
  25. './node_modules/@hyas/doks/assets/scss/components/_code.scss',
  26. './node_modules/@hyas/doks/assets/scss/components/_buttons.scss',
  27. './node_modules/@hyas/doks/assets/scss/components/_search.scss',
  28. './node_modules/@hyas/doks/assets/scss/common/_dark.scss',
  29. './node_modules/katex/dist/katex.css',
  30. ]),
  31. ],
  32. }),
  33. ],
  34. }

Doks starter theme

  1. const autoprefixer = require('autoprefixer');
  2. const purgecss = require('@fullhuman/postcss-purgecss');
  3. const whitelister = require('purgecss-whitelister');
  4. module.exports = {
  5. plugins: [
  6. autoprefixer(),
  7. purgecss({
  8. content: [
  9. './layouts/**/*.html',
  10. './content/**/*.md',
  11. ],
  12. safelist: [
  13. 'lazyloaded',
  14. 'table',
  15. 'thead',
  16. 'tbody',
  17. 'tr',
  18. 'th',
  19. 'td',
  20. ...whitelister([
  21. './assets/scss/components/_doks.scss',
  22. './assets/scss/components/_code.scss',
  23. './assets/scss/components/_search.scss',
  24. './assets/scss/common/_dark.scss',
  25. './node_modules/katex/dist/katex.css',
  26. ]),
  27. ],
  28. }),
  29. ],
  30. }

See also: Unused CSS removal.