Skip to content

Commit 675007c

Browse files
authored
Merge pull request #24 from apvarun/support-header-logo
Add logo support in navbar
2 parents 279d936 + 6976b63 commit 675007c

File tree

5 files changed

+10
-0
lines changed

5 files changed

+10
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ From `exampleSite/`, copy `config.toml` to the root folder of your Hugo site and
9494

9595
Menu in Blist theme is pre-set to have all section names. You can include custom links in header using the `menu.main` option config.toml.
9696

97+
### Logo
98+
99+
`logo` param in the site config will allow to use an image as the logo instead of the website name. It is localizable and so can have different logo for different languages
100+
97101
### Darkmode
98102

99103
`[params.darkModeToggle]` enables the dark mode toggle in header. The preference is then saved so that the mode is automatically chosen for return visits.

exampleSite/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ DefaultContentLanguageInSubdir = true
1414
introTitle = "Hey! I'm Katheryn Fox"
1515
introSubtitle = "26 y/o junior developer who enjoys social card games, blogging and painting"
1616
introPhoto = "/picture.jpg"
17+
logo = "/blist-logo.png"
1718
[[languages.en.menu.main]]
1819
name = "Blog"
1920
url = "blog"
@@ -44,6 +45,7 @@ DefaultContentLanguageInSubdir = true
4445
introTitle = "Hallo, ich bin Katheryn Fox"
4546
introSubtitle = "26-jährige Junior-Entwicklerin, die Spaß an sozialen Kartenspielen, Bloggen und Malen hat"
4647
introPhoto = "/picture.jpg"
48+
logo = "/blist-logo-de.png"
4749
[[languages.de.menu.main]]
4850
name = "Blog"
4951
url = "blog"
77.2 KB
Loading

exampleSite/static/blist-logo.png

53.5 KB
Loading

layouts/partials/header.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
<header class="container flex justify-between md:justify-between gap-4 flex-wrap p-6 mx-auto relative">
22
<a href="{{ .Site.Home.Permalink }}" class="capitalize font-extrabold text-2xl">
3+
{{ if .Site.Params.logo }}
4+
<img src="{{ .Site.Params.logo }}" alt="{{ .Site.Title }}" class="h-8 max-w-full" />
5+
{{ else }}
36
{{ .Site.Title }}
7+
{{ end }}
48
</a>
59
<button class="mobile-menu-button md:hidden">
610
<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">

0 commit comments

Comments
 (0)