This repository has been archived on 2026-05-22. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blowfish/layouts/partials/sharing-links.html
T
2026-02-25 23:13:16 +08:00

23 lines
1.0 KiB
HTML

{{ with .Params.sharingLinks | default (.Site.Params.article.sharingLinks | default false) }}
{{ $links := site.Data.sharing }}
<section class="flex flex-row flex-wrap justify-center pt-4 text-xl">
{{ range . }}
{{ with index $links . }}
{{ $isEmail := eq .icon "email" }}
<a
class="{{ cond $isEmail "email-link" "" }} m-1 rounded bg-neutral-300 p-1.5 text-neutral-700 hover:bg-primary-500 hover:text-neutral dark:bg-neutral-700 dark:text-neutral-300 dark:hover:bg-primary-400 dark:hover:text-neutral-800"
target="_blank"
href="{{ cond $isEmail "#" (printf .url $.Permalink $.Title | safeURL) }}"
{{ if $isEmail }}
data-email="{{ $.Site.Params.Author.email | base64Encode }}"
data-subject="{{ replace (printf "Reply to %s" $.Title) "\"" "'" }}"
{{ end }}
title="{{ i18n .title }}"
aria-label="{{ i18n .title }}">
{{ partial "icon.html" .icon }}
</a>
{{ end }}
{{ end }}
</section>
{{ end }}