diff --git a/config.yaml b/config.yaml index 63a1ed7..3d8325f 100644 --- a/config.yaml +++ b/config.yaml @@ -3,7 +3,7 @@ module: hugoVersion: extended: true - min: 0.91.2 + min: 0.115.1 frontmatter: date: @@ -24,6 +24,7 @@ related: # non-standard: escaped JSON lines # with \\n and \\t for import to PostgreSQL jsonb column +# see `sql` directory mediaTypes: x-text/ejsonl: suffixes: @@ -35,4 +36,3 @@ outputFormats: isPlainText: true mediaType: x-text/ejsonl - diff --git a/layouts/shortcodes/ilink.html b/layouts/shortcodes/ilink.html index 45ee63c..ebcc538 100644 --- a/layouts/shortcodes/ilink.html +++ b/layouts/shortcodes/ilink.html @@ -1,13 +1,15 @@ {{- $pid := or (.Get "pid") (.Get "page") -}} {{- $frag := or (.Get "id") (.Get "anchor") -}} {{- $this := $.Page -}} +{{- $linkid := or ($this.Scratch.Get "linkid") 1 -}} +{{- $this.Scratch.Set "linkid" (add $linkid 1) -}} {{- $pages := where .Site.RegularPages "Params.pageid" "eq" $pid -}} {{- $fragsep := cond (eq $frag "") "" "#" -}} {{- $inner := .Inner -}} {{- range $pages -}} {{- $url := printf "%s%s%s" .Permalink $fragsep $frag -}} {{- $text := or $inner .Title -}} - {{- $anchor := $text | anchorize -}} + {{- $anchor := printf "link-%d" $linkid -}} {{ $text | markdownify }} {{- .Scratch.Add "backlinks" (slice (dict "anchor" $anchor "page" $this)) -}}