mirror of
https://github.com/fruworg/themu.git
synced 2024-11-16 07:07:16 +03:00
Add custom CSS option - fixes issue #14
Borrowed some code from https://github.com/gadenbuie/garrickadenbuie-com/blob/main/layouts/partials/head.html and blended it in. I hope the syntax is still valid and makes sense. I'm not sure if it ought to say `if isset .Site.Params "customCSS"` but I left it as `customcss` as you suggested.
This commit is contained in:
parent
acd619ee67
commit
525bcfcd21
@ -43,6 +43,12 @@
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="{{ .Site.BaseURL }}css/main.css" />
|
||||
{{- if or (eq .Site.Params.mode "auto") (eq .Site.Params.mode "dark") -}}
|
||||
<link rel="stylesheet" type="text/css" href="{{ .Site.BaseURL }}css/dark.css" {{ if eq .Site.Params.mode "auto" }}media="(prefers-color-scheme: dark)"{{ end }} />
|
||||
{{ end }}
|
||||
<!-- Custom CSS style get applied last -->
|
||||
{{- if isset .Site.Params "customcss" }}
|
||||
{{ range .Site.Params.customCSS }}
|
||||
<link rel="stylesheet" type="text/css" ref="{{ . | relURL }}">
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
{{- range .Site.Params.customJS }}
|
||||
{{- if or (hasPrefix . "http://") (hasPrefix . "https://") }}
|
||||
@ -51,4 +57,4 @@
|
||||
<script src="{{ $.Site.BaseURL }}{{ . }}"></script>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</head>
|
||||
</head>
|
||||
|
Loading…
Reference in New Issue
Block a user