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

53 lines
1.6 KiB
HTML
Raw 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 -->
2023-07-05 10:59:54 +02:00
{{ $color_map := dict "linen" "#faf8f1" "wheat" "#f8f5d7" "gray" "#fbfbfb"
2022-11-15 01:06:02 +01:00
"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 -->
2023-06-06 20:23:33 +02:00
{{ $social_params := slice "twitter" "github" "instagram" "linkedin" "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
2023-07-07 10:38:46 +02:00
class="not-ready 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
2023-07-07 10:38:46 +02:00
class="prose prose-neutral relative mx-auto min-h-[calc(100%-9rem)] max-w-3xl px-8 pb-16 pt-12 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>