ilink shortcode: add prefix parameter
This commit is contained in:
parent
760f561874
commit
3d541cb37c
1 changed files with 2 additions and 1 deletions
|
@ -7,6 +7,7 @@
|
||||||
{{- $fragsep := cond (eq $frag "") "" "#" -}}
|
{{- $fragsep := cond (eq $frag "") "" "#" -}}
|
||||||
{{- $btext := or (.Get "btext") (printf "%d" $linkid) -}}
|
{{- $btext := or (.Get "btext") (printf "%d" $linkid) -}}
|
||||||
{{- $btitle := .Get "btitle" -}}
|
{{- $btitle := .Get "btitle" -}}
|
||||||
|
{{- $prefix := .Get "prefix" -}}
|
||||||
{{- $anchor := printf "link-%d" $linkid -}}
|
{{- $anchor := printf "link-%d" $linkid -}}
|
||||||
{{- $inner := .Inner -}}
|
{{- $inner := .Inner -}}
|
||||||
{{- $linkTitle := (.Get "title") -}}
|
{{- $linkTitle := (.Get "title") -}}
|
||||||
|
@ -14,6 +15,6 @@
|
||||||
{{- $url := printf "%s%s%s" .Permalink $fragsep $frag -}}
|
{{- $url := printf "%s%s%s" .Permalink $fragsep $frag -}}
|
||||||
{{- $text := or $inner .Title -}}
|
{{- $text := or $inner .Title -}}
|
||||||
<a id="{{ $anchor }}"{{ with $linkTitle }} title="{{ . }}"{{ end }}
|
<a id="{{ $anchor }}"{{ with $linkTitle }} title="{{ . }}"{{ end }}
|
||||||
href="{{ $url }}">{{ $text | markdownify }}</a>
|
href="{{ $url }}">{{ with $prefix }}{{ markdownify . }} {{ end }}{{ $text | markdownify }}</a>
|
||||||
{{- .Scratch.Add "backlinks" (slice (dict "anchor" $anchor "page" $this "btext" $btext "btitle" $btitle)) -}}
|
{{- .Scratch.Add "backlinks" (slice (dict "anchor" $anchor "page" $this "btext" $btext "btitle" $btitle)) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
Loading…
Add table
Reference in a new issue