all repos — archie @ d0b426c3fa6acdc8cdb4a42d23b59544ee3b4691

A minimal Hugo Theme

Fix html errors.
Sergey Trofimov sarg@sarg.org.ru
Wed, 22 Apr 2020 12:14:28 +0200
commit

d0b426c3fa6acdc8cdb4a42d23b59544ee3b4691

parent

bbf6c6513d2ddb24a24f8bc64d2946ce08277bf4

M layouts/_default/baseof.htmllayouts/_default/baseof.html

@@ -1,11 +1,11 @@

<!DOCTYPE html> <html> - {{- partial "head.html" . -}} + {{- partial "header.html" . -}} <body> - {{- partial "header.html" . -}} - <div id="content"> + <div class="content"> + {{- partial "head.html" . -}} {{- block "main" . }}{{- end }} - </div> {{- partial "footer.html" . -}} + </div> </body> </html>
M layouts/_default/list.htmllayouts/_default/list.html

@@ -1,31 +1,17 @@

-<!DOCTYPE html> -<html> -{{ partial "header.html" . }} - -<body> - <div class="container wrapper list"> - {{ partial "head.html" . }} - - {{ if isset .Data "Term" }} - <h1>Entries tagged - "{{ .Data.Term }}"</h1> - {{ else }} - <h1 class="page-title">All articles</h1> - {{ end }} - - <ul class="posts"> - {{- range .Data.Pages -}} - {{- if (in (.Site.Params.excludedTypes | default (slice "page")) .Type) -}} - {{- else -}} - <li class="post"> - <a href="{{ .RelPermalink }}">{{.Title}}</a> <span class="meta">{{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</span> - </li> - {{- end -}} - {{- end -}} - </ul> - {{ partial "footer.html" . }} - </div> +{{ define "main" }} +{{ if isset .Data "Term" }} +<h1>Entries tagged - "{{ .Data.Term }}"</h1> +{{ else }} +<h1 class="page-title">All articles</h1> +{{ end }} - -</body> - -</html> +<ul class="posts"> + {{- range .Data.Pages -}} + {{- if (not (in (.Site.Params.excludedTypes | default (slice "page")) .Type)) -}} + <li class="post"> + <a href="{{ .RelPermalink }}">{{.Title}}</a> <span class="meta">{{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</span> + </li> + {{- end -}} + {{- end -}} +</ul> +{{ end }}
M layouts/_default/single.htmllayouts/_default/single.html

@@ -1,22 +1,15 @@

-<!DOCTYPE html> -<html> -{{ partial "header.html" . }} -<body> - <div class="content"> - {{ partial "head.html" . }} +{{ define "main" }} <main> -<article> + <article> <div class="title"> <h1 class="title">{{ .Title }}</h1> <div class="meta">Posted on {{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</div> </div> - <div> - {{ if isset .Params "tldr" }} - <div class="tldr"> - <strong>tl;dr:</strong> - {{ .Params.tldr }} - </div>{{ end }} - </div> + {{ if isset .Params "tldr" }} + <div class="tldr"> + <strong>tl;dr:</strong> + {{ .Params.tldr }} + </div>{{ end }} <section class="body"> {{ .Content }}

@@ -24,20 +17,17 @@ </section>

<div class="post-tags"> {{ if ne .Type "page" }} - {{ if gt .Params.tags 0 }} - <nav class="nav tags"> - <ul class="tags"> - {{ range .Params.tags }} - <li><a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a></li> - {{ end }} - </ul> - </nav> - {{ end }} + {{ if gt .Params.tags 0 }} + <nav class="nav tags"> + <ul class="tags"> + {{ range .Params.tags }} + <li><a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a></li> + {{ end }} + </ul> + </nav> + {{ end }} {{ end }} </div> - - - {{ partial "footer.html" . }} - </div> -</body> -</html> + </article> +</main> +{{ end }}
M layouts/_default/terms.htmllayouts/_default/terms.html

@@ -1,31 +1,20 @@

-<!DOCTYPE html> -<html> -{{ partial "header.html" . }} +{{ define "main" }} +<h1 class="page-title">All tags</h1> -<body> - <div class="container wrapper tags"> - {{ partial "head.html" . }} - - <h1 class="page-title">All tags</h1> +{{ $biggest := 1 }} +{{ $smallest := 1 }} +{{ $max := 3 }} +{{ $min := 1 }} +{{ $size := $min }} - {{ $biggest := 1 }} - {{ $smallest := 1 }} - {{ $max := 3 }} - {{ $min := 1 }} - {{ $size := $min }} - - {{ $data := .Data }} - <div class="tag-cloud"> - <ul> +{{ $data := .Data }} +<div class="tag-cloud"> + <ul class="tags"> {{ range $key, $value := .Data.Terms.ByCount }} - {{ $size := (add (mul (div $value.Count $biggest) (sub $max $min)) $min) }} - {{ $size := (cond (eq $biggest $smallest) $min $size) }} - <li><a style="font-size: {{ $size }}rem;" href="{{ $.Site.LanguagePrefix | absURL }}{{ $data.Plural }}/{{ $value.Name | urlize }}/">{{ $value.Name }}</a></li> + {{ $size := (add (mul (div $value.Count $biggest) (sub $max $min)) $min) }} + {{ $size := (cond (eq $biggest $smallest) $min $size) }} + <li><a style="font-size: {{ $size }}rem;" href="{{ $.Site.LanguagePrefix | absURL }}{{ $data.Plural }}/{{ $value.Name | urlize }}/">{{ $value.Name }}</a></li> {{ end }} - </ul> - </div> - {{ partial "footer.html" . }} - </div> -</body> - -</html> + </ul> +</div> +{{ end }}
M layouts/index.htmllayouts/index.html

@@ -1,28 +1,29 @@

<!DOCTYPE html> <html> -{{ partial "header.html" . }} -<body> - {{ partial "head.html" . }} - + {{ partial "header.html" . }} + <body> + <div class="content"> + {{ partial "head.html" . }} + <main class="list"> - <div class="site-description"> - {{- if isset .Site.Params "subtitle" -}} - <p>{{ .Site.Params.Subtitle | markdownify }}</p> - {{- end -}} - </div> + <div class="site-description"> + {{- if isset .Site.Params "subtitle" -}} + <p>{{ .Site.Params.Subtitle | markdownify }}</p> + {{- end -}} + </div> {{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} {{ $paginator := .Paginate (where $pages "Params.hidden" "ne" true) }} {{ range $paginator.Pages }} <section class="list-item"> <h1 class="title"><a href="{{ .RelPermalink }}">{{.Title}}</a></h1> <time>{{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</time> - <br><span class="description"> + <br><div class="description"> {{ if isset .Params "description" }} {{ .Description }} {{ else }} {{ .Summary }}&hellip; {{ end }} - </span><br/> + </div> <a href="{{ .RelPermalink }}">Read more ⟶</a> </section> {{ end }}

@@ -31,7 +32,5 @@ </main>

{{ partial "footer.html" . }} </div> - </div> - -</body> -</html>+ </body> +</html>
M layouts/partials/footer.htmllayouts/partials/footer.html

@@ -8,7 +8,10 @@ </footer>

{{ if not .Site.IsServer }} {{ template "_internal/google_analytics_async.html" . }} {{ end }} + +{{- if (isset .Site.Params "social") -}} <script> feather.replace() </script> +{{- end }}
M layouts/partials/head.htmllayouts/partials/head.html

@@ -1,11 +1,10 @@

-<div class="content"> <header> -<div class="main"> - <a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a> -</div> -<nav> - {{ range .Site.Menus.main }} - <a href="{{ .URL }}">{{ .Name }}</a> - {{ end }} -</nav> -</header>+ <div class="main"> + <a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a> + </div> + <nav> + {{ range .Site.Menus.main }} + <a href="{{ .URL }}">{{ .Name }}</a> + {{ end }} + </nav> +</header>