1- {{- $isComingSoon := and .Date (lt now .Date) (eq hugo.Environment "production") }}
1+ {{- $isTranslationDraft := and .Params.translationDraft (eq hugo.Environment "production") }}
2+ {{- $isTranslationPreview := .Params.translationDraft}}
3+ {{- if $isTranslationDraft }}
4+ {{- warnf "This guide is a translation draft and may not be fully complete or accurate." }}
5+ {{- end }}
6+
7+ {{- /* Check if content is available */ -}}
8+ {{- $contentAvailable := and .Page.Content (gt (len .Page.Content) 500) (not $isTranslationDraft) }}
9+
10+
211< section class ="my-2 " style ="max-width: 1200px; margin: 0 auto; ">
312 < div class ="row ">
413 <!-- Sidebar with table of contents -->
@@ -44,7 +53,7 @@ <h4 class="h6 text-muted mb-3 flex-shrink-0 d-none d-md-block">{{ i18n "guide_ta
4453
4554 <!-- Collapsible TOC content -->
4655 < div class ="collapse d-md-block overflow-auto flex-grow-1 " id ="tocCollapse ">
47- {{- if and .Page.Content (gt (len .Page.Content) 100) }}
56+ {{- if $contentAvailable }}
4857 {{ .Page.TableOfContents }}
4958 {{ else }}
5059 {{- /* Get the default guide content as fallback */ -}}
@@ -67,7 +76,8 @@ <h4 class="h6 text-muted mb-3 flex-shrink-0 d-none d-md-block">{{ i18n "guide_ta
6776 <!-- Main content area -->
6877 < main class ="col-md-9 ">
6978 < div class ="content-wrapper px-3 ">
70- < article class ="content-details ">
79+ < article class ="content-details " nkda-data-contentavailable ="{{ $contentAvailable }} ">
80+ {{- /* Header with title, date, and download buttons */ -}}
7181 < header class ="content-header ">
7282 < div class ="row mb-2 ">
7383 < div class ="col-12 col-md-6 "> < h2 class ="content-title mb-0 "> {{ .Title }}</ h2 > </ div >
@@ -180,9 +190,7 @@ <h4 class="h6 text-muted mb-3 flex-shrink-0 d-none d-md-block">{{ i18n "guide_ta
180190 </ div >
181191 </ header >
182192 < div class ="content-body pt-3 ">
183- {{- if $isComingSoon }}
184- < div class ="alert alert-warning " role ="alert "> {{ i18n "guide_coming_soon" . }}</ div >
185- {{ else }}
193+
186194 {{- /* Version notice for historical versions */ -}}
187195 {{ partial "components/guide/guide-version-notice.html" . }}
188196
@@ -227,7 +235,13 @@ <h4 class="h6 text-muted mb-3 flex-shrink-0 d-none d-md-block">{{ i18n "guide_ta
227235 {{- end }}
228236
229237 {{- /* Check if content is empty and provide fallback */ -}}
230- {{- if .Content }}
238+ {{- if $contentAvailable }}
239+ {{- if $isTranslationPreview }}
240+ < div class ="alert alert-warning mb-4 " role ="alert ">
241+ < i class ="fa-solid fa-exclamation-triangle me-2 "> </ i >
242+ < strong > {{ i18n "guide_translation_preview_note" . }}</ strong > {{ i18n "guide_translation_preview_message" . | markdownify }}
243+ </ div >
244+ {{- end -}}
231245 {{ .Content }}
232246 {{- else }}
233247 {{- /* Get the default guide content as fallback */ -}}
@@ -237,11 +251,15 @@ <h4 class="h6 text-muted mb-3 flex-shrink-0 d-none d-md-block">{{ i18n "guide_ta
237251 {{- if not $thisPageDefault }}
238252 {{- fmt.Errorf "thisPageDefault page not found" }}
239253 {{- end }}
240-
254+
241255 {{- if $thisPageDefault }}
242256 < div class ="alert alert-info mb-4 " role ="alert ">
243257 < i class ="fa-solid fa-info-circle me-2 "> </ i >
244258 < strong > {{ i18n "guide_content_unavailable_note" . }}</ strong > {{ i18n "guide_content_unavailable_message" (dict "Language" .Site.Language.LanguageName) }}
259+ {{- if $isTranslationPreview }}< br />
260+ < a href ="{{ .Site.Params.previewSiteUrl }}{{ .RelPermalink }} " target ="_blank " class ="alert-link "> {{ i18n "guide_preview_link" . }}</ a >
261+ {{- end}}
262+
245263 </ div >
246264 < div lang ="{{ $thisPageDefault.Language.Lang }} ">
247265 {{ $thisPageDefault.Content }}
@@ -254,8 +272,6 @@ <h4 class="h6 text-muted mb-3 flex-shrink-0 d-none d-md-block">{{ i18n "guide_ta
254272 </ div >
255273 {{- end }}
256274 {{- end }}
257-
258- {{- end }}
259275 </ div >
260276 < footer class ="content-footer mt-4 ">
261277 < div class ="back-to-home mt-3 ">
0 commit comments