Skip to content

Commit 8814cc5

Browse files
committed
fix: 修正 relURL shortcode 根路徑在子路徑部署時指向錯誤
1 parent 69e0165 commit 8814cc5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

layouts/_shortcodes/relURL.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,9 @@
1111
{{- if $res -}}
1212
{{- if $absolute }}{{ $res.Permalink }}{{ else }}{{ $res.RelPermalink }}{{ end -}}
1313
{{- else -}}
14-
{{- if $absolute }}{{ $path | absURL }}{{ else }}{{ $path | relURL }}{{ end -}}
14+
{{- if eq $path "/" -}}
15+
{{- if $absolute }}{{ "" | absURL }}{{ else }}{{ "" | relURL }}{{ end -}}
16+
{{- else -}}
17+
{{- if $absolute }}{{ $path | absURL }}{{ else }}{{ $path | relURL }}{{ end -}}
18+
{{- end -}}
1519
{{- end -}}

0 commit comments

Comments
 (0)