diff options
Diffstat (limited to 'layouts/_partials')
| -rw-r--r-- | layouts/_partials/head.html | 12 | ||||
| -rw-r--r-- | layouts/_partials/header.gmi | 4 | ||||
| -rw-r--r-- | layouts/_partials/header.html | 4 |
3 files changed, 12 insertions, 8 deletions
diff --git a/layouts/_partials/head.html b/layouts/_partials/head.html index 5a1f89a..0c5a796 100644 --- a/layouts/_partials/head.html +++ b/layouts/_partials/head.html @@ -8,12 +8,12 @@ {{ if $.Site.Params.keywords }} <meta name="keywords" content="{{ $.Site.Params.keywords }}"> {{- end -}} - {{ if .Site.Params.custom_css -}} - {{ range .Site.Params.custom_css }} - <link rel="stylesheet" type="text/css" href="{{ (resources.Get . | minify | fingerprint).RelPermalink }}"> - {{- end -}} - {{ else }} - <link rel="stylesheet" type="text/css" href="{{ (resources.Get "static/css/style.css" | minify | fingerprint).RelPermalink }}"> + {{ range .Site.Params.custom_css | default (slice "static/css/style.css") }} + {{- with resources.Get . }} + <link rel="stylesheet" type="text/css" href="{{ (. | minify | fingerprint).RelPermalink }}"> + {{- else }} + {{- errorf "stylesheet %q listed in params.custom_css was not found in the assets directory" . }} + {{- end }} {{- end -}} {{ with .OutputFormats.Get "Atom" }} <link rel="alternate" type="application/atom+xml" href="{{ .RelPermalink }}" title="{{ $.Site.Title }}"> diff --git a/layouts/_partials/header.gmi b/layouts/_partials/header.gmi index c70f84a..972a82b 100644 --- a/layouts/_partials/header.gmi +++ b/layouts/_partials/header.gmi @@ -1,3 +1,5 @@ +{{ if fileExists "templates/logo.txt" -}} ```plaintext {{ chomp (readFile "templates/logo.txt") }} -```
\ No newline at end of file +``` +{{- end -}} diff --git a/layouts/_partials/header.html b/layouts/_partials/header.html index d8ec881..0c2d87e 100644 --- a/layouts/_partials/header.html +++ b/layouts/_partials/header.html @@ -1,5 +1,7 @@ +{{ if fileExists "templates/logo.txt" -}} <header class="logo"> <pre class="logo__text"> {{ chomp (readFile "templates/logo.txt") }} </pre> -</header>
\ No newline at end of file +</header> +{{- end -}} |
