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

48 lines
1.5 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 -->
{{ $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-08-15 20:20:41 +02:00
{{ $social_params := slice "twitter" "github" "instagram" "rss" }}<!---->
{{ 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 }}<!---->
{{ $md5 := (md5 site.Params.avatar) }}<!---->
{{ $url := print "https://www.gravatar.com/avatar/" $md5 "?s=160&d=identicon" }}<!---->
{{ $.Scratch.Set "avatar_url" $url }}<!---->
{{ 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>