Skip to content

Commit 42545ef

Browse files
fix: Mark tel: links as safe (#189)
## Description By default, Hugo only allows using `http:`, `https:`, and `mailto:`. URLs using other schemes are replaced with `#ZgotmplZ`. To allow using `tel:`, we have to declare it as safe using `| safeURL`. This marks every URL as safe which should be fine, since all content inside the repo is trusted. See https://gohugo.io/functions/safe/url/ for more info. Closes #185 <!-- Add a short description here / Eine kurze Beschreibung hier einfügen --> ## Checklist <!-- Check fields with: [x] / Abhaken von Punkten: [x] --> - [x] Check the License of new pictures (non-commercial use without attribution) <!-- Die Lizenz neuer Bilder geprüft (nicht-kommerzielle Nutzung ohne Namensnennung) --> The content was modified in the following languages: <!-- Der Inhalt wurde für die folgenden Sprachen angepasst --> - [ ] English - [ ] German --------- Co-authored-by: Moritz Weber <kontakt@moritz-weber.net>
1 parent 679850f commit 42545ef

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

assets/sass/anchorlink.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
.a-anchorlink {
22
display: flex;
3-
flex-wrap: wrap;
3+
flex-wrap: nowrap;
44
margin-bottom: 1.2rem;
55
align-items: center;
66
column-gap: .8rem;
7+
8+
@media (max-width: #{$breakpoint-md}) {
9+
justify-content: space-between;
10+
}
711
}
812

913
.a-anchorlink > h2 {

layouts/_default/_markup/render-link.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
{{- if strings.HasPrefix $url "http" -}}
33
{{ partial "link" . }}
44
{{- else -}}
5-
<a href="{{ $url }}">{{ .Text }}</a>
5+
<a href="{{ $url | safeURL }}">{{ .Text }}</a>
66
{{- end -}}

0 commit comments

Comments
 (0)