Skip to content

Commit

Permalink
theme(fix): make social share link cache context dependent
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Kollitsch <patrick@davids-neighbour.com>
  • Loading branch information
davidsneighbour committed Oct 24, 2024
1 parent ae14ccf commit a5ff1b1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
<article class="flex-l flex-wrap justify-between mw8 center ph3">
<header class="mt4 w-100">
<aside class="instapaper_ignoref b helvetica tracked ttu">
{{/*
CurrentSection allows us to use the section title instead of inferring from the folder.
https://gohugo.io/variables/page/#section-variables-and-methods
*/}}
{{/*
CurrentSection allows us to use the section title instead of inferring from the folder.
https://gohugo.io/variables/page/#section-variables-and-methods
*/}}
{{ .CurrentSection.Title }}
</aside>
{{- partialCached "social/share.html" . . -}}
{{- partial "social/share.html" . -}}
<h1 class="f1 athelas mt3 mb1">
{{- .Title -}}
</h1>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/social/follow.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{{/* This here is an ugly workaround for GoHugo's missing sortByArray feature.
Let's cache it so it does not take away too much time.
PS: It's also a couple of years old, so maybe there is a better solution by now. */}}
{{- $setups = partials.IncludeCached "func/sortNetworks.html" (dict "networks" $networks "setups" $setups) "social-follow" -}}
{{- $setups = partials.IncludeCached "func/social/sortNetworks.html" (dict "networks" $networks "setups" $setups) "social-follow" -}}

<div class="ananke-socials">
{{- range $setups -}}
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/social/share.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{{/* This here is an ugly workaround for GoHugo's missing sortByArray feature.
Let's cache it so it does not take away too much time.
PS: It's also a couple of years old, so maybe there is a better solution by now. */}}
{{- $setups = partials.IncludeCached "func/sortNetworks.html" (dict "networks" $networks "setups" $setups) "social-share" -}}
{{- $setups = partials.IncludeCached "func/social/sortNetworks.html" (dict "networks" $networks "setups" $setups) "social-share" -}}

<div id="sharing" class="mt3 ananke-socials">
{{- range $setups -}}
Expand All @@ -34,7 +34,7 @@
{{/* @todo notification into CLI that a network is configured but not supported */}}
{{- end -}}
{{- $options := (dict "context" $context "setup" $setup) }}
{{- $href := partialCached "func/getShareLink.html" $options $options -}}
{{- $href := partialCached "func/social/getShareLink.html" $options $options -}}
<a href="{{ $href }}"
class="ananke-social-link {{ $setup.slug }} no-underline"
title="{{ $label }}" aria-label="{{ $label }}"
Expand Down

0 comments on commit a5ff1b1

Please sign in to comment.