more upstreaming and using newer features
This commit is contained in:
parent
9a2c3669e5
commit
0350d8586d
5 changed files with 122 additions and 198 deletions
|
@ -1,59 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html
|
||||
lang="{{ with .Site.Params.isoCode | default (.Site.LanguageCode | default "en") }}
|
||||
{{- . -}}
|
||||
{{ end }}"
|
||||
dir="{{ if .Site.Params.rtl | default false -}}
|
||||
rtl
|
||||
{{- else -}}
|
||||
ltr
|
||||
{{- end }}"
|
||||
class="scroll-smooth"
|
||||
data-default-appearance="{{ .Site.Params.defaultAppearance | default "light" }}"
|
||||
data-auto-appearance="{{ .Site.Params.autoSwitchAppearance | default "true" }}"
|
||||
>
|
||||
{{- partial "head.html" . -}}
|
||||
<body
|
||||
class="flex flex-col h-screen px-6 m-auto text-lg leading-7 max-w-7xl bg-neutral text-neutral-900 dark:bg-neutral-800 dark:text-neutral sm:px-14 md:px-24 lg:px-32"
|
||||
>
|
||||
<div id="the-top" class="absolute flex self-center">
|
||||
<a
|
||||
class="px-3 py-1 text-sm -translate-y-8 rounded-b-lg bg-primary-200 focus:translate-y-0 dark:bg-neutral-600"
|
||||
href="#main-content"
|
||||
><span class="font-bold text-primary-600 ltr:pr-2 rtl:pl-2 dark:text-primary-400"
|
||||
>↓</span
|
||||
>{{ i18n "nav.skip_to_main" }}</a
|
||||
>
|
||||
</div>
|
||||
{{ $header := print "partials/header/" .Site.Params.header.layout ".html" }}
|
||||
{{ if templates.Exists $header }}
|
||||
{{ partial $header . }}
|
||||
{{ else }}
|
||||
{{ partial "partials/header/basic.html" . }}
|
||||
{{ end }}
|
||||
<div class="relative flex flex-col grow">
|
||||
<main id="main-content" class="grow">
|
||||
{{ block "main" . }}{{ end }}
|
||||
{{ if (.Site.Params.footer.showScrollToTop | default true) }}
|
||||
<div
|
||||
class="pointer-events-none absolute top-[100vh] bottom-0 w-12 ltr:right-0 rtl:left-0"
|
||||
>
|
||||
<a
|
||||
href="#the-top"
|
||||
class="pointer-events-auto sticky top-[calc(100vh-5.5rem)] flex h-12 w-12 items-center justify-center rounded-full bg-neutral/50 text-xl text-neutral-700 backdrop-blur hover:text-primary-600 dark:bg-neutral-800/50 dark:text-neutral dark:hover:text-primary-400"
|
||||
aria-label="{{ i18n "nav.scroll_to_top_title" }}"
|
||||
title="{{ i18n "nav.scroll_to_top_title" }}"
|
||||
>
|
||||
↑
|
||||
</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
</main>
|
||||
{{- partial "footer.html" . -}}
|
||||
{{ if .Site.Params.enableSearch | default false }}
|
||||
{{- partial "search.html" . -}}
|
||||
{{ end }}
|
||||
{{- partial "leaflet-loader" . -}}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,41 +0,0 @@
|
|||
{{ define "main" }}
|
||||
{{ $toc := and (.Params.showTableOfContents | default (.Site.Params.list.showTableOfContents | default false)) (in .TableOfContents "<ul") }}
|
||||
<header>
|
||||
{{ if .Params.showBreadcrumbs | default (.Site.Params.list.showBreadcrumbs | default false) }}
|
||||
{{ partial "breadcrumbs.html" . }}
|
||||
{{ end }}
|
||||
<h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral">{{ .Title }}</h1>
|
||||
</header>
|
||||
<section
|
||||
class="{{ if $toc -}}
|
||||
mt-12
|
||||
{{- else -}}
|
||||
mt-0
|
||||
{{- end }} prose flex max-w-full flex-col dark:prose-invert lg:flex-row"
|
||||
>
|
||||
{{ if $toc }}
|
||||
<div class="order-first px-0 lg:order-last lg:max-w-xs ltr:lg:pl-8 rtl:lg:pr-8">
|
||||
<div class="toc ltr:pl-5 rtl:pr-5 lg:sticky lg:top-10">
|
||||
{{ partial "toc.html" . }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="min-w-0 min-h-0 max-w-prose">
|
||||
{{ .Content | emojify }}
|
||||
</div>
|
||||
</section>
|
||||
{{ if gt .Pages 0 }}
|
||||
<section class="space-y-10 w-full">
|
||||
{{ range .Pages }}
|
||||
{{ partial "article-link.html" . }}
|
||||
{{ end }}
|
||||
</section>
|
||||
{{ partial "pagination.html" . }}
|
||||
{{ else }}
|
||||
<section class="mt-10 prose dark:prose-invert">
|
||||
<p class="py-8 border-t">
|
||||
<em>{{ i18n "list.no_articles" | emojify }}</em>
|
||||
</p>
|
||||
</section>
|
||||
{{ end }}
|
||||
{{ end }}
|
Loading…
Add table
Add a link
Reference in a new issue