Skip to content

Commit 942578e

Browse files
committed
add conditional to alerts to handle both english and translation pages
[deploy site]
1 parent 8c9b049 commit 942578e

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

website_and_docs/layouts/shortcodes/alert-code.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{{ $code := .Site.Language }}
22
{{ $p1 := "This section could use some updated code examples" }}
33
{{ $p2 := printf "%s" .Inner }}
4-
{{ $p3 := printf "Check our [contribution guidelines](/documentation/about/contributing/) and [code example formats](/documentation/about/style#code-examples) if you'd like to help." }}
4+
{{ $p3 := printf "Check our [contribution guidelines](/%s/documentation/about/contributing/) and [code example formats](/%s/documentation/about/style#code-examples) if you'd like to help." $code $code }}
5+
{{ if in $code "en" }}
6+
{{ $p3 = printf "Check our [contribution guidelines](/documentation/about/contributing/) and [code example formats](/documentation/about/style#code-examples) if you'd like to help." }}
7+
{{ end }}
8+
59

610
{{ if $p2 }}
711
{{ partial "alerts.html" (dict "alert_type" "note" "color" "orange" "title" "Coding Help" "p1" $p1 "p2" $p2 "p3" $p3) }}

website_and_docs/layouts/shortcodes/alert-content.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{{ $code := .Site.Language }}
22
{{ $p1 := "This section needs additional and/or updated content" }}
33
{{ $p2 := printf "%s" .Inner }}
4-
{{ $p3 := printf "Check our [contribution guidelines](/documentation/about/contributing) if you'd like to help." }}
4+
{{ $p3 := printf "Check our [contribution guidelines](/%s/documentation/about/contributing) if you'd like to help." $code }}
5+
{{ if in $code "en" }}
6+
{{ $p3 = printf "Check our [contribution guidelines](/documentation/about/contributing/) if you'd like to help." }}
7+
{{ end }}
58

69
{{ if $p2 }}
710
{{ partial "alerts.html" (dict "alert_type" "note" "color" "cyan" "title" "Content Help" "p1" $p1 "p2" $p2 "p3" $p3) }}

0 commit comments

Comments
 (0)