This commit is contained in:
wangbudui 2020-01-08 22:49:17 +08:00
parent 854ce8b0cf
commit 792d47afbc
10 changed files with 89 additions and 71 deletions

View File

@ -7,7 +7,7 @@ hasCJKLanguage = true
enableEmoji = true
[params]
Footer = "© 2019 王不对 - **[CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/)** - **[RSS](/index.xml)**"
HomeDesc = "**[博客](/blog/)和[飞行手册](/flight-rules/)中还有很多文章✨**"
HomeDesc = "**[博客](/blog/) [飞行手册](/flight-rules/)中还有很多文章✨**"
AuthorName = "王不对"
[[menu.main]]

View File

@ -1,13 +1,3 @@
body {
font-family: Optima, Candara, Calibri, Arial, sans-serif;
}
code {
font-family: "Lucida Console", Monaco, monospace;
font-size: 85%;
}
/* menu */
@media (max-width: 768px) {
#menu-check ~ label .close-icon {
display: none;

View File

@ -50,10 +50,10 @@
@apply overflow-x-auto p-4 border border-solid border-gray-400 shadow-lg;
}
.markdown code {
@apply bg-gray-200;
@apply bg-gray-200 font-mono text-sm;
}
.markdown pre code {
@apply bg-transparent font-mono;
@apply bg-transparent;
}
.markdown ul {
@apply text-base pl-8 list-disc;
@ -67,3 +67,7 @@
.markdown hr {
@apply block my-6 mx-auto max-w-md h-px border-t border-black;
}
.markdown a {
@apply border-b border-black;
}

View File

@ -1,5 +1,10 @@
module.exports = {
theme: {
fontFamily: {
'sans': ['Optima', 'Candara', '"Lucida Sans"', 'Calibri', 'Arial', 'source-han-serif-sc', '"Source Han Serif SC"',
'"Source Han Serif CN"', '"Source Han Serif TC"', '"Source Han Serif TW"', '"Source Han Serif"', '"Songti SC"', '"Microsoft YaHei"', "sans-serif"],
'mono': ['Menlo', 'Monaco', 'Consolas', '"Liberation Mono"', '"Courier New"', 'SFMono-Regular', 'monospace'],
},
extend: {}
},
variants: {},

View File

@ -2,7 +2,7 @@
<html>
{{- partial "head.html" . -}}
<body class="">
<body class="font-sans">
<div class="flex flex-col md:flex-row md:w-4/5 mx-auto py-5 min-h-screen">
{{- partial "header.html" . -}}
<main class="flex-1 p-4 md:border-l-2 md:border-black">

View File

@ -1,46 +1,15 @@
{{ define "main" }}
<div class="max-w-3xl mx-auto leading-relaxed my-6">
{{- partial "meta.html" . -}}
<div class="markdown">
<div class="markdown mb-12">
{{ .Content }}
</div>
{{- $pctx := . -}}
{{- $pages := $pctx.RegularPages -}}
{{- if .IsHome -}}
{{ $pages = .Site.RegularPages }}
{{ "**精选:**" | markdownify }}
{{- end -}}
{{ range $pages }}
<article itemscope itemtype="http://schema.org/Article" class="flex flex-col mt-6 mb-12">
{{ range .RegularPages }}
{{ if (eq $pctx.Kind "taxonomy") }}
{{ .Scratch.Set "taxonomy" (add $pctx.Type $pctx.Title) }}
{{ end }}
{{- partial "taxonomy.html" . -}}
<h2 itemprop="name" class="text-2xl"><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
<p itemprop="datePublished" content="{{ .Date.Format "2006-01-02" }}" class="">{{ .Date.Format "2006/01/02" }}
</p>
<div class="py-2">
{{ if .Description }}
{{ .Description | markdownify }}
{{ else }}
{{ if .Truncated }}
{{ .Summary | truncate 150 | markdownify }}...
{{ end }}
{{ end }}
</div>
</article>
{{ end }}
{{- if .IsHome -}}
{{ range $tagName, $taxonomy := .Site.Taxonomies.categories }}
{{ with $.Site.GetPage (printf "%s/%s" "categories" $tagName) }}
<a href="{{ .Permalink }}">{{ $tagName }}</a>({{ len $taxonomy }})
{{ end }}
{{ end }}
{{ .Page.Site.Params.HomeDesc | markdownify }}
{{ .Render "summary"}}
{{ end }}
</div>
{{ end }}

View File

@ -1,6 +1,23 @@
{{ define "main" }}
<article itemscope itemtype="http://schema.org/Article" class="max-w-3xl mx-auto leading-relaxed">
{{- partial "meta.html" . -}}
<header class="flex flex-col meta">
{{- partial "taxonomy.html" . -}}
<h1 itemprop="name" class="text-center text-3xl my-4 md:my-6">{{ .Title }}</h1>
{{ if not .Params.disableMeta }}
<h3 class="text-center text-xl">
{{ with $.Site.Params.AuthorName }}
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
<span itemprop="name">{{ . }}</span>
{{ end }}
{{ if .Params.date }}
{{ if $.Site.Params.AuthorName }} / {{ end }}
<span itemprop="datePublished"
content="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "2006-01-02" }}</span>
{{ end }}
</h3>
{{ end }}
</header>
<hr class="block my-10 mx-auto max-w-xs h-px border-t border-black">
<div itemprop="articleBody" class="content markdown">
{{ .Content }}
</div>

View File

@ -0,0 +1,15 @@
<article itemscope itemtype="http://schema.org/Article" class="flex flex-col mt-6 mb-12">
{{- partial "taxonomy.html" . -}}
<h2 itemprop="name" class="text-2xl"><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
<p itemprop="datePublished" content="{{ .Date.Format "2006-01-02" }}" class="">{{ .Date.Format "2006/01/02" }}
</p>
<div class="py-2">
{{ if .Description }}
{{ .Description | markdownify }}
{{ else }}
{{ if .Truncated }}
{{ .Summary | truncate 150 | markdownify }}...
{{ end }}
{{ end }}
</div>
</article>

View File

@ -0,0 +1,40 @@
{{ define "main" }}
<div class="max-w-3xl mx-auto leading-relaxed my-6">
<a class="block float-right " href="/about/">
<img src="/favicon.jpg" class="rounded-full" width=150 height=150 />
</a>
<div class="markdown">
{{ .Content }}
{{ $optBlock := dict "display" "block" }}
{{ "**精选:**" | .RenderString $optBlock }}
<ul>
{{ range (where .Site.RegularPages "Section" "!=" "") }}
{{ if .Params.spotlight }}
<li>
<span class="inline-block mr-3 font-mono">{{ .Date.Format "2006/01/02" }}</span>
<a href="{{ .Permalink }}">{{ .Title }}</a>
</li>
{{ end }}
{{ end }}
</ul>
{{ "**分类:**" | .RenderString $optBlock }}
<div>
{{ range $tagName, $taxonomy := .Site.Taxonomies.categories }}
{{ with $.Site.GetPage (printf "%s/%s" "categories" $tagName) }}
<span class="inline-block mr-3">
<a href="{{ .Permalink }}">{{ $tagName }}</a>({{ len $taxonomy }})
</span>
{{ end }}
{{ end }}
</div>
{{ .Page.Site.Params.HomeDesc | .RenderString $optBlock }}
</div>
</div>
{{ end }}

View File

@ -1,22 +0,0 @@
{{ if in (add "page" "section") .Kind }}
<header class="flex flex-col meta">
{{- partial "taxonomy.html" . -}}
<h1 itemprop="name" class="text-center text-3xl my-4 md:my-6">{{ .Title }}</h1>
{{ if and (not .Params.disableMeta) .IsPage }}
<h3 class="text-center text-xl">
{{ with $.Site.Params.AuthorName }}
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
<span itemprop="name">{{ . }}</span>
{{ end }}
{{ if .Params.date }}
{{ if $.Site.Params.AuthorName }} / {{ end }}
<span itemprop="datePublished"
content="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "2006-01-02" }}</span>
{{ end }}
</h3>
{{ end }}
</header>
{{ end }}
{{ if in (add "page" "section") .Kind }}
<hr class="block my-10 mx-auto max-w-xs h-px border-t border-black">
{{ end }}