# 配置
多语言目录结构:
{{< tabs "Multiple Languages" >}}
{{< tab "文档的目录结构" >}}


```
/site/content/
├── zh-cn
│   └── docs
│       ├── _index.md
└── zh-tw
    └── docs
        ├── _index.md
```

{{< /tab >}}
{{< tab "配置文件的目录结构" >}}

```
/site/config/
├── _default
│   ├── hugo.toml
│   ├── languages.toml
│   ├── markup.toml
│   ├── menus
│   │   ├── menus.en.toml
│   │   └── menus.nl.toml
│   ├── module.toml
│   └── params.toml
├── next
│   └── hugo.toml
└── production
    ├── hugo.toml
    ├── languages.toml
    ├── markup.toml
    ├── menus
    │   ├── menus.zh-cn.toml
    │   └── menus.zh-tw.toml
    ├── module.toml
    └── params.toml
```

{{< /tab >}}
{{< /tabs >}}

{{< tabs "多语言配置" >}}
{{< tab "hugo.toml" >}}

```toml
title = "Eternal Docs"
baseurl = "https://eternal.foo"
disableAliases = true
disableHugoGeneratorInject = true
# disableKinds = ["taxonomy", "term"]
enableEmoji = true
enableGitInfo = false
enableRobotsTXT = true
languageCode = "zh-CN"
rssLimit = 10
summarylength = 20 # 70 (default)

# Multilingual
defaultContentLanguage = "zh-cn"  #默认语言
disableLanguages = ["de", "nl", "en"]
defaultContentLanguageInSubdir = false # URL 带语言前缀（例如 example.com/en/）

copyRight = "Copyright (c) 2025-2026 Eternal Docs. All rights reserved."

[build.buildStats]
  enable = true

[outputs]
  home = ["html", "rss", "sitemap", "searchIndex", "llms"]
  page = ["html", "markdown"]
  section = ["html", "rss", "sitemap"]
  taxonomy = ["html", "rss", "sitemap"]
  term = ["html", "rss", "sitemap"]

[outputFormats.searchIndex]
  mediaType = "application/json"
  baseName = "search-index"
  isPlainText = true
  notAlternative = true

[outputFormats.markdown]
  baseName = "index"
  isHTML = false
  isPlainText = true
  mediaType = "text/markdown"

[outputFormats.llms]
  baseName = "llms"
  isHTML = false
  isPlainText = true
  mediaType = "text/plain"

# Add output format for section sitemap.xml
[outputFormats.sitemap]
  mediaType = "application/xml"
  baseName = "sitemap"
  isHTML = false
  isPlainText = true
  noUgly = true
  rel  = "sitemap"

[sitemap]
  changefreq = "monthly"
  filename = "sitemap.xml"
  priority = 0.5

[caches]
  [caches.getresource]
    dir = ":cacheDir/:project"
    maxAge = -1 # "30m"

[taxonomies]
  contributor = "contributors"
  category = "categories"
  tag = "tags"

[permalinks]
  blog = "/blog/:slug/"
  docs = "/docs/:sections[1:]/:slug/"
# docs = "/docs/1.0/:sections[1:]/:slug/"

[minify.tdewolff.html]
  keepComments = true # If set to false, build signatures are removed
  keepWhitespace = false

[pagination]
  pagerSize = 10

[related]
  threshold = 80
  includeNewer = true
  toLower = false
    [[related.indices]]
      name = "categories"
      weight = 100
    [[related.indices]]
      name = "tags"
      weight = 80
    [[related.indices]]
      name = "date"
      weight = 10

[imaging]
  anchor = "Center"
  bgColor = "#ffffff"
  hint = "photo"
  quality = 85
  resampleFilter = "Lanczos"

```

{{< /tab >}}
{{< tab "languages.toml" >}}

```toml
[zh-cn]
  languageName = "简体中文"
  contentDir = "content/zh-cn"
  weight = 10

  [zh-cn.params]
    languageISO = "CN"
    languageTag = "zh-CN"

    title = "我的文档站"
    titleAddition = "技术文档"
    description = "一个基于 Hugo 和 Doks 构建的技术文档站点，专注于教程、实践与经验总结。"

    footer = '由 <a href="https://gohugo.io/">Hugo</a> & <a href="https://getdoks.org/">Doks</a> 驱动'
    alertText = '🚀 网站持续更新中，欢迎关注最新内容！'

[zh-tw]
  languageName = "繁體中文"
  contentDir = "content/zh-tw"
  weight = 20

  [zh-tw.params]
    languageISO = "TW"
    languageTag = "zh-TW"

    title = "我的文件站"
    titleAddition = "技術文件"
    description = "一個基於 Hugo 和 Doks 建立的技術文件網站，專注於教學、實務與經驗分享。"

    footer = '由 <a href="https://gohugo.io/">Hugo</a> 與 <a href="https://getdoks.org/">Doks</a> 驅動'
    alertText = '🚀 網站持續更新中，歡迎關注最新內容！'
```

