mirror of
https://github.com/loikein/hugo-tufte.git
synced 2024-11-16 21:36:56 +01:00
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,30 +2,27 @@
|
||||||
<h1 class="content-title">
|
<h1 class="content-title">
|
||||||
{{- .Title -}}{{- if .Draft -}} :: Draft {{- end -}}
|
{{- .Title -}}{{- if .Draft -}} :: Draft {{- end -}}
|
||||||
</h1>
|
</h1>
|
||||||
|
{{- if .Params.subtitle -}}
|
||||||
|
<p class=subtitle>{{ .Params.subtitle }}</p>
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
{{- if .IsPage -}}
|
{{- if and (.IsPage) (.Params.meta) -}}
|
||||||
{{- if .Params.subtitle -}}
|
<span class="content-meta">
|
||||||
<p class=subtitle>{{ .Params.subtitle }}</p>
|
{{- if .Params.author -}}
|
||||||
|
<p class="author">{{ .Params.author }}</p>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- if .Params.meta -}}
|
{{- if not .Params.hidedate -}}
|
||||||
<span class="content-meta">
|
<p class="date">{{ .Date.Format "2006-01-02" }}</p>
|
||||||
{{- if .Params.author -}}
|
|
||||||
<p class="author">{{ .Params.author }}</p>
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{- if not .Params.hidedate -}}
|
|
||||||
<p class="date">{{ .Date.Format "2006-01-02" }}</p>
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{- if not .Params.hidereadtime -}}
|
|
||||||
<span>{{ .ReadingTime }} min read </span>
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{- range .Params.tags -}}
|
|
||||||
<a href="{{ "/tags/" | absURL }}{{ . | urlize }}">{{ . }}</a>
|
|
||||||
{{- end -}}
|
|
||||||
</span>
|
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if not .Params.hidereadtime -}}
|
||||||
|
<span>{{ .ReadingTime }} min read </span>
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- range .Params.tags -}}
|
||||||
|
<a href="{{ "/tags/" | absURL }}{{ . | urlize }}">{{ . }}</a>
|
||||||
|
{{- end -}}
|
||||||
|
</span>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</section>
|
</section>
|
||||||
|
|
Loading…
Reference in a new issue