mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
theme: make favicon configurable #2
This commit is contained in:
parent
4ab28261ae
commit
70e7e603f8
4 changed files with 22 additions and 5 deletions
|
@ -35,12 +35,14 @@ The size of the logo will adapt automatically
|
|||
|
||||
## Change the favicon
|
||||
|
||||
If your favicon is a png, just drop off your image in your local `static/images/` folder and name it `favicon.png`
|
||||
If your favicon is a SVG, PNG or ICO, just drop off your image in your local `static/images/` folder and name it `favicon.svg`, `favicon.png` or `favicon.ico` respectivly.
|
||||
|
||||
If no favicon file is found, the theme will lookup the alternative filename `logo` in the same location and will repeat the search for the list of supported file types.
|
||||
|
||||
If you need to change this default behavior, create a new file in `layouts/partials/` named `favicon.html`. Then write something like this:
|
||||
|
||||
```html
|
||||
<link rel="shortcut icon" href="/images/favicon.png" type="image/x-icon" />
|
||||
<link rel="icon" href="/images/favicon.bmp" type="image/bmp" />
|
||||
```
|
||||
|
||||
## Change default colors {#theme-variant}
|
||||
|
|
|
@ -13,6 +13,10 @@ This document shows you what's new in the latest release. For a detailed list of
|
|||
|
||||
---
|
||||
|
||||
## 2.8.0
|
||||
|
||||
- **New**: The theme now supports favicons served from `static/images/` named as `favicon` or `logo` in SVG, PNG or ICO format [out of the box]({{% relref "basics/customization/#change-the-favicon" %}}). An overridden partial `layouts/partials/favicon.html` may not be necessary anymore in most cases.
|
||||
|
||||
## 2.7.0
|
||||
|
||||
- **New**: Optional second parameter for [`notice`]({{% relref "shortcodes/notice" %}}) shortcode to set title in box header.
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
{{- $assetBusting := not .Site.Params.disableAssetsBusting -}}
|
||||
<link rel="shortcut icon" href="{{"images/logo.svg" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}"/>
|
|
@ -1 +1,14 @@
|
|||
<link rel="icon" href="{{"images/favicon.png" | relURL}}" type="image/png">
|
||||
{{- $assetBusting := not .Site.Params.disableAssetsBusting -}}
|
||||
{{- if (fileExists "/static/images/favicon.svg") }}
|
||||
<link rel="icon" href="{{ "/images/favicon.svg" | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" type="image/svg+xml">
|
||||
{{- else if (fileExists "/static/images/favicon.png") }}
|
||||
<link rel="icon" href="{{ "/images/favicon.png" | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" type="image/png">
|
||||
{{- else if (fileExists "/static/images/favicon.ico") }}
|
||||
<link rel="icon" href="{{ "/images/favicon.icon" | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" type="image/x-icon">
|
||||
{{- else if (fileExists "/static/images/logo.svg") }}
|
||||
<link rel="icon" href="{{ "/images/logo.svg" | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" type="image/svg+xml">
|
||||
{{- else if (fileExists "/static/images/logo.png") }}
|
||||
<link rel="icon" href="{{ "/images/logo.png" | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" type="image/png">
|
||||
{{- else if (fileExists "/static/images/logo.ico") }}
|
||||
<link rel="icon" href="{{ "/images/logo.icon" | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" type="image/x-icon">
|
||||
{{- end }}
|
Loading…
Reference in a new issue