feat: support brand subtitle

This commit is contained in:
Robert Kaussow 2025-03-20 10:36:15 +01:00
parent ef9ac519ec
commit faa8a75566
No known key found for this signature in database
GPG Key ID: 4E692A2EAECC03C0
3 changed files with 23 additions and 13 deletions

View File

@ -13,6 +13,7 @@ weight: -10
```toml ```toml
baseURL = "http://localhost" baseURL = "http://localhost"
title = "Geekdocs" title = "Geekdocs"
subtitle = "A Hugo theme for documentation"
theme = "hugo-geekdoc" theme = "hugo-geekdoc"
# Required to get well formatted code blocks # Required to get well formatted code blocks
@ -142,6 +143,7 @@ enableRobotsTXT = true
--- ---
baseURL: "http://localhost" baseURL: "http://localhost"
title: "Geekdocs" title: "Geekdocs"
subtitle: "A Hugo theme for documentation"
theme: "hugo-geekdoc" theme: "hugo-geekdoc"
# Required to get well formatted code blocks # Required to get well formatted code blocks

View File

@ -17,15 +17,18 @@
</label> </label>
{{ end }} {{ end }}
<div> <div>
<a class="gdoc-brand gdoc-header__link" href="{{ .Root.Site.Home.Permalink }}"> <a class="gdoc-brand gdoc-header__link flex gap-16 align-center" href="{{ .Root.Site.Home.Permalink }}">
<span class="flex align-center"> <img
<img class="gdoc-brand__img"
class="gdoc-brand__img" src="{{ (default "brand.svg" .Root.Site.Params.geekdocLogo) | relURL }}"
src="{{ (default "brand.svg" .Root.Site.Params.geekdocLogo) | relURL }}" alt=""
alt="" />
/> <div>
<span class="gdoc-brand__title">{{ .Root.Site.Title }}</span> <div class="gdoc-brand__title">{{ .Root.Site.Title }}</div>
</span> {{ with .Root.Site.Params.Subtitle }}
<div class="gdoc-brand__subtitle">{{ . }}</div>
{{ end }}
</div>
</a> </a>
</div> </div>
<div class="gdoc-menu-header flex gap-16"> <div class="gdoc-menu-header flex gap-16">

View File

@ -226,14 +226,19 @@ svg.gdoc-icon {
} }
.gdoc-brand { .gdoc-brand {
font-size: defaults.$font-size-32;
line-height: defaults.$font-size-32;
&__img { &__img {
margin-right: defaults.$padding-16;
width: defaults.$padding-32; width: defaults.$padding-32;
height: defaults.$padding-32; height: defaults.$padding-32;
} }
&__title {
font-size: defaults.$font-size-24;
line-height: defaults.$font-size-24;
}
&__subtitle {
font-size: defaults.$font-size-12;
}
} }
.gdoc-menu-header { .gdoc-menu-header {