lynx/layouts/index.html

41 lines
1.5 KiB
HTML
Raw Normal View History

2021-11-01 10:28:09 +08:00
{{ define "main" }}
<article class="flex flex-col items-center justify-center h-full mt-10 text-center">
<header class="flex flex-col items-center mb-3">
{{ with .Site.Author.image }}
<img class="mb-2 rounded-full w-36 h-36" src="{{ . | relURL }}" />
{{ end }}
<h1 class="text-4xl font-extrabold dark:text-white">
{{ .Params.title | default .Site.Author.name | default .Site.Title | emojify }}
</h1>
{{ with .Content }}
<section class="pt-5 prose dark:prose-light">{{ . | emojify }}</section>
{{ end }}
</header>
{{ with .Site.Author.links }}
<div class="flex flex-col flex-wrap min-w-full mt-4 sm:min-w-0">
{{ range $links := . }}
{{ range $type, $data := $links }}
{{ $href := $data }}
{{ $icon := $type }}
{{ $text := i18n (printf "link.%s" $type) }}
{{ if reflect.IsMap $data }}
{{ with $data.href }}{{ $href = . }}{{ end }}
{{ with $data.icon }}{{ $icon = . }}{{ end }}
{{ with $data.text }}{{ $text = . }}{{ end }}
{{ end }}
2021-11-01 10:28:09 +08:00
<a
class="link link-{{ $type }} sm:px-24 min-w-full py-2 mb-3 text-lg rounded"
href="{{ $href }}"
2021-11-01 10:28:09 +08:00
target="_blank"
rel="me noopener noreferrer"
><div class="">
<span class="mr-1">{{ partial "icon.html" $icon }}</span>{{ $text }}
2021-11-01 10:28:09 +08:00
</div></a
>
{{ end }}
{{ end }}
</div>
{{ end }}
</article>
{{ end }}