diff --git a/web/project-website/themes/hugo-geekdoc/layouts/partials/menu-filetree.html b/web/project-website/themes/hugo-geekdoc/layouts/partials/menu-filetree.html index e51a5de0..8790fc64 100644 --- a/web/project-website/themes/hugo-geekdoc/layouts/partials/menu-filetree.html +++ b/web/project-website/themes/hugo-geekdoc/layouts/partials/menu-filetree.html @@ -71,11 +71,11 @@ {{- printf " is-active" }} {{- end }}" > - {{ partial "utils/title" . }} + {{ partial "utils/title-toc" . }} {{ else }} - {{ partial "utils/title" . }} + {{ partial "utils/title-toc" . }} {{ end }} {{ if $doCollapse }} diff --git a/web/project-website/themes/hugo-geekdoc/layouts/partials/utils/title-toc.html b/web/project-website/themes/hugo-geekdoc/layouts/partials/utils/title-toc.html new file mode 100644 index 00000000..cb733329 --- /dev/null +++ b/web/project-website/themes/hugo-geekdoc/layouts/partials/utils/title-toc.html @@ -0,0 +1,13 @@ +{{ $title := "" }} + +{{ if .Page.Params.TitleTOC }} + {{ $title = .Page.Params.TitleTOC }} +{{ else if .Title }} + {{ $title = .Title }} +{{ else if and .IsSection .File }} + {{ $title = path.Base .File.Dir | humanize | title }} +{{ else if and .IsPage .File }} + {{ $title = .File.BaseFileName | humanize | title }} +{{ end }} + +{{ return $title }}