{{< /tab >}}
{{< tab "markup.toml" >}}

```toml
# /site/config/production/markup.toml

defaultMarkdownHandler = "goldmark"

[goldmark]
  [goldmark.extensions]
    linkify = false
    [goldmark.extensions.passthrough]
      enable = true
      [goldmark.extensions.passthrough.delimiters]
        block = [['\[', '\]'], ['$$', '$$']]
        inline = [['\(', '\)']]
  [goldmark.parser]
    autoHeadingID = true
    autoHeadingIDType = "github"
    [goldmark.parser.attribute]
      block = true
      title = true
  [goldmark.renderer]
    unsafe = true

[highlight]
  anchorLineNos = false
  codeFences = true
  guessSyntax = false
  hl_Lines = ''
  hl_inline = false
  lineAnchors = ''
  lineNoStart = 1
  lineNos = true
  lineNumbersInTable = true
  noClasses = false
  noHl = false
  style = 'monokai'
  tabWidth = 2

[tableOfContents]
  endLevel = 3
  ordered = false
  startLevel = 2

[markup]
  [markup.sass]
    implementation = "dart"
    outputStyle = "compressed"
```

{{< /tab >}}
{{< tab "menus.zh-cn.toml" >}}

```toml
# [[docs]]
#   name = "Prologue"
#   weight = 10
#   identifier = "prologue"
#   url = "/docs/prologue/"

# [[docs]]
#   name = "Help"
#   weight = 60
#   identifier = "help"
#   url = "/docs/help/"

# [[docs]]
#   name = "Lorem"
#   weight = 70
#   identifier = "lorem"
#   url = "/docs/lorem/"

#[[guide]]
#  name = "Lorem"
#  weight = 10
#  identifier = "lorem"
#  url = "/guide/lorem/"

#[[tutorial]]
#  name = "Lorem"
#  weight = 10
#  identifier = "lorem"
#  url = "/tutorial/lorem/"

[[main]]
  name = "文档"
  identifier = "docs"
  pageRef = "/zh-cn/docs/"
  weight = 10

#[[main]]
#  name = "博客"
#  url = "/blog/"
#  weight = 30

# [[social]]
#   name = "Twitter"
#   pre = '<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-brand-x" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 4l11.733 16h4.267l-11.733 -16z"></path><path d="M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772"></path></svg>'
#   url = "https://twitter.com/getdoks"
#   weight = 10
#
# [[social]]
#   name = "Discord"
#   pre = '<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-brand-discord" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 12a1 1 0 1 0 2 0a1 1 0 0 0 -2 0"></path><path d="M14 12a1 1 0 1 0 2 0a1 1 0 0 0 -2 0"></path><path d="M8.5 17c0 1 -1.356 3 -1.832 3c-1.429 0 -2.698 -1.667 -3.333 -3c-.635 -1.667 -.476 -5.833 1.428 -11.5c1.388 -1.015 2.782 -1.34 4.237 -1.5l.975 1.923a11.913 11.913 0 0 1 4.053 0l.972 -1.923c1.5 .16 3.043 .485 4.5 1.5c2 5.667 2.167 9.833 1.5 11.5c-.667 1.333 -2 3 -3.5 3c-.5 0 -2 -2 -2 -3"></path><path d="M7 16.5c3.5 1 6.5 1 10 0"></path></svg>'
#   url = "https://getdoks.org/chat"
#   weight = 20

#[[social]]
#  name = "GitHub"
#  pre = '<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-brand-github" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M9 19c-4.3 1.4 -4.3 -2.5 -6 -3m12 5v-3.5c0 -1 .1 -1.4 -.5 -2c2.8 -.3 5.5 -1.4 5.5 -6a4.6 4.6 0 0 0 -1.3 -3.2a4.2 4.2 0 0 0 -.1 -3.2s-1.1 -.3 -3.5 1.3a12.3 12.3 0 0 0 -6.2 0c-2.4 -1.6 -3.5 -1.3 -3.5 -1.3a4.2 4.2 0 0 0 -.1 3.2a4.6 4.6 0 0 0 -1.3 3.2c0 4.6 2.7 5.7 5.5 6c-.6 .6 -.6 1.2 -.5 2v3.5"></path></svg>'
#  url = "https://github.com/thuliteio/doks"
#  post = "v0.1.0"
#  weight = 30

# [[social]]
#   name = "LinkedIn"
#   pre = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M21,21H17V14.25C17,13.19 15.81,12.31 14.75,12.31C13.69,12.31 13,13.19 13,14.25V21H9V9H13V11C13.66,9.93 15.36,9.24 16.5,9.24C19,9.24 21,11.28 21,13.75V21M7,21H3V9H7V21M5,3A2,2 0 0,1 7,5A2,2 0 0,1 5,7A2,2 0 0,1 3,5A2,2 0 0,1 5,3Z"/></svg>'
#   url = "https://www.linkedin.com/"
#   weight = 40


[[footer]]
  name = "Privacy Policy"
  url = "/privacy/"
  weight = 10

# [[footer]]
#   name = "Terms of Service"
#   url = "/terms/"
#   weight = 20

````

{{< /tab >}}
{{< tab "menus.zh-tw.toml" >}}

```toml
# [[docs]]
#   name = "Prologue"
#   weight = 10
#   identifier = "prologue"
#   url = "/docs/prologue/"

