Skip to content

Commit df519b4

Browse files
committed
Resolve community and footer links paths
1 parent 4a09247 commit df519b4

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

docsy.dev/config/_default/params.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# status: archived # Then fetch include
88

99
version: &docsyVersion 0.14.4-dev
10-
tdBuildId: 019-over-main-c03fc161
10+
tdBuildId: 020-over-main-4a09247b
1111
versionLatest: &versionLatest v0.14.3
1212
version_menu: *docsyVersion
1313
version_menu_pagelinks: true

layouts/_partials/community_links.html

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ <h2>{{ T "community_develop" }}</h2>
1717
{{ end }}
1818
<p>
1919
{{ T "community_how_to" . }}
20-
<a href="{{ $contribUrl | relURL }}">{{ T "community_guideline" }}</a>.
20+
{{ $url := $contribUrl -}}
21+
{{ $isExternal := (urls.Parse $url).IsAbs -}}
22+
{{ if not $isExternal -}}
23+
{{ with site.GetPage $url }}{{ $url = .RelPermalink }}{{ end -}}
24+
{{ end -}}
25+
<a href="{{ $url | relURL }}">{{ T "community_guideline" }}</a>.
2126
</p>
2227
</div>
2328
</section>
@@ -26,8 +31,12 @@ <h2>{{ T "community_develop" }}</h2>
2631
<ul>
2732
{{ range . -}}
2833
<li title="{{ .name }}">
29-
{{ $isExternal := hasPrefix .url "http" -}}
30-
<a href="{{ .url }}"
34+
{{ $url := .url -}}
35+
{{ $isExternal := (urls.Parse $url).IsAbs -}}
36+
{{ if not $isExternal -}}
37+
{{ with site.GetPage .url }}{{ $url = .RelPermalink }}{{ end -}}
38+
{{ end -}}
39+
<a href="{{ $url | relURL }}"
3140
{{- if $isExternal }} target="_blank" rel="noopener" {{- end -}}
3241
> {{/**/ -}}
3342
<i class="{{ .icon }}"></i> {{ .name -}}

layouts/_partials/footer/links.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
<ul class="td-footer__links-list">
22
{{ range . }}
33
{{ $rel := .rel | string -}}
4-
{{ $isExternal := hasPrefix .url "http" -}}
4+
{{ $url := .url -}}
5+
{{ $isExternal := (urls.Parse $url).IsAbs -}}
56
{{ if $isExternal -}}
67
{{ $rel = cond $rel (add $rel " noopener") "noopener" -}}
8+
{{ else -}}
9+
{{ with site.GetPage $url }}{{ $url = .RelPermalink }}{{ end -}}
710
{{ end -}}
811
<li class="td-footer__links-item" data-bs-toggle="tooltip" title="{{ .name }}" aria-label="{{ .name }}">
9-
<a href="{{ .url }}" aria-label="{{ .name }}"
12+
<a href="{{ $url }}" aria-label="{{ .name }}"
1013
{{- if $isExternal }} target="_blank" {{- end -}}
1114
{{ with $rel }} rel="{{ . }}" {{- end -}}
1215
>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "docsy",
3-
"version": "0.14.4-dev+019-over-main-c03fc161",
3+
"version": "0.14.4-dev+020-over-main-4a09247b",
44
"repository": "github:google/docsy",
55
"homepage": "https://www.docsy.dev",
66
"license": "Apache-2.0",

0 commit comments

Comments
 (0)