1

Suppression des commentaires

This commit is contained in:
2026-04-09 23:35:09 +02:00
parent 9fbfcbb8a3
commit 4d69331615
560 changed files with 62 additions and 709 deletions

View File

@@ -1,23 +1,17 @@
{{- $complementaryFilesMarkup := strings.TrimSpace (partial "asides/complementary-images.html" .) -}}
{{- $commentsMarkup := strings.TrimSpace (partial "asides/comments.html" .) -}}
{{- $keywordsMarkup := strings.TrimSpace (partial "asides/keywords.html" .) -}}
{{- $dossierMarkup := strings.TrimSpace (partial "asides/dossier.html" .) -}}
{{- $changeHistoryMarkup := strings.TrimSpace (partial "article-change-history.html" .) -}}
{{- $furtherReadingMarkup := strings.TrimSpace (partial "article-further-reading.html" .) -}}
{{- $relatedMarkup := strings.TrimSpace (partial "article-related.html" .) -}}
{{- if or (ne $complementaryFilesMarkup "") (ne $commentsMarkup "") (ne $keywordsMarkup "") (ne $dossierMarkup "") (ne $changeHistoryMarkup "") (ne $furtherReadingMarkup "") (ne $relatedMarkup "") -}}
{{- if or (ne $complementaryFilesMarkup "") (ne $keywordsMarkup "") (ne $dossierMarkup "") (ne $changeHistoryMarkup "") (ne $furtherReadingMarkup "") (ne $relatedMarkup "") -}}
<section class="article-asides">
{{- with $complementaryFilesMarkup -}}
{{- . | safeHTML -}}
{{- end -}}
{{- if or (ne $commentsMarkup "") (ne $keywordsMarkup "") -}}
<div class="article-asides-grid">
{{- with $commentsMarkup -}}
{{- . | safeHTML -}}
{{- end -}}
{{- with $keywordsMarkup -}}
<div class="article-asides-grid">
{{- . | safeHTML -}}
{{- end -}}
</div>
{{- end -}}
{{- with $dossierMarkup -}}

View File

@@ -1,20 +0,0 @@
{{- $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, 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 -}}

View File

@@ -2,27 +2,13 @@
{{- $hasTOC := gt (len (findRE "<li>" $toc)) 0 -}}
{{- $dossierSummary := partial "dossier-summary.html" (dict "Page" .) -}}
{{- $hasDossierSummary := ne (strings.TrimSpace $dossierSummary) "" -}}
{{- $commentsURL := "" -}}
{{- with .Params.comments_url -}}
{{- $commentsURL = strings.TrimSpace . -}}
{{- end -}}
{{- $hasCommentsLink := ne $commentsURL "" -}}
{{- if or $hasDossierSummary $hasTOC $hasCommentsLink -}}
{{- if or $hasDossierSummary $hasTOC -}}
{{- $tocMarkup := "" -}}
{{- if $hasTOC -}}
{{- $tocMarkup = replace $toc `<nav id="TableOfContents">` `<div class="article-toc-list">` -}}
{{- $tocMarkup = replace $tocMarkup `</nav>` `</div>` -}}
{{- end -}}
<aside class="article-toc">
{{- if $hasCommentsLink -}}
{{- partial "render/link.html" (dict
"Destination" $commentsURL
"Title" "Voir les commentaires"
"Text" "<span>Commentaires</span>"
"Class" "ui-button ui-button--vertical article-toc-link article-toc-link-comments"
"Page" .
) -}}
{{- end -}}
{{- if $hasDossierSummary -}}
<details class="article-toc-drawer article-toc-drawer-dossier">
<summary class="ui-button ui-button--vertical"><span>Dossier</span></summary>

View File

@@ -1,6 +1,4 @@
{{- $page := . -}}
{{- $commentsURL := "" -}}
{{- $commentsLabel := "Commentaires" -}}
{{- $linkClass := "" -}}
{{- $linksParam := $page.Params.links -}}
@@ -8,16 +6,6 @@
{{- if isset . "Page" -}}
{{- $page = index . "Page" -}}
{{- end -}}
{{- if isset . "CommentsURL" -}}
{{- with (index . "CommentsURL") -}}
{{- $commentsURL = . -}}
{{- end -}}
{{- end -}}
{{- if isset . "CommentsLabel" -}}
{{- with (index . "CommentsLabel") -}}
{{- $commentsLabel = . -}}
{{- end -}}
{{- end -}}
{{- if isset . "LinkClass" -}}
{{- with (index . "LinkClass") -}}
{{- $linkClass = . -}}
@@ -50,20 +38,9 @@
{{- $addWikiLink = true -}}
{{- end -}}
{{- if or (ne $commentsURL "") (gt (len $links) 0) $addWikiLink -}}
{{- if or (gt (len $links) 0) $addWikiLink -}}
<nav class="page-links" aria-label="Liens associés">
<ul>
{{- with $commentsURL -}}
<li>
{{- partial "render/link.html" (dict
"Destination" .
"Title" "Voir les commentaires"
"Text" $commentsLabel
"Class" $linkClass
"Page" $page
) -}}
</li>
{{- end -}}
{{- range $links -}}
{{- $text := default .name .text -}}
{{- $title := default $text .title -}}