Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions module/hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ params:
siteProdUrl: "https://hugoguide.org"
supportEmail: "[email protected]"
githubUrl: "https://github.com/nkdAgility/HugoGuides"
previewSiteUrl: https://preview.hugoguides.org/
productionSiteUrl: https://hugoguides.org/
previewSiteUrl: https://preview.hugoguides.org
productionSiteUrl: https://hugoguides.org
brand:
bg_colour: "#135289"
AzureSitesConfig: "#{Guides_AzureSitesConfig}#"
Expand Down
36 changes: 26 additions & 10 deletions module/layouts/_partials/components/guide/render-guide.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
{{- $isComingSoon := and .Date (lt now .Date) (eq hugo.Environment "production") }}
{{- $isTranslationDraft := and .Params.translationDraft (eq hugo.Environment "production") }}
{{- $isTranslationPreview := .Params.translationDraft}}
{{- if $isTranslationDraft }}
{{- warnf "This guide is a translation draft and may not be fully complete or accurate." }}
{{- end }}

{{- /* Check if content is available */ -}}
{{- $contentAvailable := and .Page.Content (gt (len .Page.Content) 500) (not $isTranslationDraft) }}


<section class="my-2" style="max-width: 1200px; margin: 0 auto;">
<div class="row">
<!-- Sidebar with table of contents -->
Expand Down Expand Up @@ -44,7 +53,7 @@ <h4 class="h6 text-muted mb-3 flex-shrink-0 d-none d-md-block">{{ i18n "guide_ta

<!-- Collapsible TOC content -->
<div class="collapse d-md-block overflow-auto flex-grow-1" id="tocCollapse">
{{- if and .Page.Content (gt (len .Page.Content) 100) }}
{{- if $contentAvailable }}
{{ .Page.TableOfContents }}
{{ else }}
{{- /* Get the default guide content as fallback */ -}}
Expand All @@ -67,7 +76,8 @@ <h4 class="h6 text-muted mb-3 flex-shrink-0 d-none d-md-block">{{ i18n "guide_ta
<!-- Main content area -->
<main class="col-md-9">
<div class="content-wrapper px-3">
<article class="content-details">
<article class="content-details" nkda-data-contentavailable="{{ $contentAvailable }}">
{{- /* Header with title, date, and download buttons */ -}}
<header class="content-header">
<div class="row mb-2">
<div class="col-12 col-md-6"><h2 class="content-title mb-0">{{ .Title }}</h2></div>
Expand Down Expand Up @@ -180,9 +190,7 @@ <h4 class="h6 text-muted mb-3 flex-shrink-0 d-none d-md-block">{{ i18n "guide_ta
</div>
</header>
<div class="content-body pt-3">
{{- if $isComingSoon }}
<div class="alert alert-warning" role="alert">{{ i18n "guide_coming_soon" . }}</div>
{{ else }}

{{- /* Version notice for historical versions */ -}}
{{ partial "components/guide/guide-version-notice.html" . }}

Expand Down Expand Up @@ -227,7 +235,13 @@ <h4 class="h6 text-muted mb-3 flex-shrink-0 d-none d-md-block">{{ i18n "guide_ta
{{- end }}

{{- /* Check if content is empty and provide fallback */ -}}
{{- if .Content }}
{{- if $contentAvailable }}
{{- if $isTranslationPreview }}
<div class="alert alert-warning mb-4" role="alert">
<i class="fa-solid fa-exclamation-triangle me-2"></i>
<strong>{{ i18n "guide_translation_preview_note" . }}</strong> {{ i18n "guide_translation_preview_message" . | markdownify }}
</div>
{{- end -}}
{{ .Content }}
{{- else }}
{{- /* Get the default guide content as fallback */ -}}
Expand All @@ -237,11 +251,15 @@ <h4 class="h6 text-muted mb-3 flex-shrink-0 d-none d-md-block">{{ i18n "guide_ta
{{- if not $thisPageDefault }}
{{- fmt.Errorf "thisPageDefault page not found" }}
{{- end }}

{{- if $thisPageDefault }}
<div class="alert alert-info mb-4" role="alert">
<i class="fa-solid fa-info-circle me-2"></i>
<strong>{{ i18n "guide_content_unavailable_note" . }}</strong> {{ i18n "guide_content_unavailable_message" (dict "Language" .Site.Language.LanguageName) }}
{{- if $isTranslationPreview }}<br />
<a href="{{ .Site.Params.previewSiteUrl }}{{ .RelPermalink }}" target="_blank" class="alert-link">{{ i18n "guide_preview_link" . }}</a>
{{- end}}

</div>
<div lang="{{ $thisPageDefault.Language.Lang }}">
{{ $thisPageDefault.Content }}
Expand All @@ -254,8 +272,6 @@ <h4 class="h6 text-muted mb-3 flex-shrink-0 d-none d-md-block">{{ i18n "guide_ta
</div>
{{- end }}
{{- end }}

{{- end }}
</div>
<footer class="content-footer mt-4">
<div class="back-to-home mt-3">
Expand Down
17 changes: 15 additions & 2 deletions module/layouts/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,18 @@
{{/* Additional Meta Tags */}}
<meta name="giscus:backlink" content="{{ .Site.Params.siteProdUrl }}{{ .RelPermalink }}" />
<meta name="license" content="© {{ now.Format "2006" }} {{ .Site.Title }}." />

{{- $mainCss := resources.Get "css/style.css" -}}
{{ if $mainCss -}}
<link rel="stylesheet" href="{{ $mainCss.RelPermalink }}" />
{{- end -}}
{{- $langCode := .Site.Language.LanguageCode | default "en" -}}
{{- $langCssPath := printf "css/style.%s.css" $langCode -}}
{{- $langCss := resources.Get $langCssPath -}}
{{ if $langCss }}
<link rel="stylesheet" href="{{ $langCss.RelPermalink }}" />
{{- end }}
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-4Q6Gf2aSP4eDXB8Miphtr37CMZZQ5oXLH2yaXMJ2w8e2ZtHTl7GptT4jmndRuHDT" crossorigin="anonymous" />
<link rel="stylesheet" href="/css/style.css" />
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-j1CDi7MgGQ12Z7Qab0qlWQ/Qqz24Gc6BM0thvEMVjHnfYGF0rmFCozFSxQBxwHKO" crossorigin="anonymous"></script>
<script src="https://kit.fontawesome.com/3e6b2f4808.js" crossorigin="anonymous"></script>

Expand Down Expand Up @@ -261,6 +271,9 @@
return new bootstrap.Tooltip(tooltipTriggerEl);
});
</script>
<script src="/js/submenu.js"></script>
{{- $submenuJs := resources.Get "js/submenu.js" -}}
{{- if $submenuJs -}}
<script src="{{ $submenuJs.RelPermalink }}"></script>
{{- end -}}
</body>
</html>
2 changes: 1 addition & 1 deletion site/content/Guide1/2020.12/index.min.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ lang: min
mainfont: "Times New Banana"
sansfont: "Ari-Banana"
monofont: "Courier Peel"

translationDraft: true
sitemap:
priority: 0.6
---
Expand Down
5 changes: 5 additions & 0 deletions site/hugo.production.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Environment: "production"
minifyOutput: true

buildDrafts: true
buildFuture: true
4 changes: 2 additions & 2 deletions site/hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ params:
siteProdUrl: "https://hugoguide.org"
supportEmail: "[email protected]"
githubUrl: "https://github.com/nkdAgility/HugoGuides"
previewSiteUrl: https://preview.hugoguides.org/
productionSiteUrl: https://hugoguides.org/
previewSiteUrl: https://preview.hugoguides.org
productionSiteUrl: https://hugoguides.org
brand:
bg_colour: "#135289"
AzureSitesConfig: "#{Guides_AzureSitesConfig}#"
Expand Down
9 changes: 9 additions & 0 deletions site/i18n/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,15 @@
- id: guide_coming_label
translation: "Coming:"

- id: guide_translation_preview_note
translation: "Translation Preview:"

- id: guide_translation_preview_message
translation: "This guide is a translation preview and may not be fully complete or accurate. Please help us review and improve it, join the discussion."

- id: guide_preview_link
translation: "Help us review this translation"

- id: guide_updated_label
translation: "Updated:"

Expand Down
9 changes: 9 additions & 0 deletions site/i18n/min.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@
- id: read_online_button
translation: "Ready Ready"

- id: guide_translation_preview_note
translation: "Banana Translation Peek:"

- id: guide_translation_preview_message
translation: "Dis guide iz banana peek-a-boo, no finish-finish. You help? Join da blabla!"

- id: guide_preview_link
translation: "Help us review this translation"

- id: translations_title
translation: "Banana Talkies"

Expand Down