From 55c9054af8fd87ce7f0a2164fe3505f27620fddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC?= Date: Sat, 15 Jun 2024 21:21:07 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=B5=D0=BD=D1=8F=D1=8E=20ToC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.toml | 9 +++++++-- layouts/_default/_markup/render-heading.html | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/config.toml b/config.toml index 5e258c1..dcb6d0e 100755 --- a/config.toml +++ b/config.toml @@ -3,12 +3,17 @@ baseurl = "" theme = "hugo-theme-terminal" paginate = 5 DefaultContentLanguage = "ru" -#defaultContentLanguageInSubdir = true +# defaultContentLanguageInSubdir = true # enableGitInfo = true # [frontmatter] # lastmod = ['lastmod', ':git', 'date', 'publishDate'] +[markup] + [markup.tableOfContents] + endLevel = 4 + ordered = false + startLevel = 1 [params] # dir name of your main content (default is `content/posts`). @@ -57,7 +62,7 @@ DefaultContentLanguage = "ru" # set title for the table of contents # can be overridden in a page's front-matter - # TocTitle = "Table of Contents" # default + # TocTitle = "Содержание" # default [languages.ru] languageCode = 'ru' diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html index 640db00..9b69c14 100644 --- a/layouts/_default/_markup/render-heading.html +++ b/layouts/_default/_markup/render-heading.html @@ -1,5 +1,5 @@ {{ .Text | safeHTML }} -{{- if and (ge .Level 2) (le .Level 4) }}{{" " -}} +{{- if and (ge .Level 1) (le .Level 4) }}{{" " -}} {{- end -}} \ No newline at end of file