Add post: 暗黑能天使

This commit is contained in:
2022-05-10 01:13:38 +08:00
parent e0a0b033ae
commit 90b654e708
104 changed files with 3185 additions and 7 deletions

View File

@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html
lang="{{ .Site.LanguageCode }}"
dir="{{ .Site.Language.LanguageDirection | default "ltr" }}"
{{ if eq .Site.Params.colorScheme "dark" }}class="dark"{{ end }}
>
{{- partial "head" . }}
<body class="flex min-h-screen flex-col">
<header
class="min-h-16 pl-scrollbar bg-secondary-bg fixed z-50 flex w-full items-center shadow-sm"
>
<div class="mx-auto w-full max-w-screen-xl">
{{- partial "header" . -}}
</div>
</header>
<main class="grow pt-16">
{{- if or .IsHome (and (eq .Type "authors") (eq .Kind "term")) }}
{{- block "main" . }}{{- end }}
{{- else }}
<div class="pl-scrollbar">
<div class="mx-auto w-full max-w-screen-xl lg:px-4 xl:px-8">
{{- block "main" . }}{{- end }}
</div>
</div>
{{ end }}
</main>
<footer class="pl-scrollbar">
<div class="mx-auto w-full max-w-screen-xl">
{{- partial "footer" . -}}
</div>
</footer>
</body>
</html>

View File

@@ -0,0 +1,7 @@
{{ define "main" }}
{{ partial "components/list-article" . }}
<div class="bg-secondary-bg rounded px-6">
{{ partial "components/summary-list-plain" .Paginator.Pages }}
</div>
{{ template "_internal/pagination.html" . }}
{{ end }}

View File

@@ -0,0 +1,60 @@
{{ define "main" }}
{{ $hasToc := and (in .TableOfContents "<li>" ) (.Params.toc) }}
{{ $hasSidebar := or ($hasToc) (.Params.series) }}
<div class="grid grid-cols-2 gap-4 lg:grid-cols-8 lg:pt-12">
<div
class="{{ if not $hasSidebar }}
{{- print "lg:col-start-2" -}}
{{ end }} bg-secondary-bg col-span-2 rounded px-6 py-8 lg:col-span-6"
>
{{ partial "components/post-article" . }}
{{ with .GetTerms "tags" }}
{{ partial "components/post-tags" . }}
{{ end }}
{{ partial "components/post-edit" . }}
{{ with .GetTerms "authors" }}
{{ partial "components/post-author" . }}
{{ end }}
{{ partial "components/post-footer" . }}
{{ partial "comment.html" . }}
</div>
{{ if $hasSidebar }}
<div class="col-span-2">
{{ if .GetTerms "series" }}
{{ partial "components/post-series" . }}
{{ end }}
{{ if $hasToc }}
{{ partial "components/post-toc" . }}
{{ end }}
</div>
{{ end }}
{{ $related := .Site.RegularPages.Related . | first 6 }}
{{ with $related }}
<div
class="{{ if not $hasSidebar }}
{{- print "lg:col-start-2" -}}
{{ end }} bg-secondary-bg prose col-span-2 rounded p-6 lg:col-span-6"
>
<h3>{{ i18n "seeAlso" }}</h3>
{{ range . }}
<a href="{{ .Permalink }}" class="no-underline">{{ .LinkTitle }}</a>
<br />
{{ end }}
</div>
{{ end }}
</div>
{{/* highlight.js */}}
{{- if eq .Site.Params.highlight.handler "highlightjs" }}
<script>
document.addEventListener("DOMContentLoaded", () => {
hljs.highlightAll();
});
</script>
{{- end }}
{{ end }}

View File

@@ -0,0 +1,12 @@
{{ define "main" }}
{{ partial "components/list-article" . }}
<div class="bg-secondary-bg rounded px-6 py-8">
{{ range .Pages }}
<h2 class="text-primary-text my-2 text-lg">
<a href="{{ .Permalink }}" class="text-eureka hover:underline"
>{{ .LinkTitle }}</a
>
</h2>
{{ end }}
</div>
{{ end }}