Browse Source

format _default layouts

master
Alexander Avery 3 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" }}
{{if not .IsHome }}
<h1 class="center-text">{{ .Title | markdownify | lower }}</h1>
{{ end }}
{{ .Content }}
<section class="article-list">
{{if not .IsHome }}
<h1 class="center-text">{{ .Title | markdownify | lower }}</h1>
{{ end }}
{{ .Content }}
<section class="article-list">
{{ $pages := .Pages }}
{{ if .IsHome }}{{ $pages = where .Site.RegularPages "Type" "not in" (default "[]" .Site.Params.excludedSections) }}{{ end }}
{{ range (where $pages "Section" "ne" "") }}
{{ partial "article-card.html" . }}
{{ partial "article-card.html" . }}
{{ end }}
</section>
</section>
{{ end }}

30
layouts/_default/single.html

@ -1,25 +1,27 @@
{{ 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 }}
<p>
{{ with .NextInSection }}
{{ with .NextInSection }}
<b>Next: </b><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
<br>
{{ end }}
{{ with .PrevInSection }}
{{ end }}
{{ with .PrevInSection }}
<b>Previous: </b><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
<br>
{{ end }}
{{ end }}
<b><a href="/"> >> Home</a></b>
</p>
</main>
</div>
</p>
</main>
{{ end }}

Loading…
Cancel
Save