update some layouts

This commit is contained in:
loikein 2023-04-25 15:19:09 +01:00
parent 37e9cb786c
commit 9ef1d4b721
5 changed files with 38 additions and 30 deletions

View file

@ -19,10 +19,10 @@
{{ end }}
{{- range ($indexScratch.Get "sections").ByTitle -}}
<p><a href="{{ .RelPermalink }}">{{ .Title }}</a></p>
<p><a href="{{ .RelPermalink }}">{{ .Title }}{{- if .Draft -}} :: Draft {{- end -}}</a></p>
<ul>
{{- range .Pages.ByTitle -}}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
<li><a href="{{ .RelPermalink }}">{{ .Title }}{{- if .Draft -}} :: Draft {{- end -}}</a></li>
{{- end -}}
</ul>
{{- end -}}

View file

@ -7,11 +7,17 @@
{{ partial "content.header.html" . }}
{{ with .Content }}
<section>
{{ . }}
</section>
{{ end }}
<section class="list-page">
<ul>
{{ range .Pages.ByTitle }}
{{ if .IsPage }}
<li><a href="{{ .RelPermalink }}">{{.Title}}</a></li>
<li><a href="{{ .RelPermalink }}">{{ .Title }}{{- if .Draft -}} :: Draft {{- end -}}</a></li>
{{ end }}
{{ end }}
</ul>

View file

@ -7,11 +7,17 @@
{{ partial "content.header.html" . }}
{{ with .Content }}
<section>
{{ . }}
</section>
{{ end }}
<section class="list-page">
<ul>
{{ range .Pages.ByTitle }}
{{ if .IsSection }}
<li><a href="{{ .RelPermalink }}">{{.Title}}</a></li>
<li><a href="{{ .RelPermalink }}">{{ .Title }}{{- if .Draft -}} :: Draft {{- end -}}</a></li>
{{ end }}
{{ end }}
</ul>

View file

@ -7,9 +7,10 @@
</section>
{{ end }}
<section class="page-list">
{{ range (.Paginate .Site.RegularPages).Pages }}
{{/* range where .Site.RegularPages "Type" "posts" */}}
{{ if ne .Draft true}}
{{ $pgFilter1 := where .Site.RegularPages "Draft" false }}
{{ $pgFilter2 := where .Site.RegularPages "Params.date" "!=" nil }}
{{ $pgFilter := $pgFilter1 | intersect $pgFilter2 }}
{{ range (.Paginate $pgFilter).Pages }}
<h2 class="content-title">
{{ if .IsNode }}
<a href="{{ .Permalink }}">{{ .Title}}</a>
@ -23,8 +24,6 @@
{{ else }}
<p>{{ truncate 140 .Summary }}</p>
{{ end }}
{{ end }}
{{ end }}
</section>

View file

@ -2,14 +2,12 @@
<h1 class="content-title">
{{- .Title -}}{{- if .Draft -}} :: Draft {{- end -}}
</h1>
{{- if .Params.subtitle -}}
<p class=subtitle>{{ .Params.subtitle }}</p>
{{- end -}}
{{- if .IsPage -}}
{{- if .Params.subtitle -}}
<p class=subtitle>{{ .Params.subtitle }}</p>
{{- end -}}
{{- if .Params.meta -}}
<span class="content-meta">
{{- if and (.IsPage) (.Params.meta) -}}
<span class="content-meta">
{{- if .Params.author -}}
<p class="author">{{ .Params.author }}</p>
{{- end -}}
@ -25,7 +23,6 @@
{{- range .Params.tags -}}
<a href="{{ "/tags/" | absURL }}{{ . | urlize }}">{{ . }}</a>&nbsp;
{{- end -}}
</span>
{{- end -}}
</span>
{{- end -}}
</section>