External links open in a new tab
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YDRjtmAiNpo5mK5N3d7QwZ
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{{/* list of {title, url, text, platform} */}}
|
||||
<dl class="entries">
|
||||
{{ range . }}
|
||||
<dt>{{ if .url }}<a href="{{ .url }}" rel="nofollow noopener">{{ .title | default .url }}</a>{{ else }}{{ .title }}{{ end }}{{ with .platform }} <small>{{ . }}</small>{{ end }}</dt>
|
||||
<dt>{{ if .url }}<a href="{{ .url }}"{{ partial "ext.html" .url }}>{{ .title | default .url }}</a>{{ else }}{{ .title }}{{ end }}{{ with .platform }} <small>{{ . }}</small>{{ end }}</dt>
|
||||
{{ with .text }}<dd>{{ . | markdownify }}</dd>{{ end }}
|
||||
{{ end }}
|
||||
</dl>
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{{- /* attributes for a link to this address: external ones open in a new tab */ -}}
|
||||
{{- if findRE `(?i)^(https?:)?//` (string .) -}}
|
||||
{{- return (` target="_blank" rel="noopener"` | safeHTMLAttr) -}}
|
||||
{{- end -}}
|
||||
{{- return ("" | safeHTMLAttr) -}}
|
||||
Reference in New Issue
Block a user