Update layouts from slick.

This commit is contained in:
tastytea 2020-12-28 20:12:36 +01:00
parent 98869cc875
commit 1a48905b01
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
7 changed files with 73 additions and 45 deletions

View File

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode | default "en" }}">
<html lang="{{ default "en" .Site.LanguageCode }}">
<head>
<meta charset="utf-8" />
<title>{{ if and (.Title) (not (eq .Title .Site.Title)) }}{{ .Title }} | {{ end }}{{ .Site.Title }}</title>
@ -10,13 +10,26 @@
{{ if .Site.Params.schema }}{{ template "_internal/schema.html" . }}{{ end -}}
{{ if .Site.Params.twitter_cards }}{{ template "_internal/twitter_cards.html" . }}{{ end -}}
{{ .Hugo.Generator }}
{{- with .Site.RSSLink }}
<link href="{{ . }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }} Feed" />
{{- with .Site.Home.OutputFormats.Get "RSS" }}
{{- $rssLink := .RelPermalink }}
<link href="{{ $rssLink }}" rel="{{ .Rel }}" type="application/rss+xml" title="{{ $.Site.Title }} Feed" />
{{- with $.Page.OutputFormats.Get "RSS" }}
{{- if ne $rssLink .RelPermalink }}
<link href="{{ .RelPermalink }}" rel="{{ .Rel }}" type="application/rss+xml" title="{{ $.Site.Title }} {{ $.Title }} Feed" />
{{- end }}
{{- end }}
{{- end }}
{{- $favicon := .Site.Params.favicon | default "favicon.ico" }}
{{- $favtype := cond (eq (path.Ext $favicon) ".png") "image/png" "image/x-icon" }}
<link rel="shortcut icon" href="{{ .Site.BaseURL }}{{ $favicon }}" type="{{ $favtype }}" />
<link rel="stylesheet" href="{{ .Site.BaseURL }}assets/nocolor.css" />
{{- with .Site.Params.favicon | default "favicon.ico" }}
{{- if resources.Get . }}
{{- $favicon := resources.Get . | resources.Fingerprint }}
<link rel="shortcut icon" href="{{ $favicon.RelPermalink }}" type="{{ $favicon.MediaType }}" />
{{- else if fileExists (path.Join "static" .) }}
{{- $favtype := cond (eq (path.Ext .) ".png") "image/png" "image/x-icon" }}
<link rel="shortcut icon" href="{{ $.Site.BaseURL }}{{ . }}" type="{{ $favtype }}" />
{{- end }}
{{- end }}
{{- $style := resources.Get "nocolor.css" }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}" />
{{- with .Site.Params.css }}
{{- if resources.Get . }}
{{- $styleCustom := resources.Get . | resources.Fingerprint }}

View File

@ -6,7 +6,7 @@
<li>
<div class="post-title">
{{- if .Draft }}DRAFT: {{ end }}
<a href="{{ .Permalink }}">{{ .Title }}</a>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
</div>
{{ partial "post_meta.html" . }}
</li>

View File

@ -7,16 +7,16 @@
{{- end -}}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
<generator>Hugo {{ .Hugo.Version }} -- gohugo.io</generator>
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ .Site.Title }}</description>
<generator>Hugo {{ hugo.Version }} -- gohugo.io</generator>
{{- with .Site.LanguageCode }}
<language>{{ . }}</language>
{{- end }}
{{- with .Site.Author.email }}
<managingEditor>{{ . }}{{ with $.Site.Author.name }} ({{ . }}){{ end }}</managingEditor>
<webMaster>{{ . }}{{ with $.Site.Author.name }} ({{ . }}){{end}}</webMaster>
<webMaster>{{ . }}{{ with $.Site.Author.name }} ({{ . }}){{ end }}</webMaster>
{{- end }}
{{- with .Site.Copyright }}
<copyright>{{ . }}</copyright>
@ -27,16 +27,16 @@
{{- with .OutputFormats.Get "RSS" }}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{- end }}
{{ range $pages }}
{{- range $pages }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{- with .Site.Author.email }}
<author>{{.}}{{ with $.Site.Author.name }} ({{ . }}){{ end }}</author>
<author>{{ . }}{{ with $.Site.Author.name }} ({{ . }}){{ end }}</author>
{{- end }}
<guid>{{ .Permalink }}</guid>
<description>{{- .Content | html -}}</description>
<guid isPermaLink="true">{{ .Permalink }}</guid>
<description>{{ .Content | html }}</description>
</item>
{{- end }}
</channel>

View File

