Merge pull request #121 from benbohmer/patch-1

hugo
Jacky Zhao 3 years ago committed by GitHub
commit 321e19dc41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -7,7 +7,7 @@
{{$spacedurl := replace $trimmed "%20" " " }}
{{$fixedUrl := (cond (hasPrefix $spacedurl "/") $spacedurl (print "/" $spacedurl)) | urlize}}
{{$nonexistent := eq (.Page.GetPage $spacedurl).RelPermalink ""}}
{{$rooted := default $spacedurl (strings.TrimRight "/" (.Page.GetPage $spacedurl).RelPermalink) }}
{{$rooted := default $spacedurl ((.Page.GetPage $spacedurl).RelPermalink) }}
<a
{{if not $nonexistent}}href="{{$rooted}}"{{end}}
rel="noopener" class="internal-link{{if $nonexistent}} broken{{end}}"

Loading…
Cancel
Save