Add the option to use a logo for the top left site title

This commit is contained in:
Nick White 2020-01-31 14:19:38 +00:00
parent 505b255923
commit ab295db12c
2 changed files with 14 additions and 0 deletions

View File

@ -139,6 +139,16 @@ For example, if your css files are `static/css/custom.css` and `static/css/custo
If you add a key of `show_reading_time` true to either the Config Params, a page or section's front matter, articles will show the reading time and word count. If you add a key of `show_reading_time` true to either the Config Params, a page or section's front matter, articles will show the reading time and word count.
### Logo
You can replace the title of your site in the top left corner of each page with your own logo. To do that put your own logo into the `static` directory of your website, and add the `logo` parameter to the site params in your config file. For example:
```
[params]
logo = "img/logo.svg"
```
### Nearly finished ### Nearly finished
In order to see your site in action, run Hugo's built-in local server. In order to see your site in action, run Hugo's built-in local server.

View File

@ -1,7 +1,11 @@
<nav class="pv3 ph3 ph4-ns" role="navigation"> <nav class="pv3 ph3 ph4-ns" role="navigation">
<div class="flex-l justify-between items-center center"> <div class="flex-l justify-between items-center center">
<a href="{{ .Site.BaseURL }}" class="f3 fw2 hover-white no-underline white-90 dib"> <a href="{{ .Site.BaseURL }}" class="f3 fw2 hover-white no-underline white-90 dib">
{{ if .Site.Params.Logo }}
<img src="/{{ .Site.Params.Logo }}" alt="{{ .Site.Title }}" />
{{ else }}
{{ .Site.Title }} {{ .Site.Title }}
{{ end }}
</a> </a>
<div class="flex-l items-center"> <div class="flex-l items-center">
{{ partial "i18nlist.html" . }} {{ partial "i18nlist.html" . }}