clean structure of layouts/ and add support for taxonomys
This commit is contained in:
parent
550b0f47b7
commit
10130c4963
@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ $.Site.LanguageCode }}" class="han-init">
|
||||
<html lang="{{ $.Site.LanguageCode }}" class="{{- if $.Site.Params.hasCJKLanguage -}} {{- "han-init" -}} {{- end -}}">
|
||||
{{- partial "head.html" . -}}
|
||||
<body a="{{ $.Site.Params.theme_config.appearance | default "auto" }}">
|
||||
<main class="page-content" aria-label="Content">
|
||||
|
8
layouts/_default/taxonomy.html
Normal file
8
layouts/_default/taxonomy.html
Normal file
@ -0,0 +1,8 @@
|
||||
{{ define "main" }}
|
||||
{{ partial "back_link.html" .}}
|
||||
|
||||
<h1>{{ .Title }}</h1>
|
||||
|
||||
{{ .Content }}
|
||||
{{ partial "post_list.html" (dict "context" .)}}
|
||||
{{ end }}
|
8
layouts/_default/term.html
Normal file
8
layouts/_default/term.html
Normal file
@ -0,0 +1,8 @@
|
||||
{{ define "main" }}
|
||||
{{ partial "back_link.html" .}}
|
||||
|
||||
<h1>{{ .Title }}</h1>
|
||||
|
||||
{{ .Content }}
|
||||
{{ partial "post_list.html" (dict "context" .)}}
|
||||
{{ end }}
|
@ -1,13 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ $.Site.LanguageCode }}" class="han-init">
|
||||
{{- partial "head.html" . -}}
|
||||
<body a="{{ $.Site.Params.theme_config.appearance | default "auto" }}">
|
||||
<main class="page-content" aria-label="Content">
|
||||
<div class="w">
|
||||
{{- block "main" . }}{{- end }}
|
||||
|
||||
</div>
|
||||
</main>
|
||||
<script src="https://cdn.jsdelivr.net/npm/han-css@3/dist/han.min.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -8,6 +8,10 @@
|
||||
{{- end -}}
|
||||
</li>
|
||||
|
||||
{{- if $item.entries }}
|
||||
{{ partial "menu_item.html" (dict "context" . "collection" $item.entries) }}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $item.post_list -}}
|
||||
{{ partial "post_list.html" (dict
|
||||
"context" .
|
||||
@ -18,9 +22,5 @@
|
||||
"show_more_url" $item.post_list.show_more_url
|
||||
) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $item.entries }}
|
||||
{{ partial "menu_item.html" (dict "context" . "collection" $item.entries) }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</ul>
|
@ -3,7 +3,15 @@
|
||||
{{- if .section -}}
|
||||
{{- $posts = (where site.RegularPages "Section" .section) -}}
|
||||
{{- else -}}
|
||||
{{- $posts = site.RegularPages }}
|
||||
{{- if (eq .context.Kind "taxonomy") -}}
|
||||
{{- $posts = .context.Pages -}}
|
||||
{{- else -}}
|
||||
{{- if (eq .context.Kind "term") -}}
|
||||
{{- $posts = .context.Data.Pages -}}
|
||||
{{- else -}}
|
||||
{{- $posts = site.RegularPages }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $limit_exceeded:= "" -}}
|
||||
|
@ -1,13 +0,0 @@
|
||||
{{ if .IsNamedParams }}
|
||||
{{ with .Get "text" }}
|
||||
<hr data-content='{{ . }}' />
|
||||
{{ else }}
|
||||
<hr />
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ with .Get 0 }}
|
||||
<hr data-content="{{ . }}" />
|
||||
{{ else }}
|
||||
<hr />
|
||||
{{ end }}
|
||||
{{ end }}
|
Loading…
x
Reference in New Issue
Block a user