diff options
author | Olivier Roques <oroques@fastmail.com> | 2021-01-23 22:10:27 +0100 |
---|---|---|
committer | Olivier Roques <oroques@fastmail.com> | 2021-01-23 22:10:27 +0100 |
commit | 543e939768f473b1a6ac5d13634ca38040695072 (patch) | |
tree | 2b71ea7d8f6bfa26e6206b13a5e8a8f629f15783 | |
parent | 3f24d8825c7730ea788f32b03abdfc9d05e0b8ef (diff) |
Add support for a header logo
Closes #12
-rw-r--r-- | exampleSite/config.toml | 1 | ||||
-rw-r--r-- | layouts/partials/header.html | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 7dd0f4a..3592e04 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -10,6 +10,7 @@ googleAnalytics = "" # add your tracking id author = "Olivier Roques" description = "A simple monospaced resume theme for Hugo." favicon = "favicon.ico" # path to a .ico to use as favicon + logo = "" # url or path to a logo to put in the header [params.footer] text = "By Olivier Roques" url = "https://github.com/ojroques/hugo-researcher" diff --git a/layouts/partials/header.html b/layouts/partials/header.html index e9debdf..37f5259 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,6 +1,11 @@ <div class="container mt-5"> <nav class="navbar navbar-expand-sm flex-column flex-sm-row text-nowrap p-0"> - <a class="navbar-brand mx-0 mr-sm-auto" href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a> + <a class="navbar-brand mx-0 mr-sm-auto" href="{{ .Site.BaseURL }}"> + {{ with .Site.Params.logo }} + <img src="{{ . | absURL }}" alt="logo"> + {{ end }} + {{ .Site.Title }} + </a> <div class="navbar-nav flex-row flex-wrap justify-content-center"> {{ with .Site.Menus.main }} {{ $navbar_len := len . }} |