forked from mirrors/hugo-tufte
update some layouts
This commit is contained in:
parent
37e9cb786c
commit
9ef1d4b721
5 changed files with 38 additions and 30 deletions
|
@ -19,10 +19,10 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{- range ($indexScratch.Get "sections").ByTitle -}}
|
{{- range ($indexScratch.Get "sections").ByTitle -}}
|
||||||
<p><a href="{{ .RelPermalink }}">{{ .Title }}</a></p>
|
<p><a href="{{ .RelPermalink }}">{{ .Title }}{{- if .Draft -}} :: Draft {{- end -}}</a></p>
|
||||||
<ul>
|
<ul>
|
||||||
{{- range .Pages.ByTitle -}}
|
{{- range .Pages.ByTitle -}}
|
||||||
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
<li><a href="{{ .RelPermalink }}">{{ .Title }}{{- if .Draft -}} :: Draft {{- end -}}</a></li>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</ul>
|
</ul>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
|
@ -7,11 +7,17 @@
|
||||||
|
|
||||||
{{ partial "content.header.html" . }}
|
{{ partial "content.header.html" . }}
|
||||||
|
|
||||||
|
{{ with .Content }}
|
||||||
|
<section>
|
||||||
|
{{ . }}
|
||||||
|
</section>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
<section class="list-page">
|
<section class="list-page">
|
||||||
<ul>
|
<ul>
|
||||||
{{ range .Pages.ByTitle }}
|
{{ range .Pages.ByTitle }}
|
||||||
{{ if .IsPage }}
|
{{ if .IsPage }}
|
||||||
<li><a href="{{ .RelPermalink }}">{{.Title}}</a></li>
|
<li><a href="{{ .RelPermalink }}">{{ .Title }}{{- if .Draft -}} :: Draft {{- end -}}</a></li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -7,11 +7,17 @@
|
||||||
|
|
||||||
{{ partial "content.header.html" . }}
|
{{ partial "content.header.html" . }}
|
||||||
|
|
||||||
|
{{ with .Content }}
|
||||||
|
<section>
|
||||||
|
{{ . }}
|
||||||
|
</section>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
<section class="list-page">
|
<section class="list-page">
|
||||||
<ul>
|
<ul>
|
||||||
{{ range .Pages.ByTitle }}
|
{{ range .Pages.ByTitle }}
|
||||||
{{ if .IsSection }}
|
{{ if .IsSection }}
|
||||||
<li><a href="{{ .RelPermalink }}">{{.Title}}</a></li>
|
<li><a href="{{ .RelPermalink }}">{{ .Title }}{{- if .Draft -}} :: Draft {{- end -}}</a></li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -7,9 +7,10 @@
|
||||||
</section>
|
</section>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<section class="page-list">
|
<section class="page-list">
|
||||||
{{ range (.Paginate .Site.RegularPages).Pages }}
|
{{ $pgFilter1 := where .Site.RegularPages "Draft" false }}
|
||||||
{{/* range where .Site.RegularPages "Type" "posts" */}}
|
{{ $pgFilter2 := where .Site.RegularPages "Params.date" "!=" nil }}
|
||||||
{{ if ne .Draft true}}
|
{{ $pgFilter := $pgFilter1 | intersect $pgFilter2 }}
|
||||||
|
{{ range (.Paginate $pgFilter).Pages }}
|
||||||
<h2 class="content-title">
|
<h2 class="content-title">
|
||||||
{{ if .IsNode }}
|
{{ if .IsNode }}
|
||||||
<a href="{{ .Permalink }}">{{ .Title}}</a>
|
<a href="{{ .Permalink }}">{{ .Title}}</a>
|
||||||
|
@ -23,8 +24,6 @@
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<p>{{ truncate 140 .Summary }}</p>
|
<p>{{ truncate 140 .Summary }}</p>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
|
@ -2,13 +2,11 @@
|
||||||
<h1 class="content-title">
|
<h1 class="content-title">
|
||||||
{{- .Title -}}{{- if .Draft -}} :: Draft {{- end -}}
|
{{- .Title -}}{{- if .Draft -}} :: Draft {{- end -}}
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
{{- if .IsPage -}}
|
|
||||||
{{- if .Params.subtitle -}}
|
{{- if .Params.subtitle -}}
|
||||||
<p class=subtitle>{{ .Params.subtitle }}</p>
|
<p class=subtitle>{{ .Params.subtitle }}</p>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- if .Params.meta -}}
|
{{- if and (.IsPage) (.Params.meta) -}}
|
||||||
<span class="content-meta">
|
<span class="content-meta">
|
||||||
{{- if .Params.author -}}
|
{{- if .Params.author -}}
|
||||||
<p class="author">{{ .Params.author }}</p>
|
<p class="author">{{ .Params.author }}</p>
|
||||||
|
@ -27,5 +25,4 @@
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</span>
|
</span>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
|
||||||
</section>
|
</section>
|
||||||
|
|
Loading…
Reference in a new issue