diff options
Diffstat (limited to 'www/layouts')
| -rw-r--r-- | www/layouts/_default/baseof.html | 9 | ||||
| -rw-r--r-- | www/layouts/_default/single.html | 8 | ||||
| -rw-r--r-- | www/layouts/partials/css-res.html | 9 | ||||
| -rw-r--r-- | www/layouts/partials/css.html | 10 | ||||
| -rw-r--r-- | www/layouts/partials/highlight.html | 6 | ||||
| -rw-r--r-- | www/layouts/partials/js.html | 4 | ||||
| -rw-r--r-- | www/layouts/real-home/home.html | 2 | 
7 files changed, 29 insertions, 19 deletions
| diff --git a/www/layouts/_default/baseof.html b/www/layouts/_default/baseof.html index defa6ac..55954d3 100644 --- a/www/layouts/_default/baseof.html +++ b/www/layouts/_default/baseof.html @@ -9,18 +9,13 @@      <title>{{ block "title" . }}        {{ .Site.Title }}      {{ end }}</title> -    {{ with resources.Get "catppuccin-latte.css" | minify | fingerprint  }} -      <style>{{ printf `@import url(%s);` .RelPermalink | safeCSS  }}</style> -    {{ end }} -    {{ with resources.Get "catppuccin-mocha.css" | minify | fingerprint }} -      <style>{{ printf `@import url(%s) (prefers-color-scheme: dark);` .RelPermalink | safeCSS  }}</style> -    {{ end }} +    {{ partial "js.html" "color-scheme.ts" }} +    {{ partial "css-res.html" (partial "highlight.html" dict) }}      {{ partial "css.html" "base-style.css" }}      {{ block "head" . }}      {{ end }}    </head>    <body> -    {{ partial "js.html" "color-scheme.ts" }}      <div id="slogan">        <span>🙃The world is full of pain, but we can fix it with love!</span>      </div> diff --git a/www/layouts/_default/single.html b/www/layouts/_default/single.html index 83297cf..1f267eb 100644 --- a/www/layouts/_default/single.html +++ b/www/layouts/_default/single.html @@ -10,7 +10,13 @@    {{ partial "nav.html" . }}    <h1 class="post-title">{{ .Title }}</h1>    <hr/> -  <p class="post-info"><span class="created">{{ partial "date.html" .Date }}</span> <span class="last-updated">Last updated: {{ partial "date.html" .Lastmod }}</span></p> +  <p class="post-info"> +    <span class="created">{{ partial "date.html" .Date }}</span> | +    <span class="words">{{ .WordCount }} words</span> +    {{ if ne .Lastmod .Date }} +      <span class="last-updated">Last updated: {{ partial "date.html" .Lastmod }}</span> +    {{ end}} +  </p>    {{ .Content }}    <hr class="end-hr"/>    {{ partial "nav.html" . }} diff --git a/www/layouts/partials/css-res.html b/www/layouts/partials/css-res.html new file mode 100644 index 0000000..6fabf67 --- /dev/null +++ b/www/layouts/partials/css-res.html @@ -0,0 +1,9 @@ +{{ with . | minify }} +  {{ if hugo.IsProduction }} +    {{ with . | fingerprint }} +      <link href="{{ .RelPermalink }}" rel="stylesheet" integrity="{{ .Data.Integrity }}"> +    {{ end }} +  {{ else }} +    <link href="{{ .RelPermalink }}" rel="stylesheet"> +  {{ end }} +{{ end }} diff --git a/www/layouts/partials/css.html b/www/layouts/partials/css.html index 5ddd65b..12d3353 100644 --- a/www/layouts/partials/css.html +++ b/www/layouts/partials/css.html @@ -1,9 +1 @@ -{{ with resources.Get . | minify }} -  {{ if hugo.IsProduction }} -    {{ with . | fingerprint }} -      <link href="{{ .RelPermalink }}" rel="stylesheet" integrity="{{ .Data.Integrity }}"> -    {{ end }} -  {{ else }} -    <link href="{{ .RelPermalink }}" rel="stylesheet"> -  {{ end }} -{{ end }} +{{ partial "css-res.html" (resources.Get .) }}
\ No newline at end of file diff --git a/www/layouts/partials/highlight.html b/www/layouts/partials/highlight.html new file mode 100644 index 0000000..06ab047 --- /dev/null +++ b/www/layouts/partials/highlight.html @@ -0,0 +1,6 @@ +{{ $light := resources.Get "catppuccin-latte.css" }} +{{ $dark := resources.Get "catppuccin-mocha.css" }} +{{ $dark_wrapper_before := resources.FromString "highlight-dark-wapper-before.css" `html[data-theme="dark"] {`}}} +{{ $dark_wrapper_after := resources.FromString "highlight-dark-wapper-after.css" "}"}} +{{ $highlight := slice $light $dark_wrapper_before $dark $dark_wrapper_after | resources.Concat "highlight.css" }} +{{ return $highlight }} diff --git a/www/layouts/partials/js.html b/www/layouts/partials/js.html index a4e8048..16dafa4 100644 --- a/www/layouts/partials/js.html +++ b/www/layouts/partials/js.html @@ -4,6 +4,8 @@        <script src="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}"></script>      {{ end }}    {{ else }} -    <script src="{{ (. | js.Build dict) .RelPermalink }}"></script> +    {{ with . | js.Build }} +      <script src="{{ .RelPermalink }}"></script> +    {{ end }}    {{ end }}  {{ end }} diff --git a/www/layouts/real-home/home.html b/www/layouts/real-home/home.html index 3de9903..daf3248 100644 --- a/www/layouts/real-home/home.html +++ b/www/layouts/real-home/home.html @@ -66,7 +66,7 @@    <section class="mono-link">      <h2>Other Links</h2>      <ul> -      <li><a rel="noopener noreferrer" href="{{ .RelPermalink }}">{{ .RelPermalink }}</a> +      <li><a rel="noopener noreferrer" href="{{ .RelPermalink }}">{{ .Permalink }}</a>          : home page, aka the one you are reading, built with <a rel="noopener noreferrer"            href="https://gohugo.io">hugo</a>.</li>        <li><a rel="noopener noreferrer" href="{{ absURL "/git/" }}">{{ absURL "/git/" }}</a> | 
