Skip to content

Commit 55ae0e7

Browse files
authored
Merge pull request #130 from kakawait/bugfix/de-hardcode-favicon
De-hardcode favicon path and use setting if present
2 parents e4d199b + 1749176 commit 55ae0e7

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

docs/user.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ E.g to display a shortcut to open algolia search window :
344344
thumbnailImagePosition = "right"
345345
autoThumbnailImage = true
346346
coverImage = "cover.jpg"
347-
favicon =
347+
favicon = /favicon.png
348348
imageGallery = true
349349
hierarchicalCategories = true
350350
```
@@ -354,10 +354,10 @@ E.g to display a shortcut to open algolia search window :
354354
| sidebarBehavior | Define the behavior of the header and sidebar :<ul><li>1: Display extra large sidebar on extra large screen, large sidebar on large screen, medium sidebar on medium screen and header bar on small screen and extra large sidebar is swiped on extra large screen and large sidebar on all lower screens when open button is clicked (default)</li><li>2: Display large sidebar on extra large & large screen, medium sidebar on medium screen and header bar on small screen and large sidebar is swiped when open button is clicked</li><li>3: Display medium sidebar on large and medium screen and header bar on small screen and medium sidebar is swiped when open button is clicked</li><li>4: Display header bar on all screens, extra large sidebar is swiped on extra large screen and large sidebar is swiped on all lower screens</li><li>5: Display header bar on all screens and large sidebar is swiped on large screen</li><li>6: isplay header bar on all screens and medium sidebar is swiped</li></ul> |
355355
| clearReading | Hide sidebar on all article page to let article take full width to improve reading, and enjoy wide images and cover images. Useless if `sidebarBehavior` is equal to `3` or `4`. (true: enable, false: disable). Default behavior : `params.clearReading` value in theme configuration file. |
356356
| thumbnailImage | Display thumbnail image of each post on index pages |
357-
| thumbnailImagePosition | Display thumbnail image at the right of title in index pages (`right`, `left` or `bottom`). Set this value to `right` if you have old posts to keep the old style on them and define `thumbnailImagePosition` on a post to overwrite this setting. (Default : `right`) |
357+
| thumbnailImagePosition | Display thumbnail image at the right of title in index pages (`right`, `left` or `bottom`). Set this value to `right` if you have old posts to keep the old style on them and define `thumbnailImagePosition` on a post to overwrite this setting. (Default: `right`) |
358358
| autoThumbnailImage | Automatically select the cover image or the first photo from the gallery of a post if there is no thumbnail image as the thumbnail image. Set this value to `true` if you have old posts that use the cover image or the first photo as the thumbnail image and set `autoThumbnailImage` to `false` on a post to overwrite this setting. (Default : `true`) |
359359
| coverImage | Your blog cover picture. **I STRONGLY recommend you to use a CDN to speed up loading of pages. There is many free CDN like Cloudinary or you can also use indirectly by using services like Google Photos.** |
360-
| favicon | Your favicon path |
360+
| favicon | Your favicon path (Default: `/favicon.png`) |
361361
| imageGallery | Display an image gallery at the end of a post which have `photos` variables. (false: disabled, true: enabled) |
362362
| hierarchicalCategories | Define categories will create hierarchy between parents: `categories = ["foo", "bar"]` will consider "bar" a sub-category of "foo". If false it will flat categories. |
363363
| customCSS | Define files with css that override or extend the theme css; they are expected in `static` folder: `customCSS` = ["css/mystyles.css"]. |

exampleSite/config.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ canonifyurls = true
153153
# and set `autoThumbnailImage` to `false` on a post to overwrite this setting
154154
autoThumbnailImage = true
155155

156+
# Your favicon path, default is "/favicon.png"
157+
# favicon = "/favicon.png"
158+
156159
# Header configuration
157160
# The link at the right of the header is customizable
158161
# You can add a link (as an icon) at the right of the header instead of the author's gravatar image or author's picture.

layouts/partials/head.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<meta name="author" content="{{ .Site.Author.name }}">
3333
<meta name="keywords" content="{{ with .Keywords }}{{ delimit . ", " }}{{ end }}{{ if .Site.Params.keywords }}, {{ delimit .Site.Params.keywords ", " }}{{ end }}">
3434

35-
<link rel="icon" href="/favicon.png">
35+
<link rel="icon" href="{{ with .Site.Params.favicon }}{{ . }}{{ else }}/favicon.png{{ end }}">
3636
{{ with .RSSLink }}
3737
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ . }}">
3838
{{ end }}

0 commit comments

Comments
 (0)