1

Sécuriser et documenter les liens morts

Rend les liens supprimés non cliquables, améliore le rapport des liens morts et accélère la génération du site.

Closes #2
Closes #3
Closes #4
This commit is contained in:
2026-04-02 22:23:16 +02:00
parent 0e4e8cd076
commit fe8037bb73
40 changed files with 423 additions and 112 deletions

View File

@@ -169,7 +169,11 @@
margin-top: var(--space-3);
}
.article-header .article-origin-link-button > a {
.article-header .article-origin-link-button > del {
display: block;
}
.article-header .article-origin-link-button .article-origin-link-button-link {
width: 100%;
min-height: 2.8rem;
padding: 0.5rem 1rem;
@@ -184,21 +188,21 @@
letter-spacing: normal;
}
.article-header .article-origin-link-button > a.ui-button {
.article-header .article-origin-link-button .article-origin-link-button-link.ui-button {
border-color: color-mix(in srgb, var(--color-section-divider-1) 62%, var(--color-border-strong));
background: linear-gradient(180deg, rgba(217, 122, 63, 0.36) 0%, rgba(17, 27, 42, 0.94) 100%);
}
.article-header .article-origin-link-button > a.ui-button:is(:hover, :focus-visible) {
.article-header .article-origin-link-button .article-origin-link-button-link.ui-button:is(:hover, :focus-visible) {
background: linear-gradient(180deg, rgba(217, 122, 63, 0.52) 0%, rgba(17, 27, 42, 0.98) 100%);
}
.article-header .article-origin-link-button > a.ui-button:visited {
.article-header .article-origin-link-button a.article-origin-link-button-link.ui-button:visited {
color: var(--color-heading);
}
.article-header .article-origin-link-button > a.ui-button:hover .article-origin-link-button-url,
.article-header .article-origin-link-button > a.ui-button:focus-visible .article-origin-link-button-url {
.article-header .article-origin-link-button .article-origin-link-button-link.ui-button:hover .article-origin-link-button-url,
.article-header .article-origin-link-button .article-origin-link-button-link.ui-button:focus-visible .article-origin-link-button-url {
color: #ffffff;
}

View File

@@ -122,6 +122,28 @@ a.link-external:not(.link-affiliated):is(:hover, :focus-visible) {
color: var(--color-link-external-hover);
}
body:has(> header.article-header) > main > article > :not(footer):not(section.article-asides) a.link-archive:not(.ui-button) {
color: var(--color-link-archive);
}
body:has(> header.article-header) > main > article > :not(footer):not(section.article-asides) a.link-archive:not(.ui-button):is(:hover, :focus-visible) {
color: var(--color-link-archive-hover);
}
body:has(> header.article-header) > main > article > :not(footer):not(section.article-asides) a.link-archive:not(.ui-button)::after {
content: "";
display: inline-block;
width: 0.9em;
height: 0.9em;
margin-left: 0.22em;
vertical-align: -0.08em;
background-color: currentColor;
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9h18v2h-1v8h2v2H2v-2h2v-8H3V9zm3 2v8h2v-8H6zm5 0v8h2v-8h-2zm5 0v8h2v-8h-2zM12 2l10 5v1H2V7l10-5zm0 2.2L7.2 6h9.6L12 4.2z' fill='%23000'/%3E%3C/svg%3E");
mask-repeat: no-repeat;
mask-position: center;
mask-size: contain;
}
a.link-affiliated {
color: var(--color-link-affiliated);
}
@@ -130,7 +152,8 @@ a.link-affiliated:is(:hover, :focus-visible) {
color: var(--color-link-affiliated-hover);
}
a.link-dead {
body:has(> header.article-header) > main > article > :not(footer):not(section.article-asides) :is(a, span).link-dead:not(.ui-button),
body:has(> main.listing-page) > main.listing-page table span.link-dead {
text-decoration-line: underline;
text-decoration-style: wavy;
text-decoration-thickness: 1px;
@@ -138,23 +161,49 @@ a.link-dead {
text-underline-offset: 0.2em;
}
a.link-dead:is(:hover, :focus-visible) {
body:has(> header.article-header) > main > article > :not(footer):not(section.article-asides) :is(a, span).link-dead:not(.ui-button):is(:hover, :focus-visible),
body:has(> main.listing-page) > main.listing-page table span.link-dead:is(:hover, :focus-visible) {
text-decoration-line: underline;
text-decoration-style: wavy;
text-decoration-thickness: 2px;
text-decoration-color: currentColor;
}
a.link-dead.link-dead-404 {
body:has(> header.article-header) > main > article > :not(footer):not(section.article-asides) :is(a, span).link-dead.link-dead-404:not(.ui-button),
body:has(> main.listing-page) > main.listing-page table span.link-dead.link-dead-404 {
color: var(--color-link-dead-404);
text-decoration-color: color-mix(in srgb, var(--color-link-dead-404) 78%, transparent);
}
a.link-dead.link-dead-404:is(:hover, :focus-visible) {
body:has(> header.article-header) > main > article > :not(footer):not(section.article-asides) :is(a, span).link-dead.link-dead-404:not(.ui-button):is(:hover, :focus-visible),
body:has(> main.listing-page) > main.listing-page table span.link-dead.link-dead-404:is(:hover, :focus-visible) {
color: var(--color-link-dead-404-hover);
text-decoration-color: currentColor;
}
body:has(> header.article-header) > main > article > :not(footer):not(section.article-asides) del.link-dead.link-dead-marked,
body:has(> main.listing-page) > main.listing-page table del.link-dead.link-dead-marked {
color: var(--color-link-dead-marked);
text-decoration-color: color-mix(in srgb, var(--color-link-dead-marked) 82%, transparent);
}
body:has(> header.article-header) > main > article > :not(footer):not(section.article-asides) del.link-dead.link-dead-marked > span.link-dead.link-dead-marked:not(.ui-button),
body:has(> main.listing-page) > main.listing-page table del.link-dead.link-dead-marked > span.link-dead.link-dead-marked {
color: inherit;
text-decoration-line: underline;
text-decoration-style: solid;
text-decoration-thickness: 1px;
text-decoration-color: inherit;
text-underline-offset: 0.2em;
cursor: help;
}
body:has(> header.article-header) > main > article > :not(footer):not(section.article-asides) del.link-dead.link-dead-marked > span.link-dead.link-dead-marked:not(.ui-button):is(:hover, :focus-visible),
body:has(> main.listing-page) > main.listing-page table del.link-dead.link-dead-marked > span.link-dead.link-dead-marked:is(:hover, :focus-visible) {
color: var(--color-link-dead-marked-hover);
text-decoration-color: currentColor;
}
img,
video,
audio,

View File

@@ -13,10 +13,14 @@
--color-link-hover: #fff1b8;
--color-link-external: #6de0b8;
--color-link-external-hover: #9ef7d6;
--color-link-archive: #d4c4a0;
--color-link-archive-hover: #eadab5;
--color-link-affiliated: #e792ff;
--color-link-affiliated-hover: #f3b8ff;
--color-link-dead-404: #ff9fb3;
--color-link-dead-404-hover: #ffd4df;
--color-link-dead-marked: #ff5b6e;
--color-link-dead-marked-hover: #ff96a3;
--color-accent-1: #76a7d7;
--color-accent-2: #5d86ad;
--color-accent-3: #c3d0df;

View File

@@ -238,10 +238,14 @@
<p class="article-origin-link-kicker">À lire avant mon commentaire</p>
<p class="article-origin-link-hint">Ce billet n'est qu'une note de lecture. Lisez d'abord la source pour avoir le contexte complet.</p>
<p class="article-origin-link-button">
<a href="{{ $originURL }}" class="ui-button{{ if $originIsExternal }} link-external{{ end }}"{{ if $originIsExternal }} rel="noreferrer noopener"{{ end }} title="Lire la page d'origine">
<span class="article-origin-link-button-label">{{ $originLabel }}</span>
<span class="article-origin-link-button-url">{{ $originURL }}</span>
</a>
{{- $originLinkText := printf "<span class=\"article-origin-link-button-label\">%s</span><span class=\"article-origin-link-button-url\">%s</span>" $originLabel $originURL -}}
{{- partial "render/link.html" (dict
"Destination" $originURL
"Title" "Lire la page d'origine"
"Text" $originLinkText
"Class" "ui-button article-origin-link-button-link"
"Page" .
) -}}
</p>
</section>
{{- end -}}
@@ -262,7 +266,7 @@
{{- end -}}
{{- with $coverAttribution -}}
{{- $attribution := partial "media/parse-attribution.html" . -}}
<p class="cover-attribution"><strong>Attribution:</strong> <span>{{- if index $attribution "isURL" -}}<a href="{{ index $attribution "url" }}" class="link-external" title="Lien externe" rel="noreferrer noopener">{{ index $attribution "label" }}</a>{{- else -}}{{ . | markdownify }}{{- end -}}</span></p>
<p class="cover-attribution"><strong>Attribution:</strong> <span>{{- if index $attribution "isURL" -}}{{ partial "render/link.html" (dict "Destination" (index $attribution "url") "Page" $ "Text" (index $attribution "label")) }}{{- else -}}{{ . | markdownify }}{{- end -}}</span></p>
{{- end -}}
{{- with $coverPrompt -}}
<details>

View File

@@ -1,16 +1,16 @@
{{- $url := "" -}}
{{- $report := partial "external-links-report.html" (dict) -}}
{{- $report := partialCached "external-links-report.html" (dict) "default" -}}
{{- if reflect.IsMap . -}}
{{- with index . "URL" -}}
{{- $url = . -}}
{{- end -}}
{{- with index . "Report" -}}
{{- $report = partial "external-links-report.html" (dict "Report" .) -}}
{{- $report = . -}}
{{- end -}}
{{- end -}}
{{- $entries := default (dict) (index $report "entries") -}}
{{- $deadLinks := default (slice) (index $report "links") -}}
{{- $deadLinksMap := default (dict) (index $report "linksMap") -}}
{{- $host := "" -}}
{{- with $url -}}
@@ -39,11 +39,8 @@
{{- $deadInfo := dict -}}
{{- range $lookupURLs -}}
{{- if eq (len $deadInfo) 0 -}}
{{- $matches := where $deadLinks "url" . -}}
{{- if gt (len $matches) 0 -}}
{{- $deadInfo = index $matches 0 -}}
{{- end -}}
{{- if and (eq (len $deadInfo) 0) (isset $deadLinksMap .) -}}
{{- $deadInfo = index $deadLinksMap . -}}
{{- end -}}
{{- end -}}
@@ -54,6 +51,16 @@
{{- $statusTone := "unknown" -}}
{{- $statusLabel := "État inconnu" -}}
{{- $statusTitle := "" -}}
{{- $statusManual := false -}}
{{- with index $entry "manualMarked" -}}
{{- $statusManual = . -}}
{{- end -}}
{{- if and (not $statusManual) (gt (len $deadInfo) 0) -}}
{{- with index $deadInfo "manualMarked" -}}
{{- $statusManual = . -}}
{{- end -}}
{{- end -}}
{{- if gt (len $entry) 0 -}}
{{- with index $entry "status" -}}
@@ -95,7 +102,11 @@
{{- end -}}
{{- end -}}
{{- if gt $statusCode 0 -}}
{{- if $statusManual -}}
{{- $statusTone = "dead" -}}
{{- $statusLabel = "Supprimé" -}}
{{- $statusTitle = "Lien marqué comme supprimé dans data/deletions.yaml" -}}
{{- else if gt $statusCode 0 -}}
{{- if lt $statusCode 400 -}}
{{- $statusTone = "ok" -}}
{{- $statusLabel = printf "OK %d" $statusCode -}}

View File

@@ -1,13 +1,18 @@
{{- $report := partial "external-links-report.html" . -}}
{{- $report := partialCached "external-links-report.html" (dict "WithLocations" true) "with-locations" -}}
{{- $allPages := where site.Pages ".File" "!=" nil -}}
{{- $replacements := default (dict) site.Data.replacements -}}
{{- $sourceLinks := default (slice) $report.links -}}
{{- $links := slice -}}
{{- range $sourceLinks -}}
{{- if eq (index $replacements .url) nil -}}
{{- $manualMarked := false -}}
{{- with index . "manualMarked" -}}
{{- $manualMarked = . -}}
{{- end -}}
{{- if or $manualMarked (eq (index $replacements .url) nil) -}}
{{- $links = $links | append . -}}
{{- end -}}
{{- end -}}
{{- $links = sort $links "url" -}}
{{- $generatedLabel := "" -}}
{{- with $report.generatedAt -}}
{{- $generatedLabel = (time .).Format "02/01/2006" -}}
@@ -33,7 +38,13 @@
{{- range $links -}}
<tr>
<td>
{{- $manualMarked := false -}}
{{- with index . "manualMarked" -}}
{{- $manualMarked = . -}}
{{- end -}}
{{- $locations := default (slice) .locations -}}
{{- $seenLocations := dict -}}
{{- $hasRenderedLocation := false -}}
{{- if gt (len $locations) 0 -}}
{{- range $locations -}}
{{- $file := "" -}}
@@ -66,22 +77,41 @@
{{- $matchedPage = index $candidates 0 -}}
{{- end -}}
{{- end -}}
{{- $locationKey := "unknown" -}}
{{- if $matchedPage -}}
<a href="{{ $matchedPage.RelPermalink }}">{{ $matchedPage.Title }}</a>
{{- $locationKey = printf "page:%s" $matchedPage.Path -}}
{{- else if $file -}}
<code>{{ $file }}{{ if $line }}:{{ $line }}{{ end }}</code>
{{- $locationKey = printf "file:%s" $file -}}
{{- else if $pagePath -}}
<code>{{ $pagePath }}</code>
{{- else -}}
<em>Emplacement inconnu</em>
{{- $locationKey = printf "path:%s" $pagePath -}}
{{- end -}}
{{- if not (isset $seenLocations $locationKey) -}}
{{- $seenLocations = merge $seenLocations (dict $locationKey true) -}}
{{- $hasRenderedLocation = true -}}
{{- if $matchedPage -}}
<a href="{{ $matchedPage.RelPermalink }}">{{ $matchedPage.Title }}</a>
{{- else if $file -}}
<code>{{ $file }}{{ if $line }}:{{ $line }}{{ end }}</code>
{{- else if $pagePath -}}
<code>{{ $pagePath }}</code>
{{- else -}}
<em>Emplacement inconnu</em>
{{- end -}}
<br>
{{- end -}}
<br>
{{- end -}}
{{- else -}}
{{- end -}}
{{- if not $hasRenderedLocation -}}
<em>Emplacements inconnus</em>
{{- end -}}
</td>
<td><a href="{{ .url }}" rel="noreferrer noopener" target="_blank">{{ .url }}</a></td>
<td>
{{- if $manualMarked -}}
<del class="link-dead link-dead-marked"><span class="link-dead link-dead-marked" title="URL d'origine : {{ .url }}" aria-label="Lien supprimé. URL d'origine : {{ .url }}">{{ .url }}</span></del>
{{- else -}}
<span class="link-dead{{ if eq (printf "%v" .status) "404" }} link-dead-404{{ end }}" title="URL d'origine : {{ .url }}" aria-label="Lien mort. URL d'origine : {{ .url }}">{{ .url }}</span>
{{- end -}}
</td>
<td>{{ with .code }}<code>{{ . }}</code>{{ end }}</td>
<td>{{ with .statusText }}<code>{{ . }}</code>{{ end }}</td>
</tr>

View File

@@ -5,7 +5,7 @@
{{- $excludeInterestingLinks := false -}}
{{- $groupBySubSections := false -}}
{{- $subSections := slice -}}
{{- $externalLinksReport := partial "external-links-report.html" (dict) -}}
{{- $externalLinksReport := partialCached "external-links-report.html" (dict) "default" -}}
{{- with $context -}}
{{- if eq (strings.TrimSuffix "/" .RelPermalink) "/interets" -}}
{{- $excludeInterestingLinks = true -}}

View File

@@ -91,7 +91,7 @@
<div class="figure-media-meta-extra">
{{- with $data.attribution -}}
{{- $attribution := partial "media/parse-attribution.html" . -}}
<p class="figure-attribution cover-attribution"><strong>Attribution :</strong> <span>{{- if index $attribution "isURL" -}}<a href="{{ index $attribution "url" }}" class="link-external" title="Lien externe" rel="noreferrer noopener">{{ index $attribution "label" }}</a>{{- else -}}{{ . | markdownify }}{{- end -}}</span></p>
<p class="figure-attribution cover-attribution"><strong>Attribution :</strong> <span>{{- if index $attribution "isURL" -}}{{ partial "render/link.html" (dict "Destination" (index $attribution "url") "Page" $.Page "Text" (index $attribution "label")) }}{{- else -}}{{ . | markdownify }}{{- end -}}</span></p>
{{- end -}}
{{- with $data.prompt -}}
<details>

View File

@@ -1,7 +1,6 @@
{{- $destination := .Destination -}}
{{- if hasPrefix $destination "~~" -}}
{{- $destination = replaceRE "^~~" "" $destination -}}
{{- $destination = replaceRE "~~([/?#]|$)" "$1" $destination -}}
{{- if strings.Contains $destination "~~" -}}
{{- $destination = replace $destination "~~" "" -}}
{{- end -}}
{{- $isExternal := or (strings.HasPrefix $destination "http://") (strings.HasPrefix $destination "https://") -}}
{{- $host := "" -}}
@@ -17,12 +16,41 @@
{{- end -}}
{{- $page := .Page -}}
{{- $site := $page.Site -}}
{{- $deletions := partialCached "deletions-lookup.html" (dict) "default" -}}
{{- $replacements := default (dict) $site.Data.replacements -}}
{{- $aff := index $site.Data.affiliates.sites $host -}}
{{- $isAffiliated := false -}}
{{- $newURL := $destination -}}
{{- $replacementURL := index $replacements $destination -}}
{{- $hasReplacement := ne $replacementURL nil -}}
{{- $lookupURLs := slice $destination -}}
{{- with $destination -}}
{{- if strings.HasSuffix . "/" -}}
{{- $withoutSlash := strings.TrimSuffix "/" . -}}
{{- if ne $withoutSlash . -}}
{{- $lookupURLs = $lookupURLs | append $withoutSlash -}}
{{- end -}}
{{- else -}}
{{- $lookupURLs = $lookupURLs | append (printf "%s/" .) -}}
{{- end -}}
{{- end -}}
{{- $isDeleted := false -}}
{{- range $lookupURLs -}}
{{- if and (not $isDeleted) (isset $deletions .) -}}
{{- $isDeleted = true -}}
{{- end -}}
{{- end -}}
{{- $replacementURL := "" -}}
{{- $hasReplacement := false -}}
{{- if not $isDeleted -}}
{{- range $lookupURLs -}}
{{- if not $hasReplacement -}}
{{- $candidateReplacementURL := index $replacements . -}}
{{- if ne $candidateReplacementURL nil -}}
{{- $replacementURL = $candidateReplacementURL -}}
{{- $hasReplacement = true -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- $customClass := "" -}}
{{- if reflect.IsMap . -}}
@@ -44,6 +72,18 @@
{{- end -}}
{{- end -}}
{{- $newHost := "" -}}
{{- if and $isExternal (gt (len (findRE "^https?://[^[:space:]]+$" $newURL 1)) 0) -}}
{{- $newParsed := urls.Parse $newURL -}}
{{- $newHost = lower $newParsed.Host -}}
{{- end -}}
{{- $isArchiveLink := false -}}
{{- if and $isExternal (ne $newHost "") -}}
{{- if or (eq $newHost "archive.org") (strings.HasSuffix $newHost ".archive.org") -}}
{{- $isArchiveLink = true -}}
{{- end -}}
{{- end -}}
{{- $internalPage := "" -}}
{{- $internalPageFound := false -}}
{{- if not $isExternal -}}
@@ -66,15 +106,22 @@
{{- end -}}
{{- end -}}
{{- $report := partial "external-links-report.html" (dict) -}}
{{- $deadList := default (slice) (index $report "links") -}}
{{- $report := partialCached "external-links-report.html" (dict) "default" -}}
{{- $entriesMap := default (dict) (index $report "entries") -}}
{{- $cacheEntry := index $entriesMap $destination -}}
{{- $deadLinksMap := default (dict) (index $report "linksMap") -}}
{{- $cacheEntry := dict -}}
{{- range $lookupURLs -}}
{{- if and (eq (len $cacheEntry) 0) (isset $entriesMap .) -}}
{{- $cacheEntry = index $entriesMap . -}}
{{- end -}}
{{- end -}}
{{- $deadInfo := dict -}}
{{- $isDeadLink := false -}}
{{- with (first 1 (where $deadList "url" $destination)) -}}
{{- $deadInfo = index . 0 -}}
{{- $isDeadLink = true -}}
{{- range $lookupURLs -}}
{{- if and (not $isDeadLink) (isset $deadLinksMap .) -}}
{{- $deadInfo = index $deadLinksMap . -}}
{{- $isDeadLink = true -}}
{{- end -}}
{{- end -}}
{{- $deadStatus := "" -}}
{{- with (index $deadInfo "status") -}}
@@ -89,6 +136,15 @@
{{- if and $isDeadLink (eq $deadStatus "404") -}}
{{- $isConfirmedDeadLink = true -}}
{{- end -}}
{{- $isMarkedDeadLink := false -}}
{{- with (index $deadInfo "manualMarked") -}}
{{- $isMarkedDeadLink = . -}}
{{- end -}}
{{- if not $isMarkedDeadLink -}}
{{- with (index $cacheEntry "manualMarked") -}}
{{- $isMarkedDeadLink = . -}}
{{- end -}}
{{- end -}}
{{- $titleParts := slice -}}
{{- if $isAffiliated -}}
@@ -96,6 +152,9 @@
{{- else if $isExternal -}}
{{- $titleParts = $titleParts | append "Lien externe" -}}
{{- end -}}
{{- if $isArchiveLink -}}
{{- $titleParts = $titleParts | append "Internet Archive" -}}
{{- end -}}
{{- if and (not $isExternal) $internalPageFound -}}
{{- $internalTitle := $internalPage.LinkTitle | default $internalPage.Title -}}
{{- with $internalPage.Date -}}
@@ -109,6 +168,9 @@
{{- end -}}
{{- if $isDeadLink -}}
{{- $deadDetails := slice -}}
{{- if $isMarkedDeadLink -}}
{{- $deadDetails = $deadDetails | append "supprimé" -}}
{{- end -}}
{{- with (index $cacheEntry "checkedAt") -}}
{{- $deadDetails = $deadDetails | append (printf "inaccessible depuis le %s" (time.Format "02/01/2006" (time .))) -}}
{{- end -}}
@@ -116,7 +178,10 @@
{{- $deadDetails = $deadDetails | append (printf "raison %s" .) -}}
{{- end -}}
{{- with (index $deadInfo "status") -}}
{{- $deadDetails = $deadDetails | append (printf "statut %v" .) -}}
{{- $statusLabel := printf "%v" . -}}
{{- if not (and $isMarkedDeadLink (or (eq $statusLabel "manual") (eq $statusLabel "deleted"))) -}}
{{- $deadDetails = $deadDetails | append (printf "statut %s" $statusLabel) -}}
{{- end -}}
{{- end -}}
{{- if gt (len $deadDetails) 0 -}}
{{- $titleParts = $titleParts | append (printf "(%s)" (delimit $deadDetails " ; ")) -}}
@@ -134,11 +199,17 @@
{{- if $isAffiliated -}}
{{- $linkClasses = $linkClasses | append "link-affiliated" -}}
{{- end -}}
{{- if $isArchiveLink -}}
{{- $linkClasses = $linkClasses | append "link-archive" -}}
{{- end -}}
{{- if $isDeadLink -}}
{{- $linkClasses = $linkClasses | append "link-dead" -}}
{{- if $isConfirmedDeadLink -}}
{{- $linkClasses = $linkClasses | append "link-dead-404" -}}
{{- end -}}
{{- if $isMarkedDeadLink -}}
{{- $linkClasses = $linkClasses | append "link-dead-marked" -}}
{{- end -}}
{{- end -}}
{{- with $customClass -}}
{{- range (split . " ") -}}
@@ -148,4 +219,10 @@
{{- end -}}
{{- end -}}
{{- $classValue := delimit $linkClasses " " -}}
<a href="{{- $newURL -}}"{{ with $classValue }} class="{{- . -}}"{{ end }}{{ with $titleValue }} title="{{- . -}}"{{ end }}{{ if $isExternal }} rel="noreferrer noopener"{{ end }}>{{- strings.TrimSpace .Text | safeHTML -}}</a>{{- "" -}}
{{- if $isMarkedDeadLink -}}
{{- $deadTitleValue := printf "URL d'origine : %s" $destination -}}
{{- $deadAriaLabel := printf "Lien supprimé. URL d'origine : %s" $destination -}}
<del class="link-dead link-dead-marked"><span{{ with $classValue }} class="{{- . -}}"{{ end }} title="{{- $deadTitleValue -}}" aria-label="{{- $deadAriaLabel -}}">{{- strings.TrimSpace .Text | safeHTML -}}</span></del>
{{- else -}}
<a href="{{- $newURL -}}"{{ with $classValue }} class="{{- . -}}"{{ end }}{{ with $titleValue }} title="{{- . -}}"{{ end }}{{ if $isExternal }} rel="noreferrer noopener"{{ end }}>{{- strings.TrimSpace .Text | safeHTML -}}</a>
{{- end -}}{{- "" -}}

View File

@@ -32,7 +32,7 @@
{{- with $attribution -}}
{{- $figureAttribution := partial "media/parse-attribution.html" . -}}
<div class="figure-media-meta-extra">
<p class="figure-attribution cover-attribution"><strong>Attribution :</strong> <span>{{- if index $figureAttribution "isURL" -}}<a href="{{ index $figureAttribution "url" }}" class="link-external" title="Lien externe" rel="noreferrer noopener">{{ index $figureAttribution "label" }}</a>{{- else -}}{{ . | markdownify }}{{- end -}}</span></p>
<p class="figure-attribution cover-attribution"><strong>Attribution :</strong> <span>{{- if index $figureAttribution "isURL" -}}{{ partial "render/link.html" (dict "Destination" (index $figureAttribution "url") "Page" $.Page "Text" (index $figureAttribution "label")) }}{{- else -}}{{ . | markdownify }}{{- end -}}</span></p>
</div>
{{- end -}}
</figcaption>

View File

@@ -15,7 +15,7 @@
{{- with $data.description -}}<p>{{ . | markdownify }}</p>{{- end -}}
{{- with $data.attribution -}}
{{- $attribution := partial "media/parse-attribution.html" . -}}
<p><strong>Attribution :</strong> <em>{{- if index $attribution "isURL" -}}<a href="{{ index $attribution "url" }}" class="link-external" title="Lien externe" rel="noreferrer noopener">{{ index $attribution "label" }}</a>{{- else -}}{{ . | markdownify }}{{- end -}}</em></p>
<p><strong>Attribution :</strong> <em>{{- if index $attribution "isURL" -}}{{ partial "render/link.html" (dict "Destination" (index $attribution "url") "Page" $.Page "Text" (index $attribution "label")) }}{{- else -}}{{ . | markdownify }}{{- end -}}</em></p>
{{- end -}}
</figcaption>
{{- end -}}

View File

@@ -24,7 +24,7 @@
<div class="figure-media-meta-extra">
{{- with $data.attribution -}}
{{- $attribution := partial "media/parse-attribution.html" . -}}
<p class="figure-attribution cover-attribution"><strong>Attribution :</strong> <span>{{- if index $attribution "isURL" -}}<a href="{{ index $attribution "url" }}" class="link-external" title="Lien externe" rel="noreferrer noopener">{{ index $attribution "label" }}</a>{{- else -}}{{ . | markdownify }}{{- end -}}</span></p>
<p class="figure-attribution cover-attribution"><strong>Attribution :</strong> <span>{{- if index $attribution "isURL" -}}{{ partial "render/link.html" (dict "Destination" (index $attribution "url") "Page" $.Page "Text" (index $attribution "label")) }}{{- else -}}{{ . | markdownify }}{{- end -}}</span></p>
{{- end -}}
{{- with $data.prompt -}}
<details>

View File

@@ -33,7 +33,7 @@
{{- $recettesRoot := $site.GetPage "/interets/recettes" -}}
{{- $collectionsRoot := $site.GetPage "/collections" -}}
{{- $critiquesRoot := $site.GetPage "/critiques" -}}
{{- $externalLinksReport := partial "external-links-report.html" (dict) -}}
{{- $externalLinksReport := partialCached "external-links-report.html" (dict) "default" -}}
{{- partial "hero.html" . -}}