Rétablit les asides d'article du thème 2026
This commit is contained in:
12
themes/2026/layouts/_partials/article-asides.html
Normal file
12
themes/2026/layouts/_partials/article-asides.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{{- $commentsMarkup := strings.TrimSpace (partial "asides/comments.html" .) -}}
|
||||
{{- $keywordsMarkup := strings.TrimSpace (partial "asides/keywords.html" .) -}}
|
||||
{{- if or (ne $commentsMarkup "") (ne $keywordsMarkup "") -}}
|
||||
<section class="article-asides">
|
||||
{{- with $commentsMarkup -}}
|
||||
{{- . | safeHTML -}}
|
||||
{{- end -}}
|
||||
{{- with $keywordsMarkup -}}
|
||||
{{- . | safeHTML -}}
|
||||
{{- end -}}
|
||||
</section>
|
||||
{{- end -}}
|
||||
12
themes/2026/layouts/_partials/article-books.html
Normal file
12
themes/2026/layouts/_partials/article-books.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{{- $booksMarkup := strings.TrimSpace (partial "asides/oeuvres.html" .) -}}
|
||||
{{- if ne $booksMarkup "" -}}
|
||||
<section class="article-books">
|
||||
<header>
|
||||
<h2>Mes livres</h2>
|
||||
<p>Si vous aimez ce blog, vous apprécierez mes livres. En les achetant, vous m'aidez à continuer de le faire vivre.</p>
|
||||
</header>
|
||||
<div>
|
||||
{{- $booksMarkup | safeHTML -}}
|
||||
</div>
|
||||
</section>
|
||||
{{- end -}}
|
||||
@@ -1,7 +1,20 @@
|
||||
{{- $url := .Params.comments_url -}}
|
||||
{{- if $url -}}
|
||||
<section>
|
||||
{{- $url := "" -}}
|
||||
{{- with .Params.comments_url -}}
|
||||
{{- $url = strings.TrimSpace . -}}
|
||||
{{- end -}}
|
||||
{{- if ne $url "" -}}
|
||||
{{- $isExternal := strings.HasPrefix $url "http" -}}
|
||||
<section class="article-aside-block article-comments-callout">
|
||||
<h2>Échanger autour de ce texte</h2>
|
||||
<p>Si vous souhaitez réagir publiquement, <a href="{{ $url }}" target="_blank" rel="noopener">un fil dédié vous attend ici</a>.</p>
|
||||
<p>Si vous souhaitez réagir publiquement, un fil dédié vous attend.</p>
|
||||
<p>
|
||||
<a
|
||||
class="ui-button{{ if $isExternal }} link-external{{ end }}"
|
||||
href="{{ $url }}"
|
||||
{{- if $isExternal }} target="_blank" rel="noreferrer noopener"{{ end -}}
|
||||
>
|
||||
Ouvrir le fil de discussion
|
||||
</a>
|
||||
</p>
|
||||
</section>
|
||||
{{- end -}}
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
{{- $ctx := . -}}
|
||||
{{- $scratch := newScratch -}}
|
||||
{{- $scratch.Set "blocks" 0 -}}
|
||||
{{- $taxonomyNames := slice -}}
|
||||
{{- range $taxonomy, $_ := $ctx.Site.Taxonomies -}}
|
||||
{{- $taxonomyNames = $taxonomyNames | append $taxonomy -}}
|
||||
{{- end -}}
|
||||
{{- range sort $taxonomyNames -}}
|
||||
{{- $taxonomy := . -}}
|
||||
{{- with $ctx.Page.GetTerms $taxonomy -}}
|
||||
{{- $scratch.Add "blocks" 1 -}}
|
||||
{{- end -}}
|
||||
@@ -13,26 +18,27 @@
|
||||
{{- end -}}
|
||||
|
||||
{{- if gt ($scratch.Get "blocks") 0 -}}
|
||||
<section>
|
||||
<details>
|
||||
<summary>Taxonomies</summary>
|
||||
{{- range $taxonomy, $_ := $ctx.Site.Taxonomies -}}
|
||||
<section class="article-aside-block article-taxonomies">
|
||||
<h2>Taxonomies</h2>
|
||||
<div class="article-taxonomies-groups">
|
||||
{{- range sort $taxonomyNames -}}
|
||||
{{- $taxonomy := . -}}
|
||||
{{- with $ctx.Page.GetTerms $taxonomy -}}
|
||||
<section>
|
||||
{{- $taxonomyPage := $ctx.Site.GetPage "taxonomy" $taxonomy -}}
|
||||
<h2>{{ with $taxonomyPage }}{{ .Title }}{{ else }}{{ humanize $taxonomy }}{{ end }}</h2>
|
||||
<details class="article-taxonomy-group">
|
||||
<summary class="ui-button">{{ with $taxonomyPage }}{{ .Title }}{{ else }}{{ humanize $taxonomy }}{{ end }}</summary>
|
||||
{{- partial "keywords.html" . -}}
|
||||
</section>
|
||||
</details>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- with $ctx.Params.keywords -}}
|
||||
{{- if gt (len .) 0 -}}
|
||||
<section>
|
||||
<h2>Mots-clés libres</h2>
|
||||
<details class="article-taxonomy-group">
|
||||
<summary class="ui-button">Mots-clés libres</summary>
|
||||
{{- partial "keywords.html" . -}}
|
||||
</section>
|
||||
</details>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</details>
|
||||
</div>
|
||||
</section>
|
||||
{{- end -}}
|
||||
|
||||
@@ -3,19 +3,7 @@
|
||||
<main>
|
||||
<article>
|
||||
{{ .Content }}
|
||||
|
||||
{{- with .Params.oeuvres -}}
|
||||
<section class="article-books">
|
||||
<header>
|
||||
<h2>Mes livres</h2>
|
||||
<p>Si vous aimez ce blog, vous apprécierez mes livres. En les achetant, vous m'aidez à continuer de le faire vivre.</p>
|
||||
</header>
|
||||
<div>
|
||||
{{ partial "asides/oeuvres.html" $ }}
|
||||
</div>
|
||||
</section>
|
||||
{{- end -}}
|
||||
|
||||
{{ partial "article-books.html" . }}
|
||||
{{ partial "article-footer.html" . }}
|
||||
</article>
|
||||
{{ partial "asides/toc.html" . }}
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
<main>
|
||||
<article>
|
||||
{{ .Content }}
|
||||
{{ partial "article-books.html" . }}
|
||||
{{ partial "article-asides.html" . }}
|
||||
{{ partial "article-footer.html" . }}
|
||||
</article>
|
||||
{{ partial "asides/complementary-images.html" . }}
|
||||
|
||||
Reference in New Issue
Block a user