Files
HugoBlox-kit/layouts/partials/share.html
T
Cassio Batista 0c36cdca45 feat(page): enable page sharing buttons to be customized
To customise sharing buttons, override `themes/academic/data/page_sharer.toml` by copying the file to `data/page_sharer.toml` at the root of a site and editing the copy.

Close #1108
Close #1131
2019-06-15 17:23:08 +01:00

21 lines
737 B
HTML

{{ if and site.Params.sharing (ne .Params.share false) }}
<div class="share-box" aria-hidden="true">
<ul class="share">
{{ range where site.Data.page_sharer.buttons "enable" true }}
{{ $pack := or .icon_pack "fas" }}
{{ $pack_prefix := $pack }}
{{ if in (slice "fab" "fas" "far" "fal") $pack }}
{{ $pack_prefix = "fa" }}
{{ end }}
{{ $link := replace .url "{url}" ($.Permalink | htmlEscape) }}
{{ $link = replace $link "{title}" ($.Title | htmlEscape) }}
<li>
<a href="{{$link|safeURL}}" target="_blank" rel="noopener" class="share-btn-{{.id}}">
<i class="{{$pack}} {{$pack_prefix}}-{{.icon}}"></i>
</a>
</li>
{{ end }}
</ul>
</div>
{{ end }}