diff options
Diffstat (limited to 'www/layouts/_partials')
-rw-r--r-- | www/layouts/_partials/css-res.html | 9 | ||||
-rw-r--r-- | www/layouts/_partials/css.html | 1 | ||||
-rw-r--r-- | www/layouts/_partials/date.html | 1 | ||||
-rw-r--r-- | www/layouts/_partials/highlight.html | 6 | ||||
-rw-r--r-- | www/layouts/_partials/js.html | 11 | ||||
-rw-r--r-- | www/layouts/_partials/nav.html | 6 | ||||
-rw-r--r-- | www/layouts/_partials/preview/article.html | 10 | ||||
-rw-r--r-- | www/layouts/_partials/preview/post.html | 7 | ||||
-rw-r--r-- | www/layouts/_partials/preview/posts.html | 13 |
9 files changed, 64 insertions, 0 deletions
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 new file mode 100644 index 0000000..12d3353 --- /dev/null +++ b/www/layouts/_partials/css.html @@ -0,0 +1 @@ +{{ partial "css-res.html" (resources.Get .) }}
\ No newline at end of file diff --git a/www/layouts/_partials/date.html b/www/layouts/_partials/date.html new file mode 100644 index 0000000..9769e4e --- /dev/null +++ b/www/layouts/_partials/date.html @@ -0,0 +1 @@ +<time datetime="{{ . | time.Format "RFC3339"}}">{{ . | time.Format ":date_medium" }}</time>
\ 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..28c510e --- /dev/null +++ b/www/layouts/_partials/highlight.html @@ -0,0 +1,6 @@ +{{ $light := resources.Get "res/css/catppuccin-latte.css" }} +{{ $dark := resources.Get "res/css/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 "res/css/highlight.css" }} +{{ return $highlight }} diff --git a/www/layouts/_partials/js.html b/www/layouts/_partials/js.html new file mode 100644 index 0000000..16dafa4 --- /dev/null +++ b/www/layouts/_partials/js.html @@ -0,0 +1,11 @@ +{{ with resources.Get . }} + {{ if hugo.IsProduction }} + {{ with . | js.Build (dict "minify" true "sourceMap" "external") | fingerprint }} + <script src="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}"></script> + {{ end }} + {{ else }} + {{ with . | js.Build }} + <script src="{{ .RelPermalink }}"></script> + {{ end }} + {{ end }} +{{ end }} diff --git a/www/layouts/_partials/nav.html b/www/layouts/_partials/nav.html new file mode 100644 index 0000000..42c9ad1 --- /dev/null +++ b/www/layouts/_partials/nav.html @@ -0,0 +1,6 @@ +<nav class="mono"> + {{ range .Ancestors.Reverse }} + <a class="mono-link" href="{{ .RelPermalink }}">{{ lower .Title }}</a> > + {{ end }} + this +</nav> diff --git a/www/layouts/_partials/preview/article.html b/www/layouts/_partials/preview/article.html new file mode 100644 index 0000000..6245434 --- /dev/null +++ b/www/layouts/_partials/preview/article.html @@ -0,0 +1,10 @@ +<section class="article-preview"> + <span class="date">{{ .date | time.Format ":date_medium" }}</span> + {{ (printf `<%[1]s class="title"><a href="%s">%s</a></%[1]s>` .h .link .title) | safeHTML }} + <p class="content"> + {{ range split .content "\n" | first 5 }} + {{ . | htmlUnescape }}<br/> + {{ end }} + </p> + <p>... <a class="mono-link" href="{{ .link }}">Read more</a></p> +</section> diff --git a/www/layouts/_partials/preview/post.html b/www/layouts/_partials/preview/post.html new file mode 100644 index 0000000..f0c6fb5 --- /dev/null +++ b/www/layouts/_partials/preview/post.html @@ -0,0 +1,7 @@ +{{ partial "preview/article.html" (dict + "h" .h + "title" .page.Title + "link" .page.RelPermalink + "content" .page.Plain + "date" .page.Date) +}} diff --git a/www/layouts/_partials/preview/posts.html b/www/layouts/_partials/preview/posts.html new file mode 100644 index 0000000..291c4b2 --- /dev/null +++ b/www/layouts/_partials/preview/posts.html @@ -0,0 +1,13 @@ +{{ $h := .h }} +{{ $is_first := true}} +{{ range .pages }} + {{ if $is_first }} + {{ $is_first = false }} + {{ else }} + <hr class="article-preview-hr"> + {{ end }} + {{ partial "preview/post.html" (dict + "h" $h + "page" .) + }} +{{ end }}
\ No newline at end of file |