mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-16 02:15:13 +00:00
feat: standardize site params to schema v2
BREAKING CHANGE: Restructures `params.yaml`. Refer to v0.11.0 Migration Guide at https://docs.hugoblox.com
This commit is contained in:
1 parent
e754a714ea
commit
373eb7966e
50 files changed
+1737
-664
No files matched your search
@@ -1,4 +1,4 @@
|
||||
{{ $baidu_tongji := site.Params.marketing.analytics.baidu_tongji | default "" }}
|
||||
{{ $baidu_tongji := site.Params.hugoblox.analytics.baidu.site_id | default "" }}
|
||||
|
||||
{{ if hugo.IsProduction | and $baidu_tongji }}
|
||||
<script>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{ $fathom := site.Params.marketing.analytics.fathom | default "" }}
|
||||
{{ $fathom := site.Params.hugoblox.analytics.fathom.site_id | default "" }}
|
||||
|
||||
{{ if hugo.IsProduction | and $fathom }}
|
||||
<script src="https://cdn.usefathom.com/script.js" data-site="{{$fathom}}" defer></script>
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
{{ $ga := site.Params.marketing.analytics.google_analytics | default "" }}
|
||||
{{ $ga := site.Params.hugoblox.analytics.google.measurement_id | default "" }}
|
||||
|
||||
{{ if hugo.IsProduction | and $ga }}
|
||||
|
||||
{{ $gtag_config := cond (site.Params.features.privacy_pack.enable | default false) "{ 'anonymize_ip': true }" "{}" }}
|
||||
{{ $gtag_config := cond (site.Params.hugoblox.privacy.anonymize_analytics | default true) "{ 'anonymize_ip': true }" "{}" }}
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{$ga}}"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
{{ $gt := site.Params.marketing.analytics.google_tag_manager | default "" }}
|
||||
{{ $gt := site.Params.hugoblox.analytics.google_tag_manager.container_id | default "" }}
|
||||
{{ if hugo.IsProduction | and $gt }}
|
||||
<script>
|
||||
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
{{ $clarity := site.Params.marketing.analytics.microsoft_clarity | default "" }}
|
||||
{{ $clarity := site.Params.hugoblox.analytics.clarity.project_id | default "" }}
|
||||
{{ if hugo.IsProduction | and $clarity }}
|
||||
<script>
|
||||
(function(c,l,a,r,i,t,y){
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{ $pirsch := site.Params.marketing.analytics.pirsch | default "" }}
|
||||
{{ $pirsch := site.Params.hugoblox.analytics.pirsch.site_id | default "" }}
|
||||
|
||||
{{ if hugo.IsProduction | and $pirsch }}
|
||||
<script defer src="https://api.pirsch.io/pirsch.js" id="pirschjs" data-code="{{$pirsch}}"></script>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{ $plausible := site.Params.marketing.analytics.plausible | default "" }}
|
||||
{{ $plausible := site.Params.hugoblox.analytics.plausible.domain | default "" }}
|
||||
|
||||
{{ if hugo.IsProduction | and $plausible }}
|
||||
<script defer data-domain="{{$plausible}}" src="https://plausible.io/js/script.js"></script>
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
{{/* Site Verification with Third Party Services */}}
|
||||
|
||||
{{- with site.Params.marketing.verification.google -}}
|
||||
{{- with site.Params.hugoblox.verification.google -}}
|
||||
<meta name="google-site-verification" content="{{ . }}" />
|
||||
{{- end -}}
|
||||
|
||||
{{- with site.Params.marketing.verification.bing -}}
|
||||
{{- with site.Params.hugoblox.verification.bing -}}
|
||||
<meta name="msvalidate.01" content="{{ . }}" />
|
||||
{{- end -}}
|
||||
|
||||
{{- with site.Params.marketing.verification.yandex -}}
|
||||
{{- with site.Params.hugoblox.verification.yandex -}}
|
||||
<meta name="yandex-verification" content="{{ . }}" />
|
||||
{{- end -}}
|
||||
|
||||
{{- with site.Params.marketing.verification.pinterest -}}
|
||||
{{- with site.Params.hugoblox.verification.pinterest -}}
|
||||
<meta name="p:domain_verify" content="{{ . }}" />
|
||||
{{- end -}}
|
||||
|
||||
{{- with site.Params.marketing.verification.baidu -}}
|
||||
{{- with site.Params.hugoblox.verification.baidu -}}
|
||||
<meta name="baidu-site-verification" content="{{ . }}" />
|
||||
{{- end -}}
|
||||
|
||||
{{ with site.Params.marketing.verification.naver }}
|
||||
{{ with site.Params.hugoblox.verification.naver }}
|
||||
<meta name="naver-site-verification" content="{{ . }}" />
|
||||
{{- end -}}
|
||||
@@ -1,8 +1,9 @@
|
||||
{{- $csp_policy := site.Params.security.csp.policy | default "" -}}
|
||||
{{- $csp_report_only := site.Params.security.csp.report_only | default false -}}
|
||||
{{- $allow_frame := site.Params.security.allow_frame | default false -}}
|
||||
{{- $csp_policy := site.Params.hugoblox.security.csp.policy | default "" -}}
|
||||
{{- $csp_report_only := site.Params.hugoblox.security.csp.report_only | default false -}}
|
||||
{{- $frame_options := site.Params.hugoblox.security.frame_options | default "deny" -}}
|
||||
{{- $allow_frame := eq $frame_options "allow" -}}
|
||||
{{- $default_perms := "accelerometer=(), camera=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), payment=(), usb=()" -}}
|
||||
{{- $permissions_policy := site.Params.security.permissions.policy | default $default_perms -}}
|
||||
{{- $permissions_policy := site.Params.hugoblox.security.permissions_policy | default $default_perms -}}
|
||||
# Netlify headers
|
||||
# Automatically generated
|
||||
# Documentation: https://docs.hugoblox.com/hugo-tutorials/security/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{ $provider := trim (site.Params.features.comment.provider | lower) " " }}
|
||||
{{ $provider := trim (site.Params.hugoblox.comments.provider | lower) " " }}
|
||||
|
||||
{{ if $provider }}
|
||||
{{ $provider_tpl := printf "comments/%s.html" $provider }}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<div id="commento"></div>
|
||||
{{ $url := (printf "%s/js/commento.js" (site.Params.features.comment.commento.url | default "https://cdn.commento.io")) }}
|
||||
{{ $url := (printf "%s/js/commento.js" (site.Params.hugoblox.comments.commento.url | default "https://cdn.commento.io")) }}
|
||||
<script src="{{$url}}" defer></script>
|
||||
@@ -1,4 +1,4 @@
|
||||
{{ if site.Params.features.comment.disqus.shortname }}
|
||||
{{ if site.Params.hugoblox.comments.disqus.shortname }}
|
||||
<div id="disqus_thread"></div>
|
||||
<script>
|
||||
var disqus_config = function () {
|
||||
@@ -12,7 +12,7 @@
|
||||
return;
|
||||
}
|
||||
var d = document, s = d.createElement('script'); s.async = true;
|
||||
s.src = 'https://' + {{site.Params.features.comment.disqus.shortname}} + '.disqus.com/embed.js';
|
||||
s.src = 'https://' + {{site.Params.hugoblox.comments.disqus.shortname}} + '.disqus.com/embed.js';
|
||||
s.setAttribute('data-timestamp', +new Date());
|
||||
(d.head || d.body).appendChild(s);
|
||||
})();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{{ if site.Params.features.comment.giscus }}
|
||||
{{ $config := site.Params.features.comment.giscus }}
|
||||
{{ if site.Params.hugoblox.comments.giscus }}
|
||||
{{ $config := site.Params.hugoblox.comments.giscus }}
|
||||
<script src="https://giscus.app/client.js"
|
||||
data-repo="{{$config.repo}}"
|
||||
data-repo-id="{{$config.repo_id}}"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{ $show_translations := site.Params.footer.show_translations | default true }}
|
||||
{{ $show_translations := site.Params.hugoblox.footer.language_switcher | default true }}
|
||||
{{ if .IsTranslated | and $show_translations }}
|
||||
<div class="mx-auto flex gap-3 py-2 px-4">
|
||||
<div class="font-bold">
|
||||
@@ -24,7 +24,7 @@
|
||||
</p>
|
||||
{{ end }}
|
||||
|
||||
{{ with site.Params.footer.text }}
|
||||
{{ with site.Params.hugoblox.footer.text }}
|
||||
<p class="text-center">
|
||||
{{ . | markdownify | emojify }}
|
||||
</p>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!-- Main navigation container -->
|
||||
|
||||
{{/* Show site search? */}}
|
||||
{{ $show_search := site.Params.header.navbar.show_search | default false }}
|
||||
{{ $show_search := site.Params.hugoblox.header.search | default false }}
|
||||
|
||||
<nav
|
||||
class="relative flex w-full flex-nowrap items-center justify-between bg-white py-2 text-neutral-500 shadow-lg hover:text-neutral-700 focus:text-neutral-700 dark:bg-slate-900 lg:flex-wrap lg:justify-start lg:py-4"
|
||||
@@ -72,7 +72,7 @@
|
||||
>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ $show_mode_toggle := site.Params.header.navbar.show_mode_toggle | default site.Params.header.navbar.show_theme_chooser | default true }}
|
||||
{{ $show_mode_toggle := site.Params.hugoblox.header.theme_toggle | default true }}
|
||||
{{ if $show_mode_toggle }}
|
||||
<li class="lg:px-2 text-[var(--color-header-fg)] hover:text-primary-500
|
||||
[&.active]:font-bold [&.active]:text-primary-500">
|
||||
@@ -100,7 +100,7 @@
|
||||
{{ end }}
|
||||
|
||||
{{/* Theme Picker */}}
|
||||
{{ if site.Params.header.navbar.show_theme_picker }}
|
||||
{{ if site.Params.hugoblox.header.theme_picker }}
|
||||
<li class="lg:px-2">
|
||||
<select onchange="document.documentElement.setAttribute('data-theme-pack', this.value); localStorage.setItem('hb-theme-pack', this.value);" class="bg-transparent text-[var(--color-header-fg)] border-none focus:ring-0 cursor-pointer text-sm font-medium">
|
||||
<option value="">Theme</option>
|
||||
@@ -123,7 +123,7 @@
|
||||
</li>
|
||||
{{ end }}
|
||||
|
||||
{{ $show_translations := site.Params.header.navbar.show_translations | default true }}
|
||||
{{ $show_translations := site.Params.hugoblox.header.language_switcher | default true }}
|
||||
{{ if .IsTranslated | and $show_translations }}
|
||||
<li class="lg:px-2 text-[var(--color-header-fg)] hover:text-primary-500
|
||||
[&.active]:font-bold [&.active]:text-primary-500">
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<!-- /Mobile menu -->
|
||||
|
||||
<!-- Main menu -->
|
||||
{{ $align_menu := site.Params.header.navbar.align | default "center" }}
|
||||
{{ $align_menu := site.Params.hugoblox.header.align | default "center" }}
|
||||
<ul
|
||||
id="nav-menu"
|
||||
class="navbar-nav order-3 hidden lg:flex w-full pb-6 lg:order-1 lg:w-auto lg:space-x-2 lg:pb-0 xl:space-x-8 justify-start
|
||||
@@ -120,12 +120,12 @@
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if site.Params.header.navbar.button.enable }}
|
||||
{{ if site.Params.hugoblox.header.cta.enable }}
|
||||
<li class="mt-4 inline-block lg:hidden">
|
||||
<a
|
||||
class=""
|
||||
href="{{ site.Params.header.navbar.button.url | relLangURL }}">
|
||||
{{ site.Params.header.navbar.button.text }}
|
||||
href="{{ site.Params.hugoblox.header.cta.url | relLangURL }}">
|
||||
{{ site.Params.hugoblox.header.cta.text }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
@@ -134,7 +134,7 @@
|
||||
<div class="order-1 ml-auto flex items-center md:order-2 lg:ml-0">
|
||||
|
||||
{{/* Show site search? */}}
|
||||
{{ $show_search := site.Params.header.navbar.show_search | default false }}
|
||||
{{ $show_search := site.Params.hugoblox.header.search | default false }}
|
||||
{{ with $show_search }}
|
||||
<button
|
||||
aria-label="toggle search"
|
||||
@@ -144,7 +144,7 @@
|
||||
</button>
|
||||
{{ end }}
|
||||
|
||||
{{ $show_mode_toggle := site.Params.header.navbar.show_mode_toggle | default site.Params.header.navbar.show_theme_chooser | default true }}
|
||||
{{ $show_mode_toggle := site.Params.hugoblox.header.theme_toggle | default true }}
|
||||
{{ if $show_mode_toggle }}
|
||||
<div class="px-3 text-[var(--color-header-fg)] hover:text-primary-500
|
||||
[&.active]:font-bold [&.active]:text-primary-500">
|
||||
@@ -172,7 +172,7 @@
|
||||
{{ end }}
|
||||
|
||||
{{/* Theme Picker */}}
|
||||
{{ if site.Params.header.navbar.show_theme_picker }}
|
||||
{{ if site.Params.hugoblox.header.theme_picker }}
|
||||
<div class="px-3">
|
||||
<select onchange="document.documentElement.setAttribute('data-theme-pack', this.value); localStorage.setItem('hb-theme-pack', this.value);" class="bg-transparent text-[var(--color-header-fg)] border-none focus:ring-0 cursor-pointer text-sm font-medium">
|
||||
<option value="">Theme</option>
|
||||
@@ -196,7 +196,7 @@
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ $show_translations := site.Params.header.navbar.show_translations | default true }}
|
||||
{{ $show_translations := site.Params.hugoblox.header.language_switcher | default true }}
|
||||
{{ if .IsTranslated | and $show_translations }}
|
||||
<div class="pl-1 mr-5 text-[var(--color-header-fg)] hover:text-primary-500
|
||||
[&.active]:font-bold [&.active]:text-primary-500">
|
||||
@@ -205,14 +205,14 @@
|
||||
{{ end }}
|
||||
|
||||
<!-- CTA button -->
|
||||
{{ if site.Params.header.navbar.button.enable }}
|
||||
{{ if site.Params.hugoblox.header.cta.enable }}
|
||||
<a
|
||||
href="{{ site.Params.header.navbar.button.url | relLangURL }}"
|
||||
href="{{ site.Params.hugoblox.header.cta.url | relLangURL }}"
|
||||
class="inline-block rounded border px-5 py-2 font-semibold transition
|
||||
md:ml-4 px-4 py-1.5 text-sm
|
||||
border-black hover:bg-black dark:hover:bg-white dark:hover:text-black hover:text-white dark:border-white dark:text-white dark:hover:bg-white
|
||||
hidden lg:inline-block">
|
||||
{{ site.Params.header.navbar.button.text }}
|
||||
{{ site.Params.hugoblox.header.cta.text }}
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{{ $page := .page }}
|
||||
{{ $class := .class }}
|
||||
{{ $hide_language_name := site.Params.header.navbar.hide_language_name | default false }}
|
||||
{{ $hide_language_name := false }}{{/* TODO: Add to hugoblox.header.hide_language_name if needed */}}
|
||||
{{ $str_languages := T "languages" }}
|
||||
|
||||
{{- if $page.IsTranslated -}}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
{{ $datetime := (time.Format "2006-01-02T15:04:05.000Z" .Lastmod) }}
|
||||
<time class="mt-12 mb-8 block text-xs text-gray-500 ltr:text-right rtl:text-left dark:text-gray-400" datetime="{{ $datetime }}">
|
||||
<span>{{ $last_updated }}</span>
|
||||
{{ .Lastmod | time.Format (site.Params.locale.date_format | default ":date_long") -}}
|
||||
{{ .Lastmod | time.Format (site.Params.hugoblox.locale.date_format | default ":date_long") -}}
|
||||
</time>
|
||||
{{- else -}}
|
||||
<div class="mt-16"></div>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
>{{ $prev.Title }}</span>
|
||||
<span class="mt-[0.1rem] text-xs text-neutral-500 dark:text-neutral-400">
|
||||
{{ if .Params.show_date | default true }}
|
||||
{{ time.Format (site.Params.locale.date_format | default ":date_long") $prev.Date }}
|
||||
{{ time.Format (site.Params.hugoblox.locale.date_format | default ":date_long") $prev.Date }}
|
||||
{{ end }}
|
||||
</span>
|
||||
</span>
|
||||
@@ -38,7 +38,7 @@
|
||||
>
|
||||
<span class="mt-[0.1rem] text-xs text-neutral-500 dark:text-neutral-400">
|
||||
{{ if .Params.show_date | default true }}
|
||||
{{ time.Format (site.Params.locale.date_format | default ":date_long") $next.Date }}
|
||||
{{ time.Format (site.Params.hugoblox.locale.date_format | default ":date_long") $next.Date }}
|
||||
{{ end }}
|
||||
</span>
|
||||
</span>
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
<div x-show="!query && results.length === 0" class="p-6">
|
||||
|
||||
{{/* Quick Actions - Configurable via site params */}}
|
||||
{{ $quick_actions := site.Params.features.search.quick_actions }}
|
||||
{{ $quick_actions := site.Params.hugoblox.search.quick_actions }}
|
||||
{{ if $quick_actions }}
|
||||
<div class="mb-8">
|
||||
<h3 class="mb-4 text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400">
|
||||
@@ -126,7 +126,7 @@
|
||||
{{ end }}
|
||||
|
||||
{{/* Trending Searches - Configurable via site params */}}
|
||||
{{ $trending := site.Params.features.search.trending_searches }}
|
||||
{{ $trending := site.Params.hugoblox.search.suggestions }}
|
||||
{{ if $trending }}
|
||||
<div>
|
||||
<h3 class="mb-3 text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400">
|
||||
@@ -267,7 +267,7 @@
|
||||
selectedIndex: -1,
|
||||
activeFilter: null,
|
||||
availableFilters: [],
|
||||
trendingSearches: {{ site.Params.features.search.trending_searches | default (slice "Search term 1" "Search term 2") | jsonify }},
|
||||
trendingSearches: {{ site.Params.hugoblox.search.suggestions | default (slice "Search term 1" "Search term 2") | jsonify }},
|
||||
pagefind: null,
|
||||
pagefindModulePath: window.hbb?.assetPaths?.pagefind ?? '/pagefind/pagefind.js',
|
||||
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
{{- end -}}
|
||||
|
||||
{{/* Page Features */}}
|
||||
{{- if site.Params.features.repository.url | and .Params.editable -}}
|
||||
{{- if site.Params.hugoblox.repository.url | and .Params.editable -}}
|
||||
<div class="{{ $class }} sticky bottom-0 flex flex-col items-start gap-2 pb-8">
|
||||
|
||||
{{ $edit_url := site.Params.features.repository.url | default "" }}
|
||||
{{ $branch := site.Params.features.repository.branch | default "main" }}
|
||||
{{ $dir := site.Params.features.repository.content_dir | default "content" }}
|
||||
{{ $edit_url := site.Params.hugoblox.repository.url | default "" }}
|
||||
{{ $branch := site.Params.hugoblox.repository.branch | default "main" }}
|
||||
{{ $dir := site.Params.hugoblox.repository.content_dir | default "content" }}
|
||||
{{- with .File -}}{{ $edit_url = urls.JoinPath $edit_url "edit" $branch $dir (replace .Path "\\" "/") }}{{- end -}}
|
||||
{{- with .Params.edit_url -}}{{ $edit_url = . }}{{- end -}}
|
||||
<a class="text-xs font-medium text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-100 contrast-more:text-gray-800 contrast-more:dark:text-gray-50" href="{{ $edit_url }}" target="_blank" rel="noreferer">{{ $edit_this_page }}</a>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
{{ $page := . }}
|
||||
{{ $address := .address }}
|
||||
{{ $format_name := $page.Params.address_format | default site.Params.locale.address_format | default "en-us" }}
|
||||
{{ $format_name := $page.Params.address_format | default site.Params.hugoblox.locale.address_format | default "en-us" }}
|
||||
|
||||
{{ if not (isset site.Data.address_formats $format_name) }}{{ errorf "Address format `%s` missing from `data/address_formats.toml`!" $format_name }}{{end}}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{{/*
|
||||
get_branding.html - Centralized branding configuration helper
|
||||
get_branding.html - Centralized branding configuration helper (v2)
|
||||
|
||||
Returns a dict with:
|
||||
- name: Display name (navbar, footer, JSON-LD publisher)
|
||||
@@ -7,67 +7,32 @@
|
||||
- organization: Legal/copyright entity name
|
||||
|
||||
Fallback chain:
|
||||
- site_title → name → site.Title
|
||||
- site_title → seo.title → name → site.Title
|
||||
- organization → name → site.Title
|
||||
|
||||
Supports backward compatibility with deprecation warnings for:
|
||||
- header.navbar.logo.text → hugoblox.branding.name
|
||||
- marketing.seo.org_name → hugoblox.branding.organization
|
||||
*/}}
|
||||
|
||||
{{/* New structure: hugoblox.branding */}}
|
||||
{{/* v2 structure: hugoblox.identity */}}
|
||||
{{ $hb := site.Params.hugoblox | default dict }}
|
||||
{{ $branding := $hb.branding | default dict }}
|
||||
{{ $identity := $hb.identity | default dict }}
|
||||
{{ $seo := $hb.seo | default dict }}
|
||||
|
||||
{{/* ═══════════════════════════════════════════════════════════════════════════
|
||||
NAME (primary display name)
|
||||
Priority: hugoblox.branding.name → header.navbar.logo.text (deprecated) → site.Title
|
||||
Priority: hugoblox.identity.name → site.Title
|
||||
═══════════════════════════════════════════════════════════════════════════ */}}
|
||||
{{ $name := "" }}
|
||||
|
||||
{{/* Check new location first */}}
|
||||
{{ with $branding.name }}
|
||||
{{ $name = . }}
|
||||
{{ else }}
|
||||
{{/* Check deprecated location: header.navbar.logo.text */}}
|
||||
{{ with site.Params.header.navbar.logo.text }}
|
||||
{{ $name = . }}
|
||||
{{ warnf "DEPRECATED: 'header.navbar.logo.text' in config/_default/params.yaml is deprecated. Please move to:\n\nhugoblox:\n branding:\n name: \"%s\"\n" . }}
|
||||
{{ else }}
|
||||
{{/* Ultimate fallback: Hugo's site.Title */}}
|
||||
{{ $name = site.Title }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ $name := $identity.name | default site.Title }}
|
||||
|
||||
{{/* ═══════════════════════════════════════════════════════════════════════════
|
||||
SITE_TITLE (browser tab / SEO title)
|
||||
Priority: hugoblox.branding.site_title → name
|
||||
Priority: hugoblox.seo.title → hugoblox.identity.name → site.Title
|
||||
═══════════════════════════════════════════════════════════════════════════ */}}
|
||||
{{ $site_title := $branding.site_title | default $name }}
|
||||
{{ $site_title := $seo.title | default $name }}
|
||||
|
||||
{{/* ═══════════════════════════════════════════════════════════════════════════
|
||||
ORGANIZATION (legal/copyright entity)
|
||||
Priority: hugoblox.branding.organization → marketing.seo.org_name (deprecated) → name
|
||||
Priority: hugoblox.identity.organization → name
|
||||
═══════════════════════════════════════════════════════════════════════════ */}}
|
||||
{{ $organization := "" }}
|
||||
|
||||
{{/* Check new location first */}}
|
||||
{{ with $branding.organization }}
|
||||
{{ $organization = . }}
|
||||
{{ else }}
|
||||
{{/* Check deprecated location: marketing.seo.org_name */}}
|
||||
{{ with site.Params.marketing.seo.org_name }}
|
||||
{{ if ne . "" }}
|
||||
{{ $organization = . }}
|
||||
{{ warnf "DEPRECATED: 'marketing.seo.org_name' in config/_default/params.yaml is deprecated. Please move to:\n\nhugoblox:\n branding:\n organization: \"%s\"\n" . }}
|
||||
{{ else }}
|
||||
{{ $organization = $name }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{/* Fallback to name */}}
|
||||
{{ $organization = $name }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ $organization := $identity.organization | default $name }}
|
||||
|
||||
{{/* Return branding dict */}}
|
||||
{{ return dict
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
{{/* Function to get event start and end dates/times. */}}
|
||||
{{ $t1 := time .Date }}{{/* Start datetime. */}}
|
||||
{{ $str := slice (time.Format site.Params.locale.date_format (time $t1)) }}{{/* Init return string with start date. */}}
|
||||
{{ $str := slice (time.Format site.Params.hugoblox.locale.date_format (time $t1)) }}{{/* Init return string with start date. */}}
|
||||
{{/* Show start time if not all day event. */}}
|
||||
{{ if not .Params.all_day }}{{ $str = $str | append (time.Format site.Params.locale.time_format (time $t1)) }}{{ end }}
|
||||
{{ if not .Params.all_day }}{{ $str = $str | append (time.Format site.Params.hugoblox.locale.time_format (time $t1)) }}{{ end }}
|
||||
{{/* Show event end date if provided. */}}
|
||||
{{ if .Params.date_end }}
|
||||
{{ $str = $str | append "—" }}
|
||||
{{ $t2 := time .Params.date_end}}{{/* End datetime. */}}
|
||||
{{/* Show end date if it differs to start date. */}}
|
||||
{{ if not (eq $t1.Year $t2.Year | and (eq $t1.Month $t2.Month) | and (eq $t1.Day $t2.Day)) }}
|
||||
{{ $str = $str | append (time.Format site.Params.locale.date_format (time $t2)) }}
|
||||
{{ $str = $str | append (time.Format site.Params.hugoblox.locale.date_format (time $t2)) }}
|
||||
{{ end }}
|
||||
{{/* Show end time if not all day event. */}}
|
||||
{{ if not .Params.all_day }}{{ $str = $str | append (time.Format site.Params.locale.time_format (time $t2)) }}{{ end }}
|
||||
{{ if not .Params.all_day }}{{ $str = $str | append (time.Format site.Params.hugoblox.locale.time_format (time $t2)) }}{{ end }}
|
||||
{{ end }}
|
||||
{{ return ((delimit $str " ") | safeHTML) }}
|
||||
@@ -1,5 +1,5 @@
|
||||
{{/*
|
||||
HugoBlox Theme Engine: Get theme configuration
|
||||
HugoBlox Theme Engine: Get theme configuration (v2)
|
||||
|
||||
Returns a dict with:
|
||||
- mode: 'light' | 'dark' | 'system'
|
||||
@@ -8,46 +8,22 @@
|
||||
- colors: Global color overrides { primary, secondary, neutral }
|
||||
- colors_light: Light-mode specific color overrides
|
||||
- colors_dark: Dark-mode specific color overrides
|
||||
- ui: Semantic UI overrides { header_bg, footer_bg, etc. }
|
||||
- surfaces: Semantic surface colors { background, foreground, header, footer }
|
||||
- typography: { font, size }
|
||||
- layout: { radius, spacing }
|
||||
|
||||
Supports backward compatibility with deprecation warnings for:
|
||||
- appearance.mode → hugoblox.theme.mode
|
||||
- appearance.color → hugoblox.theme.colors.primary
|
||||
- appearance.theme.light/dark → hugoblox.theme.pack.light/dark
|
||||
- appearance.font → hugoblox.typography.font
|
||||
*/}}
|
||||
|
||||
{{/* New structure: hugoblox.theme */}}
|
||||
{{/* v2 structure */}}
|
||||
{{ $hb := site.Params.hugoblox | default dict }}
|
||||
{{ $hb_theme := $hb.theme | default dict }}
|
||||
|
||||
{{/* Legacy structure: appearance */}}
|
||||
{{ $appearance := site.Params.appearance | default dict }}
|
||||
{{ $legacy_theme := $appearance.theme | default dict }}
|
||||
|
||||
{{/* ═══════════════════════════════════════════════════════════════════════════
|
||||
MODE (light/dark/system)
|
||||
Priority: hugoblox.theme.mode → appearance.mode → "system"
|
||||
═══════════════════════════════════════════════════════════════════════════ */}}
|
||||
{{ $mode := "system" }}
|
||||
|
||||
{{ with $hb_theme.mode }}
|
||||
{{ $mode = . }}
|
||||
{{ else }}
|
||||
{{ with $appearance.mode }}
|
||||
{{ $mode = . }}
|
||||
{{/* Only warn if using old structure AND new structure exists */}}
|
||||
{{ if $hb_theme }}
|
||||
{{ warnf "DEPRECATED: 'appearance.mode' in config/_default/params.yaml is deprecated. Please move to:\n\nhugoblox:\n theme:\n mode: \"%s\"\n" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ $mode := $hb_theme.mode | default "system" }}
|
||||
|
||||
{{/* ═══════════════════════════════════════════════════════════════════════════
|
||||
THEME PACK SELECTION (light/dark)
|
||||
Priority: hugoblox.theme.pack → hugoblox.theme.light/dark → appearance.theme.light/dark → "default"
|
||||
|
||||
Pack can be:
|
||||
- String: "default" (applies to both)
|
||||
@@ -56,115 +32,45 @@
|
||||
{{ $light_pack := "default" }}
|
||||
{{ $dark_pack := "default" }}
|
||||
|
||||
{{/* Check hugoblox.theme.pack first */}}
|
||||
{{ with $hb_theme.pack }}
|
||||
{{ if reflect.IsMap . }}
|
||||
{{ $light_pack = .light | default "default" }}
|
||||
{{ $dark_pack = .dark | default "default" }}
|
||||
{{ else }}
|
||||
{{/* Single string applies to both */}}
|
||||
{{ $light_pack = . }}
|
||||
{{ $dark_pack = . }}
|
||||
{{ end }}
|
||||
{{ $pack := $hb_theme.pack | default "default" }}
|
||||
{{ if reflect.IsMap $pack }}
|
||||
{{ $light_pack = $pack.light | default "default" }}
|
||||
{{ $dark_pack = $pack.dark | default "default" }}
|
||||
{{ else }}
|
||||
{{/* Check hugoblox.theme.light/dark (alternative flat structure) */}}
|
||||
{{ with $hb_theme.light }}
|
||||
{{ $light_pack = . }}
|
||||
{{ else }}
|
||||
{{/* Check legacy appearance.theme.light */}}
|
||||
{{ with $legacy_theme.light }}
|
||||
{{ $light_pack = . }}
|
||||
{{ if $hb_theme }}
|
||||
{{ warnf "DEPRECATED: 'appearance.theme.light' in config/_default/params.yaml is deprecated. Please move to:\n\nhugoblox:\n theme:\n pack:\n light: \"%s\"\n" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ with $hb_theme.dark }}
|
||||
{{ $dark_pack = . }}
|
||||
{{ else }}
|
||||
{{/* Check legacy appearance.theme.dark */}}
|
||||
{{ with $legacy_theme.dark }}
|
||||
{{ $dark_pack = . }}
|
||||
{{ if $hb_theme }}
|
||||
{{ warnf "DEPRECATED: 'appearance.theme.dark' in config/_default/params.yaml is deprecated. Please move to:\n\nhugoblox:\n theme:\n pack:\n dark: \"%s\"\n" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{/* Single string applies to both */}}
|
||||
{{ $light_pack = $pack }}
|
||||
{{ $dark_pack = $pack }}
|
||||
{{ end }}
|
||||
|
||||
{{/* ═══════════════════════════════════════════════════════════════════════════
|
||||
GLOBAL COLOR OVERRIDES
|
||||
Priority: hugoblox.theme.colors → appearance.theme.colors → appearance.color (primary only)
|
||||
═══════════════════════════════════════════════════════════════════════════ */}}
|
||||
{{ $colors := dict }}
|
||||
|
||||
{{ with $hb_theme.colors }}
|
||||
{{ $colors = . }}
|
||||
{{ else }}
|
||||
{{ with $legacy_theme.colors }}
|
||||
{{ $colors = . }}
|
||||
{{ else }}
|
||||
{{/* Check legacy appearance.color (primary only) */}}
|
||||
{{ with $appearance.color }}
|
||||
{{ $colors = dict "primary" . }}
|
||||
{{ warnf "DEPRECATED: 'appearance.color' in config/_default/params.yaml is deprecated. Please move to:\n\nhugoblox:\n theme:\n colors:\n primary: \"%s\"\n" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{/* ═══════════════════════════════════════════════════════════════════════════
|
||||
MODE-SPECIFIC COLOR OVERRIDES
|
||||
New feature: hugoblox.theme.colors_light / colors_dark
|
||||
COLOR OVERRIDES
|
||||
═══════════════════════════════════════════════════════════════════════════ */}}
|
||||
{{ $colors := $hb_theme.colors | default dict }}
|
||||
{{ $colors_light := $hb_theme.colors_light | default dict }}
|
||||
{{ $colors_dark := $hb_theme.colors_dark | default dict }}
|
||||
|
||||
{{/* ═══════════════════════════════════════════════════════════════════════════
|
||||
SEMANTIC UI OVERRIDES
|
||||
New feature: hugoblox.theme.ui
|
||||
SEMANTIC SURFACE COLORS
|
||||
═══════════════════════════════════════════════════════════════════════════ */}}
|
||||
{{ $ui := $hb_theme.ui | default dict }}
|
||||
{{ $surfaces := $hb_theme.surfaces | default dict }}
|
||||
|
||||
{{/* ═══════════════════════════════════════════════════════════════════════════
|
||||
TYPOGRAPHY
|
||||
Priority: hugoblox.typography → appearance.font (legacy)
|
||||
|
||||
font: "sans" (Inter, default) | "serif" (Roboto Slab) | "native" (system fonts)
|
||||
size: "sm" | "md" | "lg" | "xl" (maps to base font size)
|
||||
═══════════════════════════════════════════════════════════════════════════ */}}
|
||||
{{ $hb_typography := $hb.typography | default dict }}
|
||||
{{ $font := "sans" }}
|
||||
{{ $font_size := "md" }}
|
||||
|
||||
{{ with $hb_typography.font }}
|
||||
{{ $font = . }}
|
||||
{{ else }}
|
||||
{{/* Check legacy appearance.font */}}
|
||||
{{ with $appearance.font }}
|
||||
{{ $font = . }}
|
||||
{{ warnf "DEPRECATED: 'appearance.font' in config/_default/params.yaml is deprecated. Please move to:\n\nhugoblox:\n typography:\n font: \"%s\"\n" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ with $hb_typography.size }}
|
||||
{{ $font_size = . }}
|
||||
{{ end }}
|
||||
|
||||
{{ $typography := dict "font" $font "size" $font_size }}
|
||||
{{ $typography := dict
|
||||
"font" ($hb_typography.font | default "sans")
|
||||
"size" ($hb_typography.size | default "md")
|
||||
}}
|
||||
|
||||
{{/* ═══════════════════════════════════════════════════════════════════════════
|
||||
LAYOUT TOKENS
|
||||
New feature: hugoblox.layout
|
||||
|
||||
radius: "none" | "sm" | "md" | "lg" | "full"
|
||||
spacing: "compact" | "comfortable" | "spacious"
|
||||
═══════════════════════════════════════════════════════════════════════════ */}}
|
||||
{{ $hb_layout := $hb.layout | default dict }}
|
||||
{{ $radius := $hb_layout.radius | default "md" }}
|
||||
{{ $spacing := $hb_layout.spacing | default "comfortable" }}
|
||||
|
||||
{{ $layout := dict "radius" $radius "spacing" $spacing }}
|
||||
{{ $layout := dict
|
||||
"radius" ($hb_layout.radius | default "md")
|
||||
"spacing" ($hb_layout.spacing | default "comfortable")
|
||||
}}
|
||||
|
||||
{{/* Return theme config dict */}}
|
||||
{{ return dict
|
||||
@@ -174,7 +80,7 @@
|
||||
"colors" $colors
|
||||
"colors_light" $colors_light
|
||||
"colors_dark" $colors_dark
|
||||
"ui" $ui
|
||||
"surfaces" $surfaces
|
||||
"typography" $typography
|
||||
"layout" $layout
|
||||
}}
|
||||
@@ -13,14 +13,14 @@
|
||||
{{ partial "functions/generate_color_scale" (dict "name" "gray" "color" $data.colors.neutral) }}
|
||||
{{ end }}
|
||||
|
||||
{{/* 2. Semantic UI Variables */}}
|
||||
--color-background: {{ $data.ui.background | default "#ffffff" }};
|
||||
--color-foreground: {{ $data.ui.foreground | default "#000000" }};
|
||||
{{/* 2. Semantic Surface Variables */}}
|
||||
--color-background: {{ $data.surfaces.background | default "#ffffff" }};
|
||||
--color-foreground: {{ $data.surfaces.foreground | default "#000000" }};
|
||||
|
||||
{{/* Header */}}
|
||||
--color-header-bg: {{ $data.ui.header.background | default $data.ui.background | default "#ffffff" }};
|
||||
--color-header-fg: {{ $data.ui.header.foreground | default $data.ui.foreground | default "#000000" }};
|
||||
--color-header-bg: {{ $data.surfaces.header.background | default $data.surfaces.background | default "#ffffff" }};
|
||||
--color-header-fg: {{ $data.surfaces.header.foreground | default $data.surfaces.foreground | default "#000000" }};
|
||||
|
||||
{{/* Footer */}}
|
||||
--color-footer-bg: {{ $data.ui.footer.background | default $data.ui.background | default "#f3f4f6" }};
|
||||
--color-footer-fg: {{ $data.ui.footer.foreground | default $data.ui.foreground | default "#000000" }};
|
||||
--color-footer-bg: {{ $data.surfaces.footer.background | default $data.surfaces.background | default "#f3f4f6" }};
|
||||
--color-footer-fg: {{ $data.surfaces.footer.foreground | default $data.surfaces.foreground | default "#000000" }};
|
||||
@@ -1,5 +1,5 @@
|
||||
{{/* Hugo Blox: Export Debug Logs for Dev HUD (window var) */}}
|
||||
{{- if and hugo.IsServer (site.Params.hbx.log.export | default true) -}}
|
||||
{{- if and hugo.IsServer (site.Params.hugoblox.debug.export_logs | default true) -}}
|
||||
{{- /* Collect all logs from all pages (site-wide) */ -}}
|
||||
{{- $entries := slice -}}
|
||||
{{- range .Site.Pages -}}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
<script>
|
||||
(function(){
|
||||
try {
|
||||
const PLACEMENT = {{ (site.Params.hbx.log.placement | default "bottom-left") | jsonify }};
|
||||
const OPACITY = {{ (site.Params.hbx.log.opacity | default 1.0) | jsonify }};
|
||||
const PLACEMENT = {{ (site.Params.hugoblox.debug.hud.position | default "bottom-left") | jsonify }};
|
||||
const OPACITY = {{ (site.Params.hugoblox.debug.hud.opacity | default 1.0) | jsonify }};
|
||||
const PLACEMENT_KEY = 'hbx-hud-placement';
|
||||
const HIDE_BUTTON_KEY = 'hbx-hide-button';
|
||||
const VALID_PLACEMENTS = ['bottom-left', 'bottom-center', 'bottom-right', 'top-left', 'top-center', 'top-right'];
|
||||
|
||||
@@ -3,29 +3,29 @@
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": {{site.Params.marketing.seo.site_type | default "Organization"}},
|
||||
"@type": {{site.Params.hugoblox.identity.type | humanize | default "Organization"}},
|
||||
"@id": {{site.BaseURL}},
|
||||
"name": {{$branding.organization}},
|
||||
"logo": {{ partial "functions/get_logo_url" . }},
|
||||
{{with $sharing_image}}"image": {{.Permalink}},{{end}}
|
||||
{{ if (eq site.Params.marketing.seo.site_type "LocalBusiness") | and site.Params.marketing.seo.coordinates }}
|
||||
{{ if (eq site.Params.hugoblox.identity.type "local_business") | and site.Params.hugoblox.seo.location.coordinates }}
|
||||
"geo": {
|
||||
"@type": "GeoCoordinates",
|
||||
"latitude": {{site.Params.marketing.seo.coordinates.latitude}},
|
||||
"longitude": {{site.Params.marketing.seo.coordinates.longitude}}
|
||||
"latitude": {{site.Params.hugoblox.seo.location.coordinates.latitude}},
|
||||
"longitude": {{site.Params.hugoblox.seo.location.coordinates.longitude}}
|
||||
},
|
||||
{{end}}
|
||||
{{ with site.Params.marketing.seo.address }}
|
||||
{{ with site.Params.hugoblox.seo.location.address }}
|
||||
"address": {
|
||||
"@type": "PostalAddress",
|
||||
"streetAddress": {{ .street | default "" }},
|
||||
"addressLocality": {{ .city | default "" }},
|
||||
"addressRegion": {{ .region | default "" }},
|
||||
"postalCode": {{ .postcode | default "" }},
|
||||
"addressCountry": {{ .country_code | default .country | default "" }}
|
||||
"postalCode": {{ .postal_code | default "" }},
|
||||
"addressCountry": {{ .country | default "" }}
|
||||
},
|
||||
{{end}}
|
||||
{{ with site.Params.marketing.seo.phone }}"telephone": {{.}},{{end}}
|
||||
{{ with site.Params.hugoblox.seo.location.phone }}"telephone": {{.}},{{end}}
|
||||
"url": {{site.BaseURL}}
|
||||
}
|
||||
</script>
|
||||
@@ -1,6 +1,6 @@
|
||||
{{ $page := .page }}
|
||||
{{ $summary := .summary }}
|
||||
{{ $site_type := site.Params.marketing.seo.site_type | default "Person" }}
|
||||
{{ $site_type := site.Params.hugoblox.identity.type | humanize | default "Person" }}
|
||||
|
||||
{{- if $page.IsHome -}}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "WebSite",
|
||||
{{- if site.Params.features.search.provider }}
|
||||
{{- if site.Params.hugoblox.search.enable }}
|
||||
"potentialAction": {
|
||||
"@type": "SearchAction",
|
||||
"target": {{ printf "%s?q={search_term_string}" site.BaseURL }},
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
{{ end }}
|
||||
|
||||
{{/* Show site search? */}}
|
||||
{{ $show_search := site.Params.header.navbar.show_search | default false }}
|
||||
{{ $show_search := site.Params.hugoblox.header.search | default false }}
|
||||
|
||||
{{/* Load Alpine JS extension? */}}
|
||||
{{/* Alpine is needed for search modal and other interactive components */}}
|
||||
@@ -85,7 +85,7 @@
|
||||
{{ end }}
|
||||
|
||||
{{/* Katex */}}
|
||||
{{ if (.Page.HasShortcode "math") | or .Params.math | or site.Params.features.math.enable }}
|
||||
{{ if (.Page.HasShortcode "math") | or .Params.math | or site.Params.hugoblox.content.math.enable }}
|
||||
{{ $katex_css := resources.Get "dist/lib/katex/katex.min.css" }}
|
||||
{{ $katex_css = $katex_css | resources.Fingerprint "sha256" }}
|
||||
<link type="text/css" rel="stylesheet" href="{{ $katex_css.RelPermalink }}" integrity="{{ $katex_css.Data.Integrity }}" />
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{{ $page := .page }}
|
||||
{{ $author_page := .author_page }}
|
||||
{{ $site_type := site.Params.marketing.seo.site_type | default "Person" }}
|
||||
{{ $site_type := site.Params.hugoblox.identity.type | humanize | default "Person" }}
|
||||
{{- $has_profile := not (eq nil $author_page.Params.superuser) -}}
|
||||
|
||||
{{/* Check an author profile exists. */}}
|
||||
@@ -11,7 +11,7 @@
|
||||
{{ $profile_url = site.BaseURL }}
|
||||
{{ end }}
|
||||
{{ $avatar := ($author_page.Resources.ByType "image").GetMatch "*avatar*" }}
|
||||
{{ $avatar_shape := site.Params.features.avatar.shape | default "circle" }}
|
||||
{{ $avatar_shape := site.Params.hugoblox.layout.avatar_shape | default "circle" }}
|
||||
|
||||
<div class="flex pt-12 pb-4">
|
||||
{{ if $avatar }}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
{{/* Add link to let visitors edit the page on GitHub. */}}
|
||||
{{/* Perform short-circuit check that page is backed by a file. */}}
|
||||
{{ if and .File .Params.editable | and site.Params.features.repository.url }}
|
||||
{{ if and .File .Params.editable | and site.Params.hugoblox.repository.url }}
|
||||
{{/* Get language subfolder for multilingual sites. */}}
|
||||
{{/* Limitations: the subfolder param, `<LANG>.contentDir`, is unexposed in the Hugo `site` API so we attempt to workaround this issue. */}}
|
||||
{{ $content_dir := "content" }}
|
||||
{{ if site.Params.features.repository.content_dir }}
|
||||
{{ $content_dir = site.Params.features.repository.content_dir }}
|
||||
{{ if site.Params.hugoblox.repository.content_dir }}
|
||||
{{ $content_dir = site.Params.hugoblox.repository.content_dir }}
|
||||
{{else}}
|
||||
{{/* Attempt to get content dir from the LanguagePrefix URI, but defaultContentLanguageInSubdir can break this assumption. */}}
|
||||
{{ $content_dir = cond site.IsMultiLingual (cond (ne .Site.LanguagePrefix "") (printf "%s%s" $content_dir .Site.LanguagePrefix) $content_dir) $content_dir }}
|
||||
{{end}}
|
||||
<p class="edit-page">
|
||||
<a href="{{site.Params.features.repository.url}}/edit/{{site.Params.features.repository.branch | default "main"}}/{{$content_dir}}/{{.File.Path}}">
|
||||
<a href="{{site.Params.hugoblox.repository.url}}/edit/{{site.Params.hugoblox.repository.branch | default "main"}}/{{$content_dir}}/{{.File.Path}}">
|
||||
📝 {{ i18n "edit_page" | default "Edit this page" }}
|
||||
</a>
|
||||
</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
{{ partial "functions/get_hook" (dict "hook" "footer-start" "context" .) }}
|
||||
|
||||
{{/* Load footer block */}}
|
||||
{{- $footer_config := site.Params.footer | default dict -}}
|
||||
{{- $footer_config := site.Params.hugoblox.footer | default dict -}}
|
||||
{{- $footer_section_name := partial "hbx/resolve-block-param" (dict "config" $footer_config "context" "footer") | default "minimal" -}}
|
||||
{{ $footer_section_path := printf "components/footers/%s.html" $footer_section_name }}
|
||||
{{ if not (templates.Exists (printf "_partials/%s" $footer_section_path)) }}
|
||||
@@ -12,10 +12,37 @@
|
||||
{{ partial $footer_section_path . }}
|
||||
|
||||
{{/* Attribution - PLEASE DO NOT REMOVE THIS, SUPPORT OPEN SOURCE */}}
|
||||
{{- if not (site.Params.i_am_a_sponsor | default false) -}}
|
||||
|
||||
{{/* Check for Pro license key */}}
|
||||
{{- $license_key := getenv "HUGO_BLOX_LICENSE" -}}
|
||||
{{- $has_pro_license := false -}}
|
||||
|
||||
{{- if $license_key -}}
|
||||
{{/* Validate UUID v4 format */}}
|
||||
{{- $uuid_pattern := "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" -}}
|
||||
{{- $is_valid_format := findRE $uuid_pattern (lower $license_key) -}}
|
||||
{{- $has_pro_license = gt (len $is_valid_format) 0 -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Check user preference */}}
|
||||
{{- $wants_to_hide := site.Params.hugoblox.pro.hide_attribution | default false -}}
|
||||
|
||||
{{/* Determine if we show attribution */}}
|
||||
{{- $show_attribution := true -}}
|
||||
|
||||
{{- if $has_pro_license -}}
|
||||
{{/* Pro user - respect their choice */}}
|
||||
{{- $show_attribution = not $wants_to_hide -}}
|
||||
{{- else if $wants_to_hide -}}
|
||||
{{/* Free user trying to hide - show warning and attribution */}}
|
||||
{{- warnf "Attribution removal requires a Pro subscription. Get Pro at https://hugoblox.com/pro \nAlready subscribed to Pro? Reach out in the Pro Discord channel for support." -}}
|
||||
{{- $show_attribution = true -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $show_attribution -}}
|
||||
{{- $base := "https://hugoblox.com" -}}
|
||||
{{- $tid := "" -}}
|
||||
{{- $ref := .Site.Params.affiliate_ref | default "" -}}
|
||||
{{- $ref := .Site.Params.hugoblox.pro.affiliate_code | default "" -}}
|
||||
|
||||
{{/* Detect Template */}}
|
||||
{{ $hugoblox_file := "" }}
|
||||
@@ -82,6 +109,6 @@
|
||||
<a class="inline-flex items-center rounded px-2 py-0.5 border border-current ms-2 text-xs hover:opacity-100"
|
||||
href="{{ $ctaHref }}" target="_blank" rel="noopener" data-hbx="poweredby_cta">{{ $i18n_ctaText }}</a>
|
||||
</p>
|
||||
{{- end -}}
|
||||
{{- end -}}{{/* end $show_attribution */}}
|
||||
|
||||
</footer>
|
||||
@@ -1,8 +1,8 @@
|
||||
{{/* Display copyright license. */}}
|
||||
|
||||
{{ $branding := partialCached "functions/get_branding" . "branding" }}
|
||||
{{ $copyright_license := .Params.copyright.license | default site.Params.footer.copyright.license }}
|
||||
{{ $notice := .Params.copyright.notice | default site.Params.footer.copyright.notice }}
|
||||
{{ $copyright_license := .Params.copyright.license | default site.Params.hugoblox.copyright.license }}
|
||||
{{ $notice := .Params.copyright.notice | default site.Params.hugoblox.copyright.notice }}
|
||||
|
||||
{{ if ($copyright_license.enable | default false) }}
|
||||
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
{{/* Generate page description. */}}
|
||||
{{ $desc := "" }}
|
||||
{{ $desc = partial "functions/get_summary" . }}
|
||||
{{ if site.Params.marketing.seo.description | and (not $desc) }}
|
||||
{{ $desc = site.Params.marketing.seo.description }}
|
||||
{{ if site.Params.hugoblox.identity.description | and (not $desc) }}
|
||||
{{ $desc = site.Params.hugoblox.identity.description }}
|
||||
{{ end }}
|
||||
{{ if not $desc }}
|
||||
{{ $desc = $superuser_role }}
|
||||
@@ -47,7 +47,7 @@
|
||||
{{ partial "functions/theme_generator.html" $theme_config }}
|
||||
|
||||
{{/* Demo Theme Pack Styles (if enabled) */}}
|
||||
{{ if site.Params.header.navbar.show_theme_picker }}
|
||||
{{ if site.Params.hugoblox.header.theme_picker }}
|
||||
{{ partial "functions/demo_theme_styles.html" (dict "typography" $theme_config.typography "layout" $theme_config.layout) }}
|
||||
{{ end }}
|
||||
|
||||
@@ -150,7 +150,7 @@
|
||||
{{ if ne $title $branding.site_title }}{{ $title = printf "%s | %s" $title $branding.site_title }}{{ end }}
|
||||
{{ end }}
|
||||
<meta property="twitter:card" content="{{ $twitter_card }}" />
|
||||
{{ with site.Params.marketing.seo.twitter }}
|
||||
{{ with site.Params.hugoblox.identity.social.twitter }}
|
||||
<meta property="twitter:site" content="@{{ . }}" />
|
||||
<meta property="twitter:creator" content="@{{ . }}" />
|
||||
{{ end }}
|
||||
|
||||
@@ -173,7 +173,7 @@
|
||||
{{ end }}
|
||||
{{ if $showDate }}
|
||||
<time class="hidden sm:inline whitespace-nowrap" datetime="{{ $item.Date.Format "2006-01-02" }}">
|
||||
{{ $item.Date | time.Format (site.Params.locale.date_format | default "Jan 2, 2006") }}
|
||||
{{ $item.Date | time.Format (site.Params.hugoblox.locale.date_format | default "Jan 2, 2006") }}
|
||||
</time>
|
||||
{{ end }}
|
||||
{{ if and $showDate $showReadTime }}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<i class="far fa-file-alt pub-icon" aria-hidden="true"></i>
|
||||
|
||||
{{/* APA Style */}}
|
||||
{{ if eq (site.Params.publications.citation_style | default "apa") "apa" }}
|
||||
{{ if eq (site.Params.hugoblox.content.citations.style | default "apa") "apa" }}
|
||||
|
||||
<span class="article-metadata li-cite-author">
|
||||
{{ partial "page_metadata_authors" $item }}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<time
|
||||
class="md:hidden relative z-10 order-first mb-3 flex items-center text-sm text-zinc-400 dark:text-zinc-500 pl-1"
|
||||
datetime="{{ time.Format "2006-01-02" $item.Date }}">
|
||||
{{ time.Format (site.Params.locale.date_format | default ":date_long") $item.Date }}
|
||||
{{ time.Format (site.Params.hugoblox.locale.date_format | default ":date_long") $item.Date }}
|
||||
</time>
|
||||
<p class="relative z-10 mt-2 text-sm text-zinc-600 dark:text-zinc-400 line-clamp-3">{{$summary}}</p>
|
||||
<div aria-hidden="true" class="relative z-10 mt-4 flex items-center text-sm font-medium text-primary-500">
|
||||
@@ -25,6 +25,6 @@
|
||||
</div>
|
||||
<time
|
||||
class="mt-1 hidden md:block relative z-10 order-first mb-3 flex items-center text-sm text-zinc-400 dark:text-zinc-500"
|
||||
datetime="{{ time.Format "2006-01-02" $item.Date }}">{{ time.Format (site.Params.locale.date_format | default ":date_long") $item.Date }}
|
||||
datetime="{{ time.Format "2006-01-02" $item.Date }}">{{ time.Format (site.Params.hugoblox.locale.date_format | default ":date_long") $item.Date }}
|
||||
</time>
|
||||
</article>
|
||||
@@ -3,16 +3,16 @@
|
||||
{{ printf "<!-- Last Published: %s -->" (now | time.Format ":date_long") | safeHTML }}
|
||||
{{- $language_code := site.LanguageCode | default "en-us" -}}
|
||||
<html lang="{{$language_code}}" {{ if in site.Data.i18n.rtl.rtl $language_code }}dir="rtl"{{else}}dir="ltr"{{end}}
|
||||
data-wc-theme-default="{{ (lower site.Params.appearance.mode) | default "system" }}"
|
||||
data-wc-theme-default="{{ (lower site.Params.hugoblox.theme.mode) | default "system" }}"
|
||||
data-hbb-relurl="{{ "" | relURL }}">
|
||||
{{ partial "site_head" . }}
|
||||
<body class="bg-[var(--color-background)] text-[var(--color-foreground)] page-wrapper" id="top">
|
||||
<div id="page-bg"></div>
|
||||
<div class="page-header {{ if site.Params.header.navbar.fixed_to_top }}sticky top-0 z-30{{ end }}">
|
||||
<div class="page-header {{ if site.Params.hugoblox.header.sticky }}sticky top-0 z-30{{ end }}">
|
||||
{{/* Load header block */}}
|
||||
{{ $show_navbar := ((site.Params.header.navbar.enable | default true) | and (ne .Params.header.navbar.enable false)) | or .Params.header.navbar.enable }}
|
||||
{{ $show_navbar := ((site.Params.hugoblox.header.enable | default true) | and (ne .Params.header.navbar.enable false)) | or .Params.header.navbar.enable }}
|
||||
{{ if $show_navbar }}
|
||||
{{- $header_config := .Params.header.navbar | default site.Params.header.navbar | default dict -}}
|
||||
{{- $header_config := .Params.header.navbar | default site.Params.hugoblox.header | default dict -}}
|
||||
{{- $block_name := partial "hbx/resolve-block-param" (dict "config" $header_config "context" "header") | default "navbar" -}}
|
||||
{{ $block_path := printf "components/headers/%s.html" $block_name }}
|
||||
{{ if not (templates.Exists (printf "_partials/%s" $block_path)) }}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- $cfg := site.Params.marketing.seo.llm | default dict -}}
|
||||
{{- $cfg := site.Params.hugoblox.seo.ai | default dict -}}
|
||||
{{- $allows := $cfg.allow | default (slice "/") -}}
|
||||
{{- $disallows := $cfg.disallow | default slice -}}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
</div>
|
||||
|
||||
{{/* Search box for Q&A - Integrated with Pagefind */}}
|
||||
{{ if site.Params.features.search.provider }}
|
||||
{{ if site.Params.hugoblox.search.enable }}
|
||||
<div class="mb-8">
|
||||
<button
|
||||
data-search-toggle
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
<div class="mt-4 mb-16">
|
||||
<div class="text-gray-500 dark:text-gray-300 text-sm flex items-center flex-wrap gap-y-2">
|
||||
{{- if .Date | and (not .Params.hide_date) -}}
|
||||
<span class="mr-1">{{- .Date | time.Format (site.Params.locale.date_format | default ":date_long") -}}</span>
|
||||
<span class="mr-1">{{- .Date | time.Format (site.Params.hugoblox.locale.date_format | default ":date_long") -}}</span>
|
||||
{{- if .Params.authors }}<span class="mx-1">·</span>{{ end -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
Reference in new issue
Block a user