Skip to content

Commit

Permalink
Merge pull request athul#15 from francisbarton/patch-2
Browse files Browse the repository at this point in the history
Add custom CSS option - fixes issue athul#14
  • Loading branch information
athul committed Oct 4, 2020
2 parents acd619e + 525bcfc commit a75faae
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -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://") }}
Expand All @@ -51,4 +57,4 @@
<script src="{{ $.Site.BaseURL }}{{ . }}"></script>
{{- end }}
{{- end }}
</head>
</head>

0 comments on commit a75faae

Please sign in to comment.