better post metadata

This commit is contained in:
Niklas Buschmann 2019-12-21 22:27:34 +01:00
parent c3aba6dedf
commit 67938a4494
5 changed files with 30 additions and 24 deletions

View File

@ -12,9 +12,9 @@
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/theme.css"> <link rel="stylesheet" href="{{ .Site.BaseURL }}css/theme.css">
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/classes.css"> <link rel="stylesheet" href="{{ .Site.BaseURL }}css/classes.css">
{{- if or .Params.math .Site.Params.math }} {{- if or .Params.math .Site.Params.math }}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.css" integrity="sha256-uT5rNa8r/qorzlARiO7fTBE7EWQiX/umLlXsq7zyQP8=" crossorigin="anonymous"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css" integrity="sha256-V8SV2MO1FUb63Bwht5Wx9x6PVHNa02gv8BgH/uH3ung=" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.js" integrity="sha256-TxnaXkPUeemXTVhlS5tDIVg42AvnNAotNaQjjYKK9bc=" crossorigin="anonymous"></script> <script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.js" integrity="sha256-F/Xda58SPdcUCr+xhSGz9MA2zQBPb0ASEYKohl8UCHc=" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/mathtex-script-type.min.js" integrity="sha256-b8diVEOgPDxUp0CuYCi7+lb5xIGcgrtIdrvE8d/oztQ=" crossorigin="anonymous"></script> <script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/contrib/mathtex-script-type.min.js" integrity="sha256-b8diVEOgPDxUp0CuYCi7+lb5xIGcgrtIdrvE8d/oztQ=" crossorigin="anonymous"></script>
{{- end }} {{- end }}
<header class="{{ if .Site.Params.brightheader }}bright{{ else }}dark{{ end }}"> <header class="{{ if .Site.Params.brightheader }}bright{{ else }}dark{{ end }}">

View File

@ -7,7 +7,7 @@
{{ end }} {{ end }}
<article> <article>
<header><h1>{{ .Title | default "Posts" }}</h1></header> <header><h1>{{ .Title | default "Posts" | humanize }}</h1></header>
<ul class="archive"> <ul class="archive">
{{- range $Pages }} {{- range $Pages }}
<li> <li>

View File

@ -2,8 +2,12 @@
<article> <article>
<header> <header>
<h1><a href="{{ .Permalink }}">{{ .Title }}</a></h1> {{ range $index, $tag := .Params.categories }}
{{ if .Date }}<p class="meta"><time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "January 02, 2006" }}</time></p>{{ end }} {{- if gt $index 0 }}, {{ end -}}
<a href="{{ ($.Site.GetPage (printf "/%s/%s" "categories" $tag)).Permalink }}">{{ $tag | upper }}</a>
{{- end -}}
<h1>{{ .Title }}</h1>
<p>{{ if ($.Param "author") }}{{ $.Param "author" }}{{ end }}{{ if .Date }}<time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ if ($.Param "author") }} | {{ end }}{{ .Date.Format "January 02, 2006" }}</time>{{ end }}</p>
</header> </header>
{{ .Content }} {{ .Content }}
</article> </article>

View File

@ -1,8 +1,3 @@
.meta {
margin-top: .2em;
margin-bottom: 1.5em;
}
.bright { .bright {
box-shadow: 0 0 .6em #3c3c3c0f; box-shadow: 0 0 .6em #3c3c3c0f;
border-bottom: 1px solid #9494941f; border-bottom: 1px solid #9494941f;

View File

@ -1,13 +1,13 @@
@media (prefers-color-scheme: light) { @media (prefers-color-scheme: light) {
html { html {
background: #fff; background: #fff;
color: #282828; color: #222;
} }
} }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
html { html {
background: #282828; background: #222;
color: #fff; color: #fff;
} }
} }
@ -38,19 +38,18 @@ b, strong, th {
a { a {
color: inherit; color: inherit;
text-decoration: inherit; text-decoration: inherit;
transition: color .2s;
} }
a:hover, header time { a:hover {
color: #949494; text-decoration: underline;
} }
article a { article a {
color: #68f; color: #68f;
} }
article header a, article footer a { header time {
color: inherit; color: #949494;
} }
hr { hr {
@ -97,6 +96,7 @@ pre {
pre code { pre code {
all: unset; all: unset;
-webkit-text-fill-color: initial;
} }
code { code {
@ -115,20 +115,27 @@ body > header {
align-items: center; align-items: center;
} }
h1 {
font-size: 1.7em;
}
header h1, header h2 { header h1, header h2 {
margin: 0; margin: 0;
} }
article header {
margin-bottom: 2em;
}
article header h1 {
font-size: 1.75em;
padding: .25em 0;
margin-bottom: .7em;
border-bottom: 1px solid #94949436;
}
nav { nav {
margin: .5em -.8em; margin: .5em -.8em;
} }
nav a { nav a {
margin: 0 .8em; padding: 0 .8em;
} }
body > header, article { body > header, article {