# [[docs]]
#   name = "Help"
#   weight = 60
#   identifier = "help"
#   url = "/docs/help/"

# [[docs]]
#   name = "Lorem"
#   weight = 70
#   identifier = "lorem"
#   url = "/docs/lorem/"

#[[guide]]
#  name = "Lorem"
#  weight = 10
#  identifier = "lorem"
#  url = "/guide/lorem/"

#[[tutorial]]
#  name = "Lorem"
#  weight = 10
#  identifier = "lorem"
#  url = "/tutorial/lorem/"

[[main]]
  name = "文件"
  identifier = "docs"
  pageRef = "/zh-tw/docs/"
  weight = 10

#[[main]]
#  name = "博客"
#  url = "/blog/"
#  weight = 30

# [[social]]
#   name = "Twitter"
#   pre = '<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-brand-x" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 4l11.733 16h4.267l-11.733 -16z"></path><path d="M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772"></path></svg>'
#   url = "https://twitter.com/getdoks"
#   weight = 10
#
# [[social]]
#   name = "Discord"
#   pre = '<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-brand-discord" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 12a1 1 0 1 0 2 0a1 1 0 0 0 -2 0"></path><path d="M14 12a1 1 0 1 0 2 0a1 1 0 0 0 -2 0"></path><path d="M8.5 17c0 1 -1.356 3 -1.832 3c-1.429 0 -2.698 -1.667 -3.333 -3c-.635 -1.667 -.476 -5.833 1.428 -11.5c1.388 -1.015 2.782 -1.34 4.237 -1.5l.975 1.923a11.913 11.913 0 0 1 4.053 0l.972 -1.923c1.5 .16 3.043 .485 4.5 1.5c2 5.667 2.167 9.833 1.5 11.5c-.667 1.333 -2 3 -3.5 3c-.5 0 -2 -2 -2 -3"></path><path d="M7 16.5c3.5 1 6.5 1 10 0"></path></svg>'
#   url = "https://getdoks.org/chat"
#   weight = 20

#[[social]]
#  name = "GitHub"
#  pre = '<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-brand-github" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M9 19c-4.3 1.4 -4.3 -2.5 -6 -3m12 5v-3.5c0 -1 .1 -1.4 -.5 -2c2.8 -.3 5.5 -1.4 5.5 -6a4.6 4.6 0 0 0 -1.3 -3.2a4.2 4.2 0 0 0 -.1 -3.2s-1.1 -.3 -3.5 1.3a12.3 12.3 0 0 0 -6.2 0c-2.4 -1.6 -3.5 -1.3 -3.5 -1.3a4.2 4.2 0 0 0 -.1 3.2a4.6 4.6 0 0 0 -1.3 3.2c0 4.6 2.7 5.7 5.5 6c-.6 .6 -.6 1.2 -.5 2v3.5"></path></svg>'
#  url = "https://github.com/thuliteio/doks"
#  post = "v0.1.0"
#  weight = 30

