blog-theme

This commit is contained in:
Elnu 2023-02-18 16:42:54 -08:00
parent 29b925d36b
commit e00e6162ac
22 changed files with 349 additions and 1875 deletions

View file

@ -0,0 +1,3 @@
<div class="highlight" data-lang="{{ .Type }}">
{{ highlight .Inner .Type | safeHTML }}
</div>

View file

@ -2,6 +2,8 @@
<html>
{{- partial "head.html" . -}}
<body>
<div class="content">
{{ if .Site.Params.Stork }}
<div class="stork-search">
<input data-stork="home" placeholder="🔎 Search {{ .Site.Title }}...">
@ -9,13 +11,10 @@
<div data-stork="home-output"></div>
<br>
{{ end }}
{{- partial "header.html" . -}}
<div id="content">
<div class="page">
{{- block "main" . }}{{- end }}
</div>
<br>
<br>
{{- partial "footer.html" . -}}
<br>
</div>
</body>
</html>

View file

@ -1,13 +1,13 @@
<footer>
<span style="word-spacing: 1ch">
{{ range .Site.Sections }}
<a href="{{.RelPermalink }}">{{ .Title }}</a>
<a href="{{.RelPermalink }}">{{ .Title }}</a>
{{ end }}
{{ range $taxonomyname, $taxonomy := .Site.Taxonomies }}
{{ if $taxonomy }}<a href="{{ "/" | relLangURL }}{{ $taxonomyname | urlize }}/">{{ $taxonomyname | title }}</a> {{ end }}
{{ end }}
<div id="footer-content">
Copyright &copy; {{ dateFormat "2006" now }} <b>{{ .Site.Title }}</b>. All rights reserved.<br>
Site last regenerated with <a href="https://gohugo.io/">Hugo</a> at {{ partial "time.html" (dict "Date" now) }}</small>
</div>
</span><br>
Copyright &copy; {{ dateFormat "2006" now }} <b>{{ .Site.Title }}</b>. All rights reserved.<br>
Site last regenerated with <a href="https://gohugo.io/">Hugo</a> at {{ partial "time.html" (dict "Date" now) }}
</footer>

View file

@ -53,13 +53,11 @@
{{ with .Site.Params.ThemeColor }}
<meta name="theme-color" content="{{ . }}">
{{ end }}
<link rel="stylesheet" href="/css/sakura/normalize.css">
<link rel="stylesheet" href="/css/sakura/sakura{{ if isset .Site.Params "theme" }}-{{ .Site.Params.Theme }}{{ end }}.css">
{{ if isset .Site.Params "soudanurl" }}
<link rel="stylesheet" href="/css/soudan.css">
{{ end }}
{{ $main_options := (dict "targetPath" "css/style.css" "outputStyle" "compressed") }}
{{ $main_template := resources.Get "sass/style.sass" }}
{{ $main_style := $main_template | resources.ExecuteAsTemplate "style.sass" . | toCSS $main_options | resources.Minify }}
<link rel="stylesheet" href="{{ $main_style.RelPermalink }}">
{{ if .Site.Params.Stork }}
<link rel="stylesheet" href="/css/stork.css">
<script src="/js/stork.js"></script>
<script>
stork.initialize("/js/stork.wasm");

View file

@ -3,28 +3,72 @@
{{ if gt $pag.TotalPages 1 }}
{{ $scratch.Set "dot_rendered" false }}
<nav aria-label="page navigation">
{{ if and (ne $pag.PageNumber 1) (ne $pag.PageNumber 2) }}
<a href="{{ $pag.First.URL }}" rel="first">« First</a>
{{ if and (ne $pag.PageNumber 1) }}
<a href="{{ $pag.First.URL }}" rel="first"
{{- else -}}
<span class="disabled"
{{- end }} title="First page">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M18.75 19.5l-7.5-7.5 7.5-7.5m-6 15L5.25 12l7.5-7.5" />
</svg>
{{ if and (ne $pag.PageNumber 1) }}
</a>
{{ else }}
</span>
{{ end }}
{{ if $pag.HasPrev }}
<a href="{{ $pag.Prev.URL }}" rel="prev" class="page-link"> Prev</a>
{{ if $pag.HasPrev }}
<a href="{{ $pag.Prev.URL }}" rel="prev"
{{- else -}}
<span class="disabled"
{{- end }} title="Previous page">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 19.5L8.25 12l7.5-7.5" />
</svg>
{{ if $pag.HasPrev }}
</a>
{{ else }}
</span>
{{ end }}
{{ range $pag.Pagers }}
{{ if eq . $pag }}
{{ .PageNumber }}
<span>{{ .PageNumber }}</span>
{{ else if and (ge .PageNumber (sub $pag.PageNumber 2)) (le .PageNumber (add $pag.PageNumber 2)) }}
{{ $scratch.Set "dot_rendered" false }}
<a href="{{ .URL }}">{{ .PageNumber }}</a>
{{ else if eq ($scratch.Get "dot_rendered") false }}
{{ $scratch.Set "dot_rendered" true }}
&hellip;
<span>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z" />
</svg>
</span>
{{ end }}
{{ end }}
{{ if $pag.HasNext }}
<a href="{{ $pag.Next.URL }}" rel="next" class="page-link">Next </a>
<a href="{{ $pag.Next.URL }}" rel="next"
{{- else -}}
<span class="disabled"
{{- end }} title="Next page">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M8.25 4.5l7.5 7.5-7.5 7.5" />
</svg>
{{ if $pag.HasNext }}
</a>
{{ else }}
</span>
{{ end }}
{{ if and (ne $pag.PageNumber $pag.TotalPages) ((ne $pag.PageNumber (sub $pag.TotalPages 1))) }}
<a href="{{ $pag.Last.URL }}" rel="last" class="page-link">Last »</a>
{{ if and (ne $pag.PageNumber $pag.TotalPages) }}
<a href="{{ $pag.Last.URL }}" rel="last"
{{- else -}}
<span class="disabled"
{{ end }} title="Last page">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M11.25 4.5l7.5 7.5-7.5 7.5m-6-15l7.5 7.5-7.5 7.5" />
</svg>
{{ if and (ne $pag.PageNumber $pag.TotalPages) }}
</a>
{{ else }}
</span>
{{ end }}
</nav>
{{ end }}