WIP: dark theme

This commit is contained in:
Dmitry Kolosov 2020-06-21 23:23:07 +03:00
parent 193fbeca7c
commit 32818dacf1
9 changed files with 279 additions and 59 deletions

View file

@ -8,7 +8,7 @@
<body>
<a class="skip-main" href="#main">{{ i18n "skipToContent" | humanize }}</a>
<div class="container">
<header>
<header class="common-header">
{{ block "header" . }}
{{ partial "header.html" . }}
{{ end }}

View file

@ -7,7 +7,7 @@
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
{{ range $pages }}
<div class="post-short-list">
<header>
<header class="post-header">
<h2 class="post-title{{ if .Params.favorite }} favorite{{end}}{{ if .Params.draft }} draft{{end}}"><a href="{{ .RelPermalink }}">{{ trim .Title " " }}</a></h2>
</header>
{{ partial "postInfo.html" . }}

View file

@ -8,7 +8,7 @@
{{ end }}
<article class="post">
<header>
<header class="post-header">
<h1 class="post-title{{ if .Params.favorite }} favorite{{end}}{{ if .Params.draft }} draft{{end}}">{{ trim .Title " " }}</h1>
</header>
<div class="content">

View file

@ -16,6 +16,17 @@
<link rel="stylesheet" href="{{ "css/style.css" | absURL }}?rnd={{ now.Unix }}" />
{{- $style := "light" -}}
{{- if and (isset site.Params "style") (ne site.Params.style "") -}}
{{- $style = site.Params.style | lower -}}
{{- end -}}
{{- if eq $style "dark" -}}
<link rel="stylesheet" href="{{ "css/dark.css" | absURL }}?rnd={{ now.Unix }}" />
{{- else -}}
<link rel="stylesheet" href="{{ "css/light.css" | absURL }}?rnd={{ now.Unix }}" />
{{- end -}}
{{ range .Site.Params.customCSS -}}
<link rel="stylesheet" href="{{ . | absURL }}?rnd={{ now.Unix }}">
{{- end }}

View file

@ -1,4 +1,4 @@
<h1 class="site-header">
<h1 class="site-title">
<a href="{{ .Site.BaseURL | relLangURL }}">{{ .Site.Title }}</a>
</h1>
<nav>

View file

@ -1,5 +1,5 @@
<article class="post-list">
<header>
<header class="post-header">
<h1 class="post-title{{ if .Params.favorite }} favorite{{end}}{{ if .Params.draft }} draft{{end}}"><a href="{{ .RelPermalink }}">{{ trim .Title " " }}</a></h1>
</header>