# [[social]]
#   name = "LinkedIn"
#   pre = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M21,21H17V14.25C17,13.19 15.81,12.31 14.75,12.31C13.69,12.31 13,13.19 13,14.25V21H9V9H13V11C13.66,9.93 15.36,9.24 16.5,9.24C19,9.24 21,11.28 21,13.75V21M7,21H3V9H7V21M5,3A2,2 0 0,1 7,5A2,2 0 0,1 5,7A2,2 0 0,1 3,5A2,2 0 0,1 5,3Z"/></svg>'
#   url = "https://www.linkedin.com/"
#   weight = 40


[[footer]]
  name = "Privacy Policy"
  url = "/privacy/"
  weight = 10

# [[footer]]
#   name = "Terms of Service"
#   url = "/terms/"
#   weight = 20

````

{{< /tab >}}
{{< tab "module.toml" >}}

```toml
# Module Configuration File
#
# This file configures Hugo module settings, particularly module mounts which
# define how content is organized within the project.
#
# Mounts specify file paths in your project that Hugo should use when building
# the site. They allow for custom directory structures and integrating content
# from different locations.

## content
[[mounts]]
  source = "content"
  target = "content"

## data
[[mounts]]
  source = "node_modules/@thulite/doks-core/data"
  target = "data"

[[mounts]]
  source = "data"
  target = "data"

## layouts
[[mounts]]
  source = "layouts"
  target = "layouts"

[[mounts]]
  files = ['! home.html']
  source = "node_modules/@thulite/doks-core/layouts"
  target = "layouts"

[[mounts]]
  source = "node_modules/@thulite/core/layouts"
  target = "layouts"

[[mounts]]
  source = "node_modules/@thulite/seo/layouts"
  target = "layouts"

[[mounts]]
  source = "node_modules/@thulite/images/layouts"
  target = "layouts"

[[mounts]]
  source = "node_modules/@thulite/inline-svg/layouts"
  target = "layouts"

## i18n
[[mounts]]
  source = "node_modules/@thulite/doks-core/i18n"
  target = "i18n"

[[mounts]]
  source = "i18n"
  target = "i18n"

## archetypes
[[mounts]]
  source = "node_modules/@thulite/doks-core/archetypes"
  target = "archetypes"

[[mounts]]
  source = "archetypes"
  target = "archetypes"

## assets
[[mounts]]
  source = "node_modules/@thulite/core/assets"
  target = "assets"

[[mounts]]
  source = "node_modules/@thulite/doks-core/assets"
  target = "assets"

[[mounts]]
  source = "node_modules/@tabler/icons/icons"
  target = "assets/svgs/tabler-icons"

[[mounts]]
  source = "node_modules/@thulite/images/assets"
  target = "assets"

[[mounts]]
  source = "hugo_stats.json"
  target = "assets/watching/hugo_stats.json"

[[mounts]]
  source = "assets"
  target = "assets"

## static
[[mounts]]
  source = "node_modules/@thulite/doks-core/static"
  target = "static"

[[mounts]]
  source = "static"
  target = "static"

```

{{< /tab >}}
{{< tab "params.toml" >}}

