Hugo で Wikilinks 記法([[]] こんな感じで brackets で囲むリンク) を有効にする
ここに書いてある方法でいけた
https://quinncasey.com/hugo-wikilink-support/
/layouts/partials/content-wikilinks.htmlを作成し、先述のサイトのコードを配置- hugo で使用しているテーマの
single.htmlをオーバーライド (/layouts/_default/single.htmlにコピー) single.html内で{{ .Content }}としてブログ本文を出力している箇所を、{{- partial "content-with-wikilinks" . -}}に置き換え
これで動きました
試しに Wikilinks記法で About や Search in this site に飛んでみるテスト
{{ $wikiregexWithText := "\\[\\[([^\\]\\|\\r\\n]+?)\\|([^\\]\\|\\r\\n]+?)\\]\\]" }}
{{ $wikiregex := "\\[\\[([^\\]\\|\\r\\n]+?)\\]\\]" }}
{{ $page := .Page }}
{{ $pageContent := .Content }}
{{ range ($wikilinks := .Content | findRE $wikiregex) }}
{{ $link := . | replaceRE $wikiregex "$1" }}
{{ $wikilink := printf "\\[\\[%s\\]\\]" $link }}
{{ with relref $page $link }}
{{ $link := printf "%s%s%s%s%s" "<a href=\"" . "\">" ($.Site.GetPage $link).Title "</a>" }}
{{ $pageContent = $pageContent | replaceRE $wikilink $link }}
{{ end }}
{{ end }}
{{ range ($pageContent | findRE $wikiregexWithText) }}
{{ $link := . | replaceRE $wikiregexWithText "$1" }}
{{ $text := . | replaceRE $wikiregexWithText "$2" }}
{{ $wikilink := printf "\\[\\[%s\\|%s\\]\\]" $link $text }}
{{ with relref $page $link }}
{{ $link := printf "%s%s%s%s%s" "<a href=\"" . "\">" $text "</a>" }}
{{ $pageContent = $pageContent | replaceRE $wikilink $link }}
{{ end }}
{{ end }}
{{ $pageContent | safeHTML }}