mirror of
https://github.com/loikein/hugo-tufte.git
synced 2025-08-07 19:52:45 +02:00
update layouts: draft tag; remove redundant code
This commit is contained in:
parent
1dc5f0c3d3
commit
46406fda64
5 changed files with 21 additions and 25 deletions
layouts/book
|
@ -14,26 +14,21 @@
|
|||
<section class="list-page">
|
||||
<!-- preambles -->
|
||||
|
||||
{{- if .RegularPages -}}
|
||||
<ul>
|
||||
{{ range .Pages.ByTitle }}
|
||||
{{ if .IsPage }}
|
||||
<li><a href="{{ .RelPermalink }}">{{ .Title }}{{- if .Draft -}} :: Draft {{- end -}}</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ range .RegularPages.ByTitle -}}
|
||||
<li><a href="{{ .RelPermalink }}">{{ .Title }}{{- if .Draft -}} :: Draft{{- end -}}</a></li>
|
||||
{{ end -}}
|
||||
</ul>
|
||||
{{- end -}}
|
||||
|
||||
<!-- sub categories & pages -->
|
||||
|
||||
{{ $indexScratch := .Scratch }}
|
||||
{{ range .Sections }}
|
||||
{{ $indexScratch.Add "sections" (slice . ) }}
|
||||
{{ end }}
|
||||
|
||||
{{- range ($indexScratch.Get "sections").ByTitle -}}
|
||||
<p><a href="{{ .RelPermalink }}">{{ .Title }}{{- if .Draft -}} :: Draft {{- end -}}</a></p>
|
||||
{{- range .Sections.ByTitle -}}
|
||||
<p><a href="{{ .RelPermalink }}">{{ .Title }}{{- if .Draft -}} :: Draft{{- end -}}</a></p>
|
||||
<ul>
|
||||
{{- range .Pages.ByTitle -}}
|
||||
<li><a href="{{ .RelPermalink }}">{{ .Title }}{{- if .Draft -}} :: Draft {{- end -}}</a></li>
|
||||
{{- range .RegularPages.ByTitle -}}
|
||||
<li><a href="{{ .RelPermalink }}">{{ .Title }}{{- if .Draft -}} :: Draft{{- end -}}</a></li>
|
||||
{{- end -}}
|
||||
</ul>
|
||||
{{- end -}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue