some theme tweaks

This commit is contained in:
Valentin Boettcher 2021-08-01 13:37:49 +02:00
parent 0e991a4677
commit 6335137d45
No known key found for this signature in database
GPG key ID: E034E12B7AF56ACE
5 changed files with 136 additions and 22 deletions

88
assets/css/style.css Normal file
View file

@ -0,0 +1,88 @@
html {
overflow-y: scroll
}
:root {
--bgcolor: white;
--fontcolor: #444;
--linkcolor: #00e;
--visitedcolor: #551a8b;
--precolor: #fff;
--prebgcolor: #000;
}
@media (prefers-color-scheme: dark) {
:root {
--bgcolor: black;
--fontcolor: white;
--linkcolor: #5bf;
--visitedcolor: #ae5ee0;
--precolor: #fff;
--prebgcolor: #383838;
}
}
body {
max-width: 800px;
margin: 40px auto;
padding: 0 10px;
font: 14px/1.5 monospace;
color: var(--fontcolor);
background: var(--bgcolor)
}
a:link {
color: var(--linkcolor)
}
a:visited {
color: var(--visitedcolor)
}
a:active {
color: var(--visitedcolor)
}
h1,h2,h3 {
line-height: 1.2
}
p > code {
color: var(--precolor);
background: var(--prebgcolor);
padding: 2px
}
pre {
color: var(--precolor);
background: var(--prebgcolor);
padding: 24px;
overflow-x: auto
}
article {
padding: .5em 0
}
.center {
display: block;
margin-left: auto;
margin-right: auto;
width: 100%;
}
img {
display: block;
max-width: 100%;
height: auto;
}
figcaption {
color: #888;
font: 12px/1.5 monospace;
text-align: center;
}
figure {
margin: auto
}

View file

@ -8,9 +8,15 @@
<title>{{ .Title }}</title> <title>{{ .Title }}</title>
{{ with .Site.Params.description }}<meta name="description" content="{{ . }}">{{ end }} {{ with .Site.Params.description }}<meta name="description" content="{{ . }}">{{ end }}
{{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }} {{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }}
<link rel="stylesheet" href="{{ "css/style.css" | relURL }}"> <!-- Load the main stylesheet. -->
{{ range .Site.Params.customCSS -}} {{ $style := (resources.Get "css/style.css" | resources.Minify) }}
<link rel="stylesheet" href="{{ . | relURL }}?rnd={{ now.Unix }}"> <link
rel="stylesheet"
href="{{ $style.Permalink }}?cb={{ now.Unix }}"
integrity="{{ $style.Data.Integrity }}" />
{{ range .Site.Params.customCSS -}}
<link rel="stylesheet" href="{{ . | relURL }}?rnd={{ now.Unix }}">
{{- end }} {{- end }}
{{ with .OutputFormats.Get "RSS" -}} {{ with .OutputFormats.Get "RSS" -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s">` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }} {{ printf `<link rel="%s" type="%s" href="%s" title="%s">` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }}

View file

@ -2,14 +2,44 @@
<main> <main>
<article> <article>
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>
<b><time>{{ .Date.Format (default "2006-01-02 15:04:05" .Site.Params.dateFmt) }}</time></b> {{ if or .Date .Params.tags .Params.categories }}
{{ range .Params.tags }} <p>
<a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a> <b>
{{ end }} Posted
{{ if .Date }}
<div> on <time>{{ .Date.Format (default "2006-01-02 15:04:05" .Site.Params.dateFmt) }}</time>
{{ .Content }} {{ end }}
</div> {{ with .Params.categories }}
in
{{ range first 1 . }}
<a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
{{- end -}}
{{- range after 1 . -}}
, <a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
{{- end -}}
{{ end }}
</b>
{{ with .WordCount }}
• {{ . }} words
{{ end }}
{{ with .ReadingTime }}
• {{ . }} minute read
{{ end }}
{{ with .Params.tags }}
<br>
Tags:
{{ range first 1 . }}
<a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
{{- end -}}
{{- range after 1 . -}}
, <a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
{{- end -}}
{{ end }}
</p>
{{ end }}
<div>
{{ .Content }}
</div>
</article> </article>
</main> </main>
{{ partial "sidebar.html" . }} {{ partial "sidebar.html" . }}

View file

@ -3,5 +3,6 @@
{{- range .Site.Menus.footer }} {{- range .Site.Menus.footer }}
<a href="{{ .URL }}"><b>{{ .Name }}</b></a>. <a href="{{ .URL }}"><b>{{ .Name }}</b></a>.
{{- end }} {{- end }}
{{ with .OutputFormats.Get "RSS" }}<a href="{{ .RelPermalink }}"><b>RSS.</b></a>{{ end }}
</p> </p>
</footer> </footer>

View file

@ -1,11 +0,0 @@
html {overflow-y: scroll}
:root { --bgcolor: white; --fontcolor: #444; --linkcolor: #00e; --visitedcolor: #551a8b; --precolor: #fff; --prebgcolor: #000;}
@media (prefers-color-scheme: dark) { :root { --bgcolor: black; --fontcolor: white; --linkcolor: #5bf; --visitedcolor: #ae5ee0; --precolor: #fff; --prebgcolor: #383838;}}
body{max-width:800px;margin:40px auto;padding:0 10px;font:14px/1.5 monospace;color:var(--fontcolor); background: var(--bgcolor)}a:link{color: var(--linkcolor)}a:visited{color: var(--visitedcolor)}a:active{color: var(--visitedcolor)}h1,h2,h3{line-height:1.2}
p > code{color: var(--precolor); background: var(--prebgcolor); padding:2px}
pre{color: var(--precolor); background: var(--prebgcolor); padding:24px; overflow-x: auto}
article{padding:24px 0}
.center {display: block;margin-left: auto;margin-right: auto;width: 100%;}
img {display: block; max-width: 100%; height: auto;}
figcaption {color: #888; font: 12px/1.5 monospace; text-align: center;}
figure {margin: auto}