Skip to content

Commit acd6c29

Browse files
authored
theme: Use page Path when generating Markdown links
Closes #3261
1 parent 543f783 commit acd6c29

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

‎layouts/_shortcodes/list-pages-in-section.html‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
@param {string} [filterType=""] The type of filter, either include or exclude.
1515
@param {string} [titlePrefix=""] The string to prepend to the link title.
1616

17-
@example {{< list-pages-in-section path=/methods/resources >}}
18-
@example {{< list-pages-in-section path=/functions/images filter=some_filter filterType=exclude >}}
19-
@example {{< list-pages-in-section path=/functions/images filter=some_filter filterType=exclude titlePrefix=foo >}}
17+
@example {{% list-pages-in-section path=/methods/resources %}}
18+
@example {{% list-pages-in-section path=/functions/images filter=some_filter filterType=exclude %}}
19+
@example {{% list-pages-in-section path=/functions/images filter=some_filter filterType=exclude titlePrefix=foo %}}
2020
*/}}
2121

2222
{{/* Initialize. */}}
@@ -54,7 +54,8 @@
5454
{{ with $titlePrefix }}
5555
{{ $linkTitle = printf "%s%s" . $linkTitle }}
5656
{{ end }}
57-
[{{ $linkTitle }}]({{ $page.RelPermalink }}){{/* Do not indent. */}}
57+
{{/* Use page Path as the link destination for render hook to resolve correctly. */}}
58+
[{{ $linkTitle }}]({{ $page.Path }}){{/* Do not indent. */}}
5859
: {{ $page.Description }}{{/* Do not indent. */}}
5960
{{ end }}
6061
{{ end }}

‎layouts/_shortcodes/quick-reference.html‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
{{ .Content }}
2121
{{ with .Pages }}
2222
{{ range . }}
23-
[{{ .LinkTitle }}]({{ .RelPermalink }}){{/* Do not indent. */}}
23+
{{/* Use page Path as the link destination for render hook to resolve correctly. */}}
24+
[{{ .LinkTitle }}]({{ .Path }}){{/* Do not indent. */}}
2425
: {{ .Description }}{{/* Do not indent. */}}
2526
{{ end }}
2627
{{ end }}

0 commit comments

Comments
 (0)