Only search favicon and css in assets.

This commit is contained in:
tastytea 2020-12-29 15:28:33 +01:00
parent e2f81533c9
commit fee2c6c7b6
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
2 changed files with 5 additions and 8 deletions

View File

@ -40,7 +40,9 @@ the link:{uri-archive}[archive] into `themes/nocolor`.
== Configuration & Modification
Please take a look at the link:{uri-slick-example}[configuration example for
Slick]. It is valid for nocolor too.
Slick]. It is valid for nocolor too, with these exceptions:
* `favicon` and `css` have to be in in the assets folder.
You can add things to the end of the `<head>` section by overwriting the partial
template `extra-head.html` or above the footer by overwriting

View File

@ -21,21 +21,16 @@
{{- end }}
{{- with .Site.Params.favicon | default "favicon.ico" }}
{{- if resources.Get . }}
{{- $favicon := resources.Get . | resources.Fingerprint }}
{{- $favicon := resources.Get . }}
<link rel="shortcut icon" href="{{ $favicon.RelPermalink }}" type="{{ $favicon.MediaType }}" />
{{- else if fileExists (path.Join "static" .) }}
{{- $favtype := cond (eq (path.Ext .) ".png") "image/png" "image/x-icon" }}
<link rel="shortcut icon" href="{{ $.Site.BaseURL }}{{ . }}" type="{{ $favtype }}" />
{{- end }}
{{- end }}
{{- $style := resources.Get "nocolor.css" }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}" />
{{- with .Site.Params.css }}
{{- if resources.Get . }}
{{- $styleCustom := resources.Get . | resources.Fingerprint }}
{{- $styleCustom := resources.Get . }}
<link rel="stylesheet" href="{{ $styleCustom.RelPermalink }}" />
{{- else if fileExists (path.Join "static" .) }}
<link rel="stylesheet" href="{{ $.Site.BaseURL }}{{ . }}" />
{{- end }}
{{- end }}
{{ partial "extra_head.html" . }}