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 }}
|
||||
|
||||
{{- 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 -}}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -2,30 +2,27 @@
|
|||
<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>
|
||||
{{- if and (.IsPage) (.Params.meta) -}}
|
||||
<span class="content-meta">
|
||||
{{- if .Params.author -}}
|
||||
<p class="author">{{ .Params.author }}</p>
|
||||
{{- end -}}
|
||||
|
||||
{{- if .Params.meta -}}
|
||||
<span class="content-meta">
|
||||
{{- 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>
|
||||
{{- 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 -}}
|
||||
</section>
|
||||
|
|
Loading…
Reference in a new issue