Refactor scss to minimize resulting css

This commit is contained in:
Vri 🌈 2023-01-15 00:19:35 +01:00
parent 8d154d444e
commit 190c0acf7f
Signed by: vrifox
GPG key ID: D40098E5B60B2197
23 changed files with 78 additions and 25 deletions

View file

@ -2,8 +2,7 @@
<html lang="{{ .Page.Lang }}">
<head>
<title>{{ with .Title }} {{ . }} {{ end }}{{ .Site.Title }}</title>
{{- $style := resources.Get "/style.scss" | resources.ToCSS (dict "outputStyle" "compressed") }}
<link rel="preload stylesheet" as="style" href="{{ $style.Permalink }}" type="text/css" media="screen" />
{{ block "stylesheet" . }}{{ end }}
<link href="/gpg.pub" rel="pgpkey authn" />
<link href="https://social.anoxinon.de/@vri" rel="me" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />

View file

@ -1,5 +1,5 @@
{{- define "stylesheet" -}}
{{- $scss := resources.Get "/_default/list.scss" -}}
{{- $scss := resources.Get "/scss/style.scss" -}}
{{- $style := $scss | resources.ToCSS -}}
<link rel="preload stylesheet" as="style" href="{{ $style.Permalink }}" type="text/css" media="screen" />
{{- end -}}

17
layouts/blog/list.html Normal file
View file

@ -0,0 +1,17 @@
{{- define "stylesheet" -}}
{{- $scss := resources.Get "/scss/blog.scss" -}}
{{- $style := $scss | resources.ToCSS -}}
<link rel="preload stylesheet" as="style" href="{{ $style.Permalink }}" type="text/css" media="screen" />
{{- end -}}
{{- define "main" }}
<main>
<h1 class="title">{{ .Title }}</h1>
<p>{{ .Content }}</p>
{{- range .Pages }}
<p> <a href="{{ .Permalink }}">{{ .Title }}</a> <span>{{ .Date.Day }}. {{ if eq .Params.lang "de"}} {{ index $.Site.Data.monate (printf "%d" .Date.Month) }} {{ else }} {{ .Date.Month }} {{ end }} {{ .Date.Year }}</span> </p>
{{- end }}
</main>
{{- end }}

32
layouts/blog/single.html Normal file
View file

@ -0,0 +1,32 @@
{{- define "stylesheet" -}}
{{- $scss := resources.Get "/scss/blog.scss" -}}
{{- $style := $scss | resources.ToCSS -}}
<link rel="preload stylesheet" as="style" href="{{ $style.Permalink }}" type="text/css" media="screen" />
{{- end -}}
{{- define "main" }}
<main>
{{- if eq .Params.type "post" }}
<p class="date-published" title="{{ .Date | time.Format "2. January 2006, 15:04 MST" }}">{{ .Date | time.Format "2. January 2006" }}</p>
{{- end }}
<h1 class="title">{{ .Title }}</h1>
{{ .Content -}}
<aside>
{{- with .Params.topics }}
<ul class="topics">
{{- range . }}
<li>
<a href="{{ "topics" | relURL}}/{{ . | urlize }}">{{ . }}</a>
</li>
{{ end }}
</ul>
{{- end }}
{{- with .Params.tags }}
tags
{{- range . }}
<a href='{{ "tags" | relURL }}/{{ . | urlize }}'>{{ . }}</a>
{{- end }}
{{- end }}
</aside>
</main>
{{- end }}

View file

@ -1,3 +1,9 @@
{{- define "stylesheet" -}}
{{- $scss := resources.Get "/scss/home.scss" -}}
{{- $style := $scss | resources.ToCSS -}}
<link rel="preload stylesheet" as="style" href="{{ $style.Permalink }}" type="text/css" media="screen" />
{{- end -}}
{{- define "header" }}
<header id="introduction" class="global-header">
<h1>{{ i18n "introduction-heading" }}</h1>