File tree Expand file tree Collapse file tree 4 files changed +48
-225
lines changed
Expand file tree Collapse file tree 4 files changed +48
-225
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ <h6 class="card-title mb-2">
146146 </ div >
147147
148148 <!-- Desktop Row -->
149- < div class ="row d-none d-md-flex align-items-center py-3 border-bottom ">
149+ < div class ="row d-none d-md-flex align-items-center py-3 border-bottom " {{ if eq hugo.Environment "development" -}}title=" ReadOnline:={{ .ReadOnline }} | ReadPDF:={{ .ReadPDF }} " {{- end -}} >
150150 < div class ="col-md-4 ">
151151 {{ .LanguageName }}
152152 {{- if .Date }}
Original file line number Diff line number Diff line change 5353 {{ $parts := split $pdfName "." }}
5454 {{ if ge (len $parts) 3 }}
5555 {{ $langFromPDF := index $parts (sub (len $parts) 2) }}
56- {{ $pdfsByLang = merge $pdfsByLang (dict $langFromPDF .) }}
56+ {{ $pdfsByLang = merge $pdfsByLang (dict (lower $langFromPDF) .) }}
5757 {{ end }}
5858{{ end }}
5959
7070 {{ end }}
7171 {{ end }}
7272 {{ $page := index $translationsByLang $lang }}
73- {{ $pdfResource := index $pdfsByLang $lang }}
73+
74+ // Look up PDF by normalized lang
75+ {{ $langKey := lower $lang }}
76+ {{ $pdfResource := index $pdfsByLang $langKey }}
77+
78+ // Fallback: check the translation page’s own resources
79+ {{ if (and (not $pdfResource) $page) }}
80+ {{ $pagePdfResources := $page.Resources.Match $pdfPattern }}
81+ {{ if gt (len $pagePdfResources) 0 }}
82+ {{ $pdfResource = index $pagePdfResources 0 }}
83+ {{ end }}
84+ {{ end }}
7485
7586 {{/* Check if content is available for reading online */}}
7687 {{ $hasContent := false }}
Original file line number Diff line number Diff line change 7474 description : " Subscribe to our RSS feed"
7575
7676outputs :
77- home : [html, json, rss]
78- section : [html, rss]
79- taxonomy : [html, rss]
80- term : [html, rss]
81- page : [html, rss]
77+ home :
78+ - html
79+ - json
80+ - rss
81+ - languages
82+ - translations
83+ section :
84+ - html
85+ - rss
86+ - guide-translations
87+ taxonomy :
88+ - html
89+ - rss
90+ term :
91+ - html
92+ - rss
93+ page :
94+ - html
95+ - rss
8296
8397outputFormats :
8498 json :
85- mediaType : " application/json"
86- baseName : " pages"
99+ mediaType : application/json
100+ baseName : pages
101+ translations :
102+ mediaType : application/json
103+ baseName : translations
104+ languages :
105+ mediaType : application/json
106+ baseName : languages
107+ isPlainText : true
108+ guide-translations :
109+ mediaType : application/json
110+ baseName : guide-translations
111+ isPlainText : true
87112
88113module :
89114 imports :
@@ -95,6 +120,8 @@ module:
95120 mounts :
96121 - source : content
97122 target : content
123+ - source : i18n
124+ target : i18n
98125 - path : github.com/nkdAgility/HugoGuides/module
99126 replacements :
100127 - github.com/nkdAgility/HugoGuides/module -> ../../module
You can’t perform that action at this time.
0 commit comments