mirror of
https://github.com/jackyzha0/quartz.git
synced 2026-03-24 15:05:42 -05:00
fix edge cases link processing
This commit is contained in:
parent
55d56e6b7c
commit
65ea36a768
@ -42,7 +42,24 @@
|
|||||||
<!-- remove subfolder from title -->
|
<!-- remove subfolder from title -->
|
||||||
{{$display := index (last 1 (split $display "/")) 0}}
|
{{$display := index (last 1 (split $display "/")) 0}}
|
||||||
|
|
||||||
{{$curpage := $page.GetPage $title}}
|
<!-- attempt to get title -->
|
||||||
|
{{$searchtitle := $title }}
|
||||||
|
{{$curpage := $page.GetPage $searchtitle }}
|
||||||
|
<!-- attempt to search md file instead -->
|
||||||
|
{{ if (eq $curpage.String "nopPage") }}
|
||||||
|
{{$searchtitle = (add $title ".md") }}
|
||||||
|
{{$curpage = $page.GetPage $searchtitle }}
|
||||||
|
{{ end }}
|
||||||
|
<!-- attempt to reverse typographer behaviour -->
|
||||||
|
{{ if (eq $curpage.String "nopPage") }}
|
||||||
|
{{$searchtitle = (replace $searchtitle "&" "&") }}
|
||||||
|
{{$searchtitle = (replace $searchtitle """ "\"") }}
|
||||||
|
{{$searchtitle = (replace $searchtitle "”" "\"") }}
|
||||||
|
{{$searchtitle = (replace $searchtitle "“" "\"") }}
|
||||||
|
{{$searchtitle = (replace $searchtitle "’" "'") }}
|
||||||
|
{{$searchtitle = (replace $searchtitle "‘" "'") }}
|
||||||
|
{{$curpage = $page.GetPage $searchtitle }}
|
||||||
|
{{ end }}
|
||||||
{{$relpath := relURL $path}}
|
{{$relpath := relURL $path}}
|
||||||
|
|
||||||
<!-- If path to Hugo page -->
|
<!-- If path to Hugo page -->
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user