Browse Source

simplify list and baseof; add keywords to baseof

master
Alexander Avery 9 months ago
parent
commit
4336a9b62f
  1. 37
      layouts/_default/baseof.html
  2. 15
      layouts/_default/list.html

37
layouts/_default/baseof.html

@ -3,28 +3,37 @@
<head>
<link rel="shortcut icon" href="/images/favicon.ico"/>
{{ with .OutputFormats.Get "rss" -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}}
{{ with .OutputFormats.Get "rss" }}
{{- printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML -}}
{{ end }}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="{{ .Params.description | default .Site.Params.Description }}">
{{ $style := resources.Get "/sass/main.scss" | resources.ToCSS }}
<link rel="stylesheet" href="{{ $style.Permalink }}" />
<title>
{{ block "title" . }} {{ .Site.Title }} {{ end }}
</title>
{{ if .Params.description -}}
<meta name="description" content="{{ .Params.description }}">
{{- end -}}
{{ if .Params.keywords -}}
<meta name="description" content="{{ delimit .Params.keywords "," }}">
{{- end }}
{{ $style := resources.Get "/sass/main.scss" | resources.ToCSS -}}
<link rel="stylesheet" href="{{ $style.Permalink }}" />
<title>
{{- block "title" . }}{{ .Site.Title }}{{ end -}}
</title>
</head>
<body>
{{ partial "header.html" . }}
{{ block "headline" . }}
{{ end }}
{{ partial "header.html" . }}
{{ block "main" . }}
{{ end }}
{{ partial "footer.html" . }}
{{ block "footer" . }}
{{ end }}
</body>
</html>

15
layouts/_default/list.html

@ -1,13 +1,22 @@
{{ define "main" }}
{{ $pages := .Site.RegularPages }}
{{if not .IsHome }}
<h1 class="center-text">{{ .Title | markdownify | lower }}</h1>
{{ $pages = .Pages }}
{{ end }}
{{ .Content }}
<section>{{ .Content }}</section>
<section class="article-list">
{{ $pages := .Pages }}
{{ range (where $pages "Section" "ne" "") }}
{{ range $pages }}
{{ partial "article-card.html" . }}
{{ end }}
</section>
{{ end }}

Loading…
Cancel
Save