@ -2,15 +2,14 @@
<div>
<p>{{ .Title }}:</p>
<ul>
{{- $type := .Type }}
{{- range $.Data.Terms.ByCount }}
{{- $count := .Count }}
{{- with $.Site.GetPage (lower (printf "/%s/%s" $type (urlize .Name))) }}
{{- range .Data.Terms.ByCount }}
{{ $count := .Count }}
{{- with $.GetPage (lower .Name) }}
<li>
<a href="{{ .Permalink }}">{{ .Name }}</a>
<a href="{{ .RelPermalink }}"{{ if .Title }} title="{{ .Title }}"{{ end }}>{{ .Name }}</a>
<span>&#40;{{ $count }}&#41;</span>
</li>
{{- end }}
{{- end }}
{{- end }}
</ul>
</div>

View File

@ -1,18 +1,19 @@
{{- define "main" }}
{{ $showfull := cond (isset $.Site.Params "showfullcontent") $.Site.Params.showfullcontent false }}
{{- range $idx, $_ := .Paginator.Pages }}
<p {{ if and $showfull $idx }}class="post-divider"{{ end }}>
{{- $showfull := default false $.Site.Params.showFullContent }}
{{- $pagepool := where $.Site.RegularPages "Type" "in" $.Site.Params.mainSections }}
{{- range $idx, $_ := (.Paginate $pagepool).Pages }}
<div{{ if and $showfull $idx }} class="post-divider"{{ end }}>
<div>
<h2 class="post-title">
{{ if .Draft }}DRAFT: {{ end }}
<a href="{{ .Permalink }}">{{ .Title }}</a>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
</h2>
{{ partial "post_meta.html" . }}
</div>
<div>
{{ cond $showfull .Content .Summary }}
</div>
</p>
</div>
{{- end }}
{{ partial "pagination.html" . }}
{{- end }}

View File

@ -10,16 +10,16 @@
{{- end }}
</li>
{{- end }}
{{- with .Site.RSSLink }}
{{- with .Site.Home.OutputFormats.Get "RSS" }}
<li>
<a href="{{ . }}">RSS</a>
<a href="{{ .RelPermalink }}">RSS</a>
</li>
{{- end }}
</ul>
</div>
{{- with .Site.Copyright }}
<div class="copyright">
&copy; {{ now.Format "2006" }} &mdash; {{ . }}
{{ . }}
</div>
{{- end }}
</div>

View File

@ -1,20 +1,35 @@
{{- $showdate := default (default true $.Site.Params.showMetaDates) .Params.showmetadates }}
{{- $showlink := default (default true $.Site.Params.showMetaLinks) .Params.showmetalinks }}
{{- if or $showdate $showlink }}
<div class="post-meta">
{{- if $showdate }}
<span>Date:</span>
<time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
{{- .Date.Format (cond (isset $.Site.Params "datefmt") $.Site.Params.datefmt "01-02-2006") -}}
{{- .Date.Format (default "01-02-2006" .Site.Params.dateFmt) -}}
</time>;
{{- if ne .Date .Lastmod }}
<span>Last modified:</span> &#x5b;
<time datetime="{{- .Lastmod.Format "2006-01-02T15:04:05Z07:00" -}}">
{{ .Lastmod.Format (default "01-02-2006" .Site.Params.dateFmt) }}
</time>;
{{- end }} <!-- if ne .Date .Lastmod -->
{{- end }} <!-- if $showdate -->
{{- range $taxo := (slice "Categories" "Series" "Tags") }}
{{- $elems := $.Param $taxo }}
{{- if $elems }}
<span class="{{ (lower $taxo) }}">
{{ $taxo }}: &#x5b;
{{- range $name := $elems }}
{{- with $.Site.GetPage (lower (printf "/%s/%s" $taxo (urlize $name))) }}
<a href="{{ .Permalink }}">{{ $name }}</a>
{{- end }}
{{- end }}
&#x5d;
</span>
{{- end }}
{{- end }}
{{- if $showlink }}
{{- $fallback := slice (dict "Identifier" "Categories") (dict "Identifier" "Series") (dict "Identifier" "Tags") }}
{{- range default $fallback .Site.Menus.meta }}
{{- $taxo := $.Param .Identifier }}
{{- if $taxo }}
{{ $name := default .Identifier .Name }}
{{ $link := default .Identifier .URL }}
<span{{ if .Title }} title="{{ .Title }}"{{ end }}>{{ $name }}:</span> &#x5b;
{{- range $taxo }}
{{- $perma := lower (path.Join $link (urlize .)) }}
<a href="{{ $perma | relURL }}">{{ . }}</a>
{{- end }} <!-- range $taxo -->
&#x5d;
{{- end }} <!-- if $taxo -->
{{- end }} <!-- range default $fallback .Site.Menus.meta -->
{{- end }} <!-- - if $showlink -->
</div>
{{- end }} <!-- if or $showdate $showlink -->