feat: Externe Quellen mit klickbaren Links (neuer Tab) + Kiosk-Modus

- Label "Externe Quelle (Links)" -> "Externe Quellen" (de/en)
- Quelle-URLs werden via linkify-Partial anklickbar, oeffnen in neuem Tab
- Neuer Kiosk-Modus: ?kiosk=true macht externe Links unklickbar
  (bleibt fuer die Session aktiv, verlassen mit ?kiosk=false)
This commit is contained in:
maik
2026-08-18 17:58:53 +02:00
parent 80c1264036
commit d351ba2b3a
7 changed files with 95 additions and 3 deletions
+6
View File
@@ -694,6 +694,12 @@ a:hover { color: var(--op-blau-dunkel); }
.op-theme-blau .op-bildnachweis { color: rgba(255,255,255,.7); }
.op-theme-blau .op-bildnachweis a { color: var(--op-gelb); }
.op-content-box .op-quelle-head { font-weight: 700; color: var(--op-blau); margin-top: 1.5rem; }
.op-content-box .op-quelle-link { color: var(--op-blau); text-decoration: underline; word-break: break-word; }
.op-theme-blau .op-content-box .op-quelle-link { color: var(--op-gelb); }
/* Kiosk-Modus (?kiosk=true): externe Links werden von kiosk.js entschärft und
sollen wie normaler Fliesstext wirken nicht anklickbar, keine Link-Optik. */
.op-link-disabled { color: inherit; text-decoration: none; cursor: default; pointer-events: none; }
/* =========================================================================
16. TOUCH-KIOSK & BARRIEREFREIHEIT
@@ -0,0 +1,10 @@
{{- /*
linkify.html wandelt nackte http(s)-URLs in einem Textblock in anklickbare
Links um (neuer Tab). Alles andere bleibt unveraendert.
Aufruf: {{ partial "linkify.html" .Params.quelle }}
Die erzeugten Links tragen die Klasse op-quelle-link; im Kiosk-Modus
(?kiosk=true) werden externe Links per kiosk.js ohnehin deaktiviert.
*/ -}}
{{- $s := . -}}
{{- $s = replaceRE `(https?://[^\s<>\]]+)` `<a class="op-quelle-link" href="${1}" target="_blank" rel="noopener noreferrer">${1}</a>` $s -}}
{{- $s | safeHTML -}}
@@ -1,3 +1,8 @@
{{/* Kiosk-Modus (?kiosk=true) global auf allen Seiten */}}
{{ $kiosk := resources.Get "js/kiosk.js" }}
{{ if hugo.IsProduction }}{{ $kiosk = $kiosk | minify | fingerprint }}{{ end }}
<script src="{{ $kiosk.RelPermalink }}"{{ with $kiosk.Data.Integrity }} integrity="{{ . }}"{{ end }}></script>
{{/* Karten-JS nur auf Karten-Seiten (Home + Schauplätze) laden */}}
{{ if or .IsHome (eq .Type "schauplaetze") (eq .Type "kategorien") (eq .Type "erinnerungsorte") }}
<script src="{{ "vendor/leaflet/leaflet.js" | relURL }}"></script>
@@ -27,7 +27,7 @@
{{ .Content }}
{{ with .Params.quelle }}
<p class="op-quelle-head">{{ i18n "externalSource" }}</p>
<p class="op-meta uk-margin-remove-top">{{ . | safeHTML }}</p>
<p class="op-meta uk-margin-remove-top">{{ partial "linkify.html" . }}</p>
{{ end }}
</div>
</div>