mirror of https://github.com/onweru/compose.git

weru
21.01.2020 7dd9d3665099acb72ac8cfc6cca96fdc3852648c
edit template
3 files modified
14 ■■■■ changed files
layouts/_default/baseof.html 2 ●●● patch | view | raw | blame | history
layouts/partials/nav.html 6 ●●●● patch | view | raw | blame | history
layouts/shortcodes/picture.html 6 ●●●● patch | view | raw | blame | history
layouts/_default/baseof.html
@@ -1,5 +1,5 @@
<!doctype html>
<html lang="{{ .Site.Language.Lang }}"{{ with .Site.Params.darkmode }} class="dim"{{ end }}>
<html lang="{{ .Site.Language.Lang }}"{{ with .Site.Params.enableDarkmode }} class="dim"{{ end }}>
<head>
  {{- partial "head" . }}
</head>
layouts/partials/nav.html
@@ -1,13 +1,13 @@
<nav class="wrap nav">
    <a href="{{ .Site.BaseURL }}" class="nav_brand">
        <picture>
            {{- $logos := .Site.Params.logo }}
            {{- $normalPath := absURL (printf "images/%s" $logos.lightMode) }}
        {{- $litPath := absURL (printf "images/%s" $logos.lightMode) }}
            {{- $darkPath := absURL (printf "images/%s" $logos.darkMode) }}
        <picture data-lit="{{ $litPath }}" data-dark="{{ $darkPath }}">
            {{ with .Site.Params.darkmode }}
            <source srcset = '{{ $darkPath }}' media="(prefers-color-scheme: dark)">
            {{ end }}
            <img srcset = '{{ $normalPath }}' alt = '{{ .Site.Title }} Logo'>
            <img srcset = '{{ $litPath }}' alt = '{{ .Site.Title }} Logo'>
        </picture>
        <label class="nav_toggle">Menu</label>
    </a>
layouts/shortcodes/picture.html
@@ -1,9 +1,9 @@
{{- $normal := .Get 0 }}
{{- $dark := .Get 1 }}
{{- $alt := .Get 2 }}
{{- $normalPath := absURL (printf "images/%s" $normal) }}
{{- $litPath := absURL (printf "images/%s" $normal) }}
{{- $darkPath := absURL (printf "images/%s" $dark) }}
<picture class="nav_logo">
<picture class="nav_logo" data-lit="{{ $litPath }}" data-dark="{{ $darkPath }}">
  <source srcset="{{ $darkPath }}" media="(prefers-color-scheme: dark)">
  <img srcset="{{ $normalPath }}" alt="{{ $alt }}">
  <img srcset="{{ $litPath }}" alt="{{ $alt }}">
</picture>