Browse Source

format _default layouts

master
Alexander Avery 9 months ago
parent
commit
023853a575
  1. 14
      layouts/_default/list.html
  2. 30
      layouts/_default/single.html

14
layouts/_default/list.html

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

30
layouts/_default/single.html

@ -1,25 +1,27 @@
{{ define "main" }} {{ define "main" }}
<main>
{{ partial "article-meta.html" . }}
{{ partial "article-meta.html" . }} {{ if .Params.toc }}
{{ .TableOfContents }}
{{ end }}
{{ if .Params.toc }}
{{ .TableOfContents }}
{{ end }}
<div class="content-wrapper">
<main>
{{ .Content }} {{ .Content }}
<p> <p>
{{ with .NextInSection }}
{{ with .NextInSection }}
<b>Next: </b><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> <b>Next: </b><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
<br> <br>
{{ end }} {{ end }}
{{ with .PrevInSection }}
{{ with .PrevInSection }}
<b>Previous: </b><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> <b>Previous: </b><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
<br> <br>
{{ end }} {{ end }}
<b><a href="/"> >> Home</a></b> <b><a href="/"> >> Home</a></b>
</p> </p>
</main>
</div> </main>
{{ end }} {{ end }}

Loading…
Cancel
Save