1
0
Fork 0
hugo-paper/layouts/_default/baseof.html

52 lines
1.6 KiB
HTML
Raw Permalink Normal View History

2021-08-23 21:59:02 +02:00
<!DOCTYPE html>
2022-08-21 07:57:54 +02:00
{{ $.Scratch.Delete "bg_color" }}<!---->
2022-07-18 17:36:39 +02:00
{{ $.Scratch.Delete "social_list" }}<!---->
{{ $.Scratch.Delete "avatar_url" }}<!---->
2022-08-21 07:57:54 +02:00
<!-- bg_color -->
2022-11-15 01:06:02 +01:00
{{ $color_map := dict "linen" "#faf6f1" "wheat" "#f1efe1" "gray" "#fbfbfb"
"light" "#fff" }}<!---->
{{ $.Scratch.Set "bg_color" (index $color_map (site.Params.color | default
(print "linen"))) }}<!---->
2022-08-15 20:20:41 +02:00
2022-07-18 17:36:39 +02:00
<!-- social_list -->
2022-12-24 21:14:16 +01:00
{{ $social_params := slice "twitter" "github" "instagram" "mastodon" "rss" }}<!---->
2022-08-15 20:20:41 +02:00
{{ range $social_params }}<!---->
2021-08-24 04:56:07 +02:00
{{ if isset site.Params . }}<!---->
2022-07-18 17:36:39 +02:00
{{ $.Scratch.Add "social_list" (slice .) }}<!---->
2021-08-23 21:59:02 +02:00
{{ end }}<!---->
{{ end }}<!---->
2022-07-18 17:36:39 +02:00
<!-- avatar_url -->
{{ if site.Params.avatar }}<!---->
{{ if in site.Params.avatar "http" }}<!---->
{{ $.Scratch.Set "avatar_url" site.Params.avatar }}<!---->
{{ else }}<!---->
2022-12-26 19:48:49 +01:00
{{ $official_cdn := "https://www.gravatar.com/avatar/" }}<!---->
{{ $cdn := (site.Params.gravatarCdn | default $official_cdn) }}<!---->
2022-07-18 17:36:39 +02:00
{{ $md5 := (md5 site.Params.avatar) }}<!---->
2022-12-26 19:48:49 +01:00
{{ $avatar_url := print $cdn $md5 "?s=160&d=identicon" }}<!---->
{{ $.Scratch.Set "avatar_url" $avatar_url }}<!---->
2022-07-18 17:36:39 +02:00
{{ end }}<!---->
{{ end }}<!---->
2021-08-23 21:59:02 +02:00
2022-08-15 20:20:41 +02:00
<html
class="not-ready text-sm lg:text-base"
2022-08-21 07:57:54 +02:00
style="--bg: {{ $.Scratch.Get `bg_color` }}"
2022-08-15 20:20:41 +02:00
lang="{{ site.LanguageCode }}"
>
2022-07-18 17:36:39 +02:00
{{ partial "head.html" . }}
<body class="text-black duration-200 ease-out dark:text-white">
2021-08-23 21:59:02 +02:00
{{ partial "header.html" . }}
2022-07-18 17:36:39 +02:00
<main
2022-07-19 17:25:41 +02:00
class="prose prose-neutral relative mx-auto min-h-[calc(100%-10rem)] max-w-3xl px-8 pt-20 pb-32 dark:prose-invert"
2022-07-18 17:36:39 +02:00
>
{{ block "main" . }}{{ end }}
</main>
2021-08-23 21:59:02 +02:00
{{ partial "footer.html" . }}
</body>
</html>