Files
tsuki/layouts/_markup/render-link.html
T
tiennm99 1eafaefff8 fix: post-v0.2.0 review P1s + CI hygiene (v0.2.1)
Security:
- render-link: drop `| safeHTML` on .Text (self-XSS surface w/ Goldmark unsafe:true)
- projects.html: safeURL + noreferrer + target=_blank on repo/demo
- comments: require repo+repoId+categoryId in gate (prevent broken Giscus iframe)
- htmltest-action: pin to commit SHA 31be84a (supply-chain)

Fixed:
- seo.html: nil-safe \$authorURL chain (no nil.url template error)
- nav.html: relURL on Menu.URL (sub-path deploy correctness)
- pages.yml: drop dead if-find Pagefind guard
2026-05-10 03:04:58 +07:00

12 lines
432 B
HTML

{{- /* External markdown links get rel="noopener noreferrer". No target="_blank" — UX choice. */ -}}
{{- $external := or
(strings.HasPrefix .Destination "http://")
(strings.HasPrefix .Destination "https://")
(strings.HasPrefix .Destination "//")
-}}
<a href="{{ .Destination | safeURL }}"
{{- with .Title }} title="{{ . }}"{{ end -}}
{{- if $external }} rel="noopener noreferrer"{{ end -}}
>{{ .Text }}</a>
{{- /**/ -}}