diff options
author | Cheng Soon Ong <chengsoon.ong@anu.edu.au> | 2017-05-03 17:14:15 +0300 |
---|---|---|
committer | Cheng Soon Ong <chengsoon.ong@anu.edu.au> | 2017-05-03 17:14:15 +0300 |
commit | f2d6bf7865d9c1cc81ea625c917f5c58cd7d8fa7 (patch) | |
tree | db3bd7d29d4aae5a1ff4d6a762f0e12027b1d0d4 | |
parent | 9764ec923528f40e8bd3fbddb166fb16be8ed236 (diff) |
Allow custom logo
-rw-r--r-- | README.md | 6 | ||||
-rw-r--r-- | exampleSite/config.toml | 1 | ||||
-rw-r--r-- | layouts/partials/header.html | 8 |
3 files changed, 13 insertions, 2 deletions
@@ -113,6 +113,12 @@ articles. The `exampleSites/config.toml` shows the kind of `permalinks` declaration required to generate blog posts in the correct place. +## Logo + +To change the logo of the crab to your own customised image, +add `logoimage` to `config.toml`, where `logoimage` is the +path inside your site's `static` directory. + ## Contact If you think anything could be improved about the Crab theme, feel diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 7ded7ce..52530e1 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -5,6 +5,7 @@ baseurl = "https://example.com" [params] description = "A clean Hugo theme for websites" +# logoimage = "images/logo.jpg" [permalinks] blog = "/blog/:year/:month/:title/" diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 2564346..cc8f8a8 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -12,8 +12,12 @@ <div id="header"> - <div id="site-logo"> - <img src="{{ .Site.BaseURL }}img/crab-logo.png"> + <div id="site-logo"> + {{ if isset .Site.Params "logoimage" }} + <img src="{{ .Site.BaseURL }}{{ .Site.Params.logoimage }}"> + {{ else }} + <img src="{{ .Site.BaseURL }}img/crab-logo.png"> + {{ end }} </div> <div id="site-title"><a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a></div> |