```toml
# Hugo
title = "Eternal Docs"
description = "Congrats on setting up a new Doks project!"
images = ["cover.png"]

# mainSections
mainSections = ["docs"]

# Enable mathematical rendering on every page (unless you set the `math` parameter to `false` in front matter)
math = true # false (default) or true
mathEngine = "KaTeX" # "KaTeX" (default) or "MathJax"

[social]
  twitter = "getdoks"

# Doks (@thulite/doks-core)
[doks]
  # Color mode
  colorMode = "auto" # auto (default), light or dark
  colorModeToggler = true # true (default) or false (this setting is only relevant when colorMode = auto)

  # Navbar
  navbarSticky = true # true (default) or false
  containerBreakpoint = "fluid" # "", "sm", "md", "lg", "xl", "xxl", or "fluid" (default)

  ## Button
  navBarButton = false # false (default) or true
  navBarButtonUrl = "/docs/prologue/introduction/"
  navBarButtonText = "Get started"

  # FlexSearch
  flexSearch = true # true (default) or false
  searchExclKinds = [] # list of page kinds to exclude from search indexing (e.g. ["home", "taxonomy", "term"] )
  searchExclTypes = [] # list of content types to exclude from search indexing (e.g. ["blog", "docs", "legal", "contributors", "categories"])
  showSearch = ["homepage", "docs"] # [] (all pages, default) or homepage (optionally) and list of sections (e.g. ["homepage", "blog", "guides"])
  indexSummary = true # true or false (default); whether to index only the `.Summary` instead of the full `.Content`; limits the respective JSON field size and thus increases loading time

  ## Search results
  showDate = false # false (default) or true
  showSummary = true # true (default) or false
  searchLimit = 40 # 0 (no limit, default) or natural number

  # Global alert
  alert = false # false (default) or true
  alertDismissable = true # true (default) or false

  # Bootstrap
  bootstrapJavascript = true # false (default) or true

  # Nav
  sectionSwitcher = false # true or false (default)
  sectionNav = ["zh-cn" , "zh-tw"] # ["docs"] (default) or list of sections (e.g. ["docs", "guides"])
  toTopButton = true # false (default) or true
  breadcrumbTrail = true # false (default) or true
  headlineHash = true # true (default) or false
  scrollSpy = true # true (default) or false

  # Multilingual
  multilingualMode = true # false (default) or true
  showMissingLanguages = false # whether or not to show untranslated languages in the language menu; true (default) or false

  # Versioning
  docsVersioning = false # false (default) or true
  docsVersion = "1.0"

  # UX
  headerBar = false # true (default) or false
  backgroundDots = true # true (default) or false
  aiButtons = true # true (default) or false

  # Homepage
  sectionFooter = false # false (default) or true

  # Blog
  relatedPosts = false # false (default) or true
  imageList = true # true (default) or false
  imageSingle = true # true (default) or false

  # Repository
  editPage = false # false (default) or true
  lastMod = false # false (default) or true
  repoHost = "GitHub" # GitHub (default), Gitea, GitLab, Bitbucket, or BitbucketServer
  docsRepo = "https://github.com/h-enk/doks"
  docsRepoBranch = "main" # main (default), master, or <branch name>
  docsRepoSubPath = "" # "" (none, default) or <sub path>

  krokiURL = "https://kroki.io" # "https://kroki.io" (default) or custom URL like http://localhost:8000.

  # SCSS colors
  # backGround = "yellowgreen"
  ## Dark theme
  # textDark = "#dee2e6" # "#dee2e6" (default), "#dee2e6" (orignal), or custom color
  # accentDark = "#5d2f86" # "#5d2f86" (default), "#5d2f86" (original), or custom color
  ## Light theme
  # textLight = "#1d2d35" # "#1d2d35" (default), "#1d2d35" (orignal), or custom color
  # accentLight = "#8ed6fb" # "#8ed6fb" (default), "#8ed6fb" (orignal), or custom color

[doks.menu]
  [doks.menu.section]
    auto = true # true (default) or false
    collapsibleSidebar = true # true (default) or false

# Debug
[render_hooks.image]
  errorLevel = 'ignore' # ignore (default), warning, or error (fails the build)

[render_hooks.link]
  errorLevel = 'ignore' # ignore (default), warning, or error (fails the build)
  highlightBroken = false # true or false (default)

# Images (@thulite/images)
[thulite_images]
  [thulite_images.defaults]
    decoding = "async" # sync, async, or auto (default)
    fetchpriority = "auto" # high, low, or auto (default)
    loading = "lazy" # eager or lazy (default)
    widths = [480, 576, 768, 1025, 1200, 1440] # [640, 768, 1024, 1366, 1600, 1920] for example
    sizes = "auto" # 100vw (default), 75vw, or auto for example
    process = "" # "fill 1600x900" or "fill 2100x900" for example
    lqip = "16x webp q20" # "16x webp q20" or "21x webp q20" for example

# Inline SVG (@thulite/inline-svg)
[inline_svg]
  iconSetDir = "tabler-icons" # tabler-icons (default)
  iconSetVariant = "outline" # outline (default) or filled

# SEO (@thulite/seo)
[seo]
  [seo.title]
    separator = "" # "|" (default)
    suffix = "" # title hugo.toml (default)
  [seo.description]
    summaryFallback = "" # "" (default)
  [seo.favicons]
    icon = "favicon.png" # favicon.png (default)
    svgIcon = "favicon.svg" # favicon.svg (default)
  [seo.schemas]
    type = "Organization" # Organization (default) or Person
    logo = "favicon-512x512.png" # Logo of Organization — favicon-512x512.png (default)
    name = "Eternal" # Name of Organization or Person
    sameAs = [] # E.g. ["https://github.com/thuliteio/thulite", "https://fosstodon.org/@thulite"]
    images = ["cover.png"] # ["cover.png"] (default)
    article = [] # Article sections
    newsArticle = [] # NewsArticle sections
    blogPosting = ["blog"] # BlogPosting sections
    product = [] # Product sections

```

{{< /tab >}}
{{< /tabs >}}
