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
baseURL = "http://localhost"
title = "Geekdocs"
subtitle = "A Hugo theme for documentation"
theme = "hugo-geekdoc"
# Required to get well formatted code blocks
@ -142,6 +143,7 @@ enableRobotsTXT = true
---
baseURL: "http://localhost"
title: "Geekdocs"
subtitle: "A Hugo theme for documentation"
theme: "hugo-geekdoc"
# Required to get well formatted code blocks

View File

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

View File

@ -226,14 +226,19 @@ svg.gdoc-icon {
}
.gdoc-brand {
font-size: defaults.$font-size-32;
line-height: defaults.$font-size-32;
&__img {
margin-right: defaults.$padding-16;
width: 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 {