Taxonomies
This commit is contained in:
@@ -5,6 +5,11 @@ article.article-body {
|
|||||||
padding: var(--padding) 0;
|
padding: var(--padding) 0;
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
|
|
||||||
|
aside {
|
||||||
|
margin: var(--margin);
|
||||||
|
font-size: 1.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
.stat {
|
.stat {
|
||||||
max-width: var(--width-content-max);
|
max-width: var(--width-content-max);
|
||||||
margin: var(--margin) auto;
|
margin: var(--margin) auto;
|
||||||
|
|||||||
@@ -25,3 +25,4 @@
|
|||||||
@import "pagination.css";
|
@import "pagination.css";
|
||||||
@import "table-of-contents.css";
|
@import "table-of-contents.css";
|
||||||
@import "a.css";
|
@import "a.css";
|
||||||
|
@import "keywords.css";
|
||||||
12
themes/42/assets/css/keywords.css
Normal file
12
themes/42/assets/css/keywords.css
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
ul.keywords {
|
||||||
|
margin: var(--margin) auto;
|
||||||
|
padding-left: 0;
|
||||||
|
line-height: 150%;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: var(--gap-half);
|
||||||
|
list-style: none;
|
||||||
|
max-width: var(--width-content-max);
|
||||||
|
width: 100%;
|
||||||
|
font-size: 1rem;
|
||||||
|
}
|
||||||
@@ -1,14 +1,35 @@
|
|||||||
{{- $page := . -}}
|
{{- $page := . -}}
|
||||||
{{- with .Page -}}
|
{{- with .Page }}{{ $page = . }}{{ end -}}
|
||||||
{{- $page = . -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- if or $page.IsPage $page.IsSection -}}
|
|
||||||
{{- $trail := slice -}}
|
{{- $trail := slice -}}
|
||||||
|
{{- if $page }}
|
||||||
{{- range $page.Ancestors.Reverse -}}
|
{{- range $page.Ancestors.Reverse -}}
|
||||||
{{- if ne .RelPermalink "/" -}}
|
{{- if ne .RelPermalink "/" -}}
|
||||||
{{- $trail = $trail | append . -}}
|
{{- $trail = $trail | append . -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if eq $page.Kind "term" }}
|
||||||
|
{{- with site.GetPage "taxonomy" $page.Data.Plural }}
|
||||||
|
{{- range .Ancestors.Reverse -}}
|
||||||
|
{{- if ne .RelPermalink "/" -}}
|
||||||
|
{{- if not (in $trail .) -}}
|
||||||
|
{{- $trail = $trail | append . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if not (in $trail .) -}}
|
||||||
|
{{- $trail = $trail | append . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- else if and (eq $page.Kind "taxonomy") (eq (len $trail) 0) }}
|
||||||
|
{{- with site.Home }}
|
||||||
|
{{- if ne .RelPermalink "/" -}}
|
||||||
|
{{- $trail = $trail | append . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{- if gt (len $trail) 0 -}}
|
{{- if gt (len $trail) 0 -}}
|
||||||
<nav class="breadcrumbs" aria-label="Fil d’Ariane">
|
<nav class="breadcrumbs" aria-label="Fil d’Ariane">
|
||||||
{{- range $item := $trail -}}
|
{{- range $item := $trail -}}
|
||||||
@@ -16,4 +37,3 @@
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
</nav>
|
</nav>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<header id="hero-page" class="panel-hero">
|
<header id="hero-page" class="panel panel-hero">
|
||||||
{{ partialCached "site-title.html" . }}
|
{{ partialCached "site-title.html" . }}
|
||||||
<div class="page-meta">
|
<div class="page-meta">
|
||||||
{{ partial "breadcrumbs.html" . }}
|
{{ partial "breadcrumbs.html" . }}
|
||||||
|
|||||||
13
themes/42/layouts/_partials/keywords.html
Normal file
13
themes/42/layouts/_partials/keywords.html
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{{- $items := . -}}
|
||||||
|
{{- if gt (len $items) 0 -}}
|
||||||
|
<ul class="keywords">
|
||||||
|
{{- range $items }}
|
||||||
|
{{- $type := printf "%T" . -}}
|
||||||
|
{{- if or (strings.HasPrefix $type "*hugolib.") (strings.HasPrefix $type "page.") }}
|
||||||
|
<li><a href="{{ .RelPermalink }}">{{ with .LinkTitle }}{{ . }}{{ else }}{{ .Title }}{{ end }}</a></li>
|
||||||
|
{{- else }}
|
||||||
|
<li>{{ . }}</li>
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
</ul>
|
||||||
|
{{- end }}
|
||||||
@@ -25,6 +25,8 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
|
|
||||||
|
{{- partial "asides/keywords.html" . }}
|
||||||
</article>
|
</article>
|
||||||
</main>
|
</main>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
<h1>{{ .Title }}</h1>
|
{{ partial "hero-section.html" . }}
|
||||||
|
<main>
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
{{ range .Pages }}
|
|
||||||
<h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
|
{{- with .Pages }}
|
||||||
{{ end }}
|
{{- partial "keywords.html" (.ByTitle) }}
|
||||||
|
{{- end }}
|
||||||
|
</main>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
<h1>{{ .Title }}</h1>
|
{{ partial "hero-section.html" . }}
|
||||||
|
<main>
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
{{ range .Pages }}
|
|
||||||
<h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
|
{{- partial "articles-list.html" (dict "Pages" .Pages.ByDate.Reverse "Context" .) -}}
|
||||||
{{ end }}
|
</main>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
Reference in New Issue
Block a user