The theme uses `.Site.Params.social` for Twitter Cards and possible other things. To avoid the name clash, this change places configuration under `.Site.Params.share` and `xparams.share`.
28 lines
1.0 KiB
HTML
28 lines
1.0 KiB
HTML
{{- /* layouts/partials/share-render.html */ -}}
|
|
{{- $parent := . -}}
|
|
{{- $platforms := .platforms -}}
|
|
{{- $ctx := .context -}}
|
|
{{- if gt (len $platforms) 0 -}}
|
|
<div class="social-sharing">
|
|
{{- range $platformName := $platforms -}}
|
|
{{- $cfg := index $ctx.Site.Params.share $platformName | default dict -}}
|
|
{{- /* Merge dynamic elements with the explicit configuration */ -}}
|
|
{{- $merged := merge
|
|
(dict
|
|
"pageTitle" $ctx.Title
|
|
"pagePermalink" $ctx.Permalink
|
|
"platform" $platformName
|
|
)
|
|
$cfg
|
|
-}}
|
|
{{- $partialName := printf "share-platform-%s.html" $platformName -}}
|
|
{{- if templates.Exists (printf "partials/%s" $partialName) -}}
|
|
{{- partial $partialName $merged -}}
|
|
{{- else -}}
|
|
{{- partial "share-platform-generic.html" $merged -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{ partialCached "share-style" "share-style.html" "share-style" }}
|
|
</div>
|
|
{{- end -}}
|