update layouts: draft tag; remove redundant code

This commit is contained in:
loikein 2023-05-25 12:03:42 +01:00
commit 46406fda64
5 changed files with 21 additions and 25 deletions
layouts/book

View file

@ -15,23 +15,24 @@
<!-- preambles -->
{{- if .RegularPages -}}
<ul>
{{ range .Pages.ByTitle }}
{{ if .IsPage }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}{{- if .Draft -}} :: Draft {{- end -}}</a></li>
{{ end }}
{{ range .RegularPages.ByTitle }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}{{- if .Draft -}}&nbsp;:: Draft{{- end -}}</a></li>
{{ end }}
</ul>
{{- end -}}
<!-- sub categories -->
{{- if .Sections -}}
<ul>
{{ range .Pages.ByTitle }}
{{ if .IsSection }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}{{- if .Draft -}} :: Draft {{- end -}}</a></li>
{{ end }}
{{ range .Sections.ByTitle }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}{{- if .Draft -}}&nbsp;:: Draft{{- end -}}</a></li>
{{ end }}
</ul>
{{- end -}}
</section>
{{ partial "footer.html" . }}