From a90ea13be92c206dad6c38ff4d330e4f0b57ee25 Mon Sep 17 00:00:00 2001 From: Richard Dern Date: Sat, 21 Feb 2026 16:38:36 +0100 Subject: [PATCH] Affichage des liens morts --- themes/2026/assets/css/base.css | 27 ++++++++++++++++++- themes/2026/assets/css/variables.css | 2 ++ .../2026/layouts/_partials/render/link.html | 19 +++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) diff --git a/themes/2026/assets/css/base.css b/themes/2026/assets/css/base.css index 99b17f6b..7b824440 100644 --- a/themes/2026/assets/css/base.css +++ b/themes/2026/assets/css/base.css @@ -64,7 +64,7 @@ h3 { font-size: clamp(1.05rem, 1.7vw, 1.35rem); } -main > article :is(strong, b) { +main > article > :not(footer.article-footer) :is(strong, b) { font-weight: 800; color: var(--color-heading); text-shadow: none; @@ -130,6 +130,31 @@ a.link-affiliated:is(:hover, :focus-visible) { color: var(--color-link-affiliated-hover); } +a.link-dead { + text-decoration-line: underline; + text-decoration-style: wavy; + text-decoration-thickness: 1px; + text-decoration-color: color-mix(in srgb, currentColor 72%, transparent); + text-underline-offset: 0.2em; +} + +a.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 { + 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) { + color: var(--color-link-dead-404-hover); + text-decoration-color: currentColor; +} + img, video, audio, diff --git a/themes/2026/assets/css/variables.css b/themes/2026/assets/css/variables.css index 500effc0..f014703d 100644 --- a/themes/2026/assets/css/variables.css +++ b/themes/2026/assets/css/variables.css @@ -15,6 +15,8 @@ --color-link-external-hover: #9ef7d6; --color-link-affiliated: #e792ff; --color-link-affiliated-hover: #f3b8ff; + --color-link-dead-404: #ff9fb3; + --color-link-dead-404-hover: #ffd4df; --color-accent-1: #76a7d7; --color-accent-2: #5d86ad; --color-accent-3: #c3d0df; diff --git a/themes/2026/layouts/_partials/render/link.html b/themes/2026/layouts/_partials/render/link.html index 83adb563..dfefbec9 100644 --- a/themes/2026/layouts/_partials/render/link.html +++ b/themes/2026/layouts/_partials/render/link.html @@ -62,6 +62,19 @@ {{- $deadInfo = index . 0 -}} {{- $isDeadLink = true -}} {{- end -}} +{{- $deadStatus := "" -}} +{{- with (index $deadInfo "status") -}} + {{- $deadStatus = printf "%v" . -}} +{{- end -}} +{{- if eq $deadStatus "" -}} + {{- with (index $cacheEntry "status") -}} + {{- $deadStatus = printf "%v" . -}} + {{- end -}} +{{- end -}} +{{- $isConfirmedDeadLink := false -}} +{{- if and $isDeadLink (eq $deadStatus "404") -}} + {{- $isConfirmedDeadLink = true -}} +{{- end -}} {{- $titleParts := slice -}} {{- if $isAffiliated -}} @@ -104,6 +117,12 @@ {{- if $isAffiliated -}} {{- $linkClasses = $linkClasses | append "link-affiliated" -}} {{- end -}} +{{- if $isDeadLink -}} + {{- $linkClasses = $linkClasses | append "link-dead" -}} + {{- if $isConfirmedDeadLink -}} + {{- $linkClasses = $linkClasses | append "link-dead-404" -}} + {{- end -}} +{{- end -}} {{- with $customClass -}} {{- range (split . " ") -}} {{- if ne . "" -}}