Compare commits

...

2 Commits

Author SHA1 Message Date
25e9057dd8 Use ... instead of '. . .' in truncated summaries
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2024-06-19 17:31:00 -07:00
e431a4f22b Add an external link marker to external links
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2024-06-19 17:30:46 -07:00
3 changed files with 23 additions and 1 deletions

View File

@ -149,6 +149,15 @@ a {
color: $primary-color; color: $primary-color;
transition: color 0.25s; transition: color 0.25s;
} }
&.external-link {
.feather {
fill: none;
margin-left: 0.25rem;
position: relative;
top: 0.125em;
}
}
} }
img { img {

View File

@ -0,0 +1,13 @@
{{- $absoluteDest := absLangURL .Destination -}}
{{- $siteRootUrl := absLangURL "" -}}
{{- $isExternal := not (hasPrefix $absoluteDest $siteRootUrl) -}}
<a href="{{ .Destination | safeURL }}"
{{- with .Title }} title="{{ . }}"{{ end -}}
{{- if $isExternal -}}
class="external-link" target="_blank" rel="noopener noreferrer"
{{- end -}}
>
{{- with .Text | safeHTML }}{{ . }}{{ end -}}
{{- if $isExternal -}}{{- partial "icon.html" "external-link" -}}{{- end -}}
</a>
{{- /* chomp trailing newline */ -}}