mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
22 lines
840 B
HTML
22 lines
840 B
HTML
{{- /*
|
|
Social profile link helper.
|
|
- Builds destination from explicit Url or from Prefix/Template/Id.
|
|
- Delegates final rendering to plugin/link.html with rel=me.
|
|
@param {String} [.Url] explicit target URL
|
|
@param {String} [.Template] URL template containing one %%v placeholder
|
|
@param {String} [.Prefix] URL prefix used to build Template
|
|
@param {String} [.Id] account id used by Template
|
|
*/ -}}
|
|
|
|
{{- $destination := "" -}}
|
|
{{- with .Url -}}
|
|
{{- $destination = . | relLangURL -}}
|
|
{{- else -}}
|
|
{{- $template := .Template | default "%v" -}}
|
|
{{- with .Prefix -}}
|
|
{{- $template = . | strings.TrimSuffix "/" | printf "%v/%%v" -}}
|
|
{{- end -}}
|
|
{{- $destination = printf (string $template) .Id -}}
|
|
{{- end -}}
|
|
{{- dict "Destination" $destination "Rel" "me" "ExternalIcon" false | merge . | partial "plugin/link.html" -}}
|