mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
52 lines
2.0 KiB
HTML
52 lines
2.0 KiB
HTML
{{- $rel := "" -}}
|
|
{{- $class := "" -}}
|
|
<a
|
|
href="{{ .Destination | safeURL }}"
|
|
{{ with .Title }}
|
|
title="{{ . }}"
|
|
{{ end }}
|
|
{{ if (urls.Parse .Destination).Host | or .Newtab }}
|
|
{{ $rel = "noopener noreffer" }}
|
|
target="_blank"
|
|
{{ end }}
|
|
{{ if $rel | or .Rel }}
|
|
rel="{{ $rel }}{{ with .Rel }} {{ . }}{{ end }}"
|
|
{{ end }}
|
|
{{ if eq .Card true }}
|
|
{{ $class = "card-link" }}
|
|
{{ end }}
|
|
{{ if $class | or .Class }}
|
|
class="{{ $class }}{{ with .Class }} {{ . }}{{ end }}"
|
|
{{ end }}
|
|
{{ with .Download }}
|
|
download="{{ . }}"
|
|
{{ end }}
|
|
>
|
|
{{- if ne .Card true -}}
|
|
{{- with .Content -}}
|
|
{{- . | safeHTML -}}
|
|
{{- end -}}
|
|
{{- else -}}
|
|
<span class="card-link-backdrop"></span>
|
|
<span class="card-link-content">
|
|
<span class="card-link-text">
|
|
<span class="card-link-title">
|
|
{{- with .Content -}}
|
|
{{- . | safeHTML -}}
|
|
{{- end -}}
|
|
</span>
|
|
<span class="card-link-meta">
|
|
<span class="card-link-url">
|
|
<svg class="Zi Zi--InsertLink" fill="currentColor" viewbox="0 0 24 24" width="17" height="17">
|
|
<path d="M6.77 17.23c-.905-.904-.94-2.333-.08-3.193l3.059-3.06-1.192-1.19-3.059 3.058c-1.489 1.489-1.427 3.954.138 5.519s4.03 1.627 5.519.138l3.059-3.059-1.192-1.192-3.059 3.06c-.86.86-2.289.824-3.193-.08zm3.016-8.673l1.192 1.192 3.059-3.06c.86-.86 2.289-.824 3.193.08.905.905.94 2.334.08 3.194l-3.059 3.06 1.192 1.19 3.059-3.058c1.489-1.489 1.427-3.954-.138-5.519s-4.03-1.627-5.519-.138L9.786 8.557zm-1.023 6.68c.33.33.863.343 1.177.029l5.34-5.34c.314-.314.3-.846-.03-1.176-.33-.33-.862-.344-1.176-.03l-5.34 5.34c-.314.314-.3.846.03 1.177z" fill-rule="evenodd"></path>
|
|
</svg>
|
|
</span>
|
|
{{ .Destination | safeURL }}
|
|
</span>
|
|
</span>
|
|
<span class="card-link-image-cell">
|
|
<img class="card-link-image" alt="card-link icon" src="/lib/img/linkicon.png" />
|
|
</span>
|
|
</span>
|
|
{{- end -}}
|
|
</a> |