ananke/layouts/partials/func/social/getShareLink.html
Patrick Kollitsch ae14ccf407
docs(fix): update theme.toml with min version and authors
Signed-off-by: Patrick Kollitsch <patrick@davids-neighbour.com>
2024-10-24 15:28:55 +07:00

25 lines
1 KiB
HTML

{{- $context := .context -}}
{{- $setup := .setup -}}
{{- $separator := "&" -}}
{{- $title := $context.Title | transform.HTMLEscape -}}
{{- $description := $context.Summary | transform.Plainify | transform.HTMLEscape -}}
{{- $permalink := $context.Permalink | transform.HTMLEscape -}}
{{- with $setup.separator -}}
{{- $separator = . -}}
{{- end -}}
{{- $link := fmt.Printf "%s%s" $setup.link "?" -}}
{{- range $key, $value := $setup.particles -}}
{{- if compare.Eq $key "params" -}}
{{- $link = fmt.Printf "%s%s%s" $permalink $separator $value -}}
{{- else -}}
{{- if compare.Eq $value "description" -}}
{{- $link = fmt.Printf "%s%s%s" $link $separator (collections.Querify $key $description) -}}
{{- else if compare.Eq $value "title" -}}
{{- $link = fmt.Printf "%s%s%s" $link $separator (collections.Querify $key $title) -}}
{{- else if compare.Eq $value "permalink" -}}
{{- $link = fmt.Printf "%s%s%s" $link $separator (collections.Querify $key $permalink) -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- return $link -}}