mirror of https://github.com/theNewDynamic/gohugo-theme-ananke.git

Melroy van den Berg
24.58.2024 473c7c14c68d3e5a97dee31138a2b176c7ac2302
theme(fix): remove caching of share links (#757)

You can't just cache the share links, that will result into every blog
post having the same URL.

Just use `partial` on the getShareLink.html. So now each post will show
the correct URL to share the post via social media or alike.

---------

Signed-off-by: Melroy van den Berg <melroy@melroy.org>
Signed-off-by: Patrick Kollitsch <83281+davidsneighbour@users.noreply.github.com>
Co-authored-by: Patrick Kollitsch <83281+davidsneighbour@users.noreply.github.com>
1 files modified
4 ■■■■ changed files
layouts/partials/social/share.html 4 ●●●● patch | view | raw | blame | history
layouts/partials/social/share.html
@@ -33,8 +33,8 @@
        {{- continue -}}
        {{/* @todo notification into CLI that a network is configured but not supported */}}
      {{- end -}}
      {{- $options := (dict "context" $context "setup" $setup) }}
      {{- $href := partialCached "func/social/getShareLink.html" $options $options -}}
      {{- $options := (dict "context" page "setup" $setup) }}
      {{- $href := partial "func/social/getShareLink.html" $options -}}
      <a href="{{ $href }}"
        class="ananke-social-link {{ $setup.slug }} no-underline"
        title="{{ $label }}" aria-label="{{ $label }}"