feat(content): support complete local resource references (#388)

This commit is contained in:
Dillon
2020-05-28 17:05:37 +08:00
committed by GitHub
parent 0c1f7d0ef8
commit aa48df5edd
93 changed files with 872 additions and 714 deletions

View File

@@ -1,11 +1,11 @@
{{- $href := "" -}}
{{- with .url -}}
{{- $href = . | relLangURL -}}
{{- $destination := "" -}}
{{- with .Url -}}
{{- $destination = . | relLangURL -}}
{{- else -}}
{{- $template := .template | default "%v" -}}
{{- with .prefix -}}
{{- $template := .Template | default "%v" -}}
{{- with .Prefix -}}
{{- $template = . | strings.TrimSuffix "/" | printf "%v/%%v" -}}
{{- end -}}
{{- $href = printf (string $template) .id -}}
{{- $destination = printf (string $template) .Id -}}
{{- end -}}
{{- dict "href" $href "rel" "me" | merge . | partial "plugin/link.html" -}}
{{- dict "Destination" $destination "Rel" "me" | merge . | partial "plugin/link.html" -}}