Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/thomasheller/crab.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Heller <thomas.m.heller@gmail.com>2017-06-09 08:57:20 +0300
committerGitHub <noreply@github.com>2017-06-09 08:57:20 +0300
commitfe46e5aefd9aa8f2b6274aa5d1d88edc716edac0 (patch)
treedb3bd7d29d4aae5a1ff4d6a762f0e12027b1d0d4
parent9764ec923528f40e8bd3fbddb166fb16be8ed236 (diff)
parentf2d6bf7865d9c1cc81ea625c917f5c58cd7d8fa7 (diff)
Merge pull request #6 from chengsoonong/master
Allow custom logo
-rw-r--r--README.md6
-rw-r--r--exampleSite/config.toml1
-rw-r--r--layouts/partials/header.html8
3 files changed, 13 insertions, 2 deletions
diff --git a/README.md b/README.md
index 247328d..d178a1f 100644
--- a/README.md
+++ b/README.md
@@ -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>