{{- /* SEO & Social Media Meta Tags */ -}}
{{- $shortTitle := site.Params.shortTitle | default site.Title -}}
{{- $baseTitle := .Title -}}
{{- if hasPrefix .Title "http" -}}{{- $baseTitle = cond .Parent .Parent.Title site.Title -}}{{- end -}}
{{- $pagerSuffix := "" -}}
{{- if and (not .IsPage) .Paginator (gt .Paginator.PageNumber 1) -}}
{{- $pagerSuffix = cond (eq .Language.Lang "zh") (printf " - 第 %d 页" .Paginator.PageNumber) (printf " - Page %d" .Paginator.PageNumber) -}}
{{- end -}}
{{- $titleCore := cond (gt (len $baseTitle) 50) (printf "%s…" (substr $baseTitle 0 50)) $baseTitle -}}
{{- $title := cond .IsHome site.Title (printf "%s%s | %s" $titleCore $pagerSuffix $shortTitle) -}}
{{- $taxonomyDesc := "" -}}
{{- if eq .Kind "taxonomy" -}}
{{- $taxonomyDesc = cond (eq .Language.Lang "zh") "探索 cubxxw 博客的所有话题。" (printf "Browse all topics on cubxxw blog.") -}}
{{- else if eq .Kind "term" -}}
{{- $taxonomyDesc = cond (eq .Language.Lang "zh") (printf "浏览 %d 篇关于 %s 的文章。" (len .Pages) .Title) (printf "Browse %d articles tagged with %s." (len .Pages) .Title) -}}
{{- end -}}
{{- $description := cond (ne $taxonomyDesc "") $taxonomyDesc (cond .IsHome site.Params.description (cond .Description .Description .Summary | plainify | truncate 160)) -}}
{{- $keywords := cond .IsHome site.Params.keywords (cond .Params.keywords .Params.keywords (slice)) -}}
{{- $author := cond .IsHome site.Params.author (cond .Params.author .Params.author site.Params.author) -}}
{{- /* Canonical URL */ -}}
{{- /* Basic SEO */ -}}
{{- if .Params.date -}}
{{- end -}}
{{- /* Open Graph / Facebook */ -}}
{{- $ogType := cond (or .IsHome (eq .Kind "taxonomy") (eq .Kind "term") (eq .Kind "section")) "website" "article" -}}
{{- $ogLocale := cond (eq .Language.Lang "zh") "zh_CN" "en_US" -}}
{{- range .AllTranslations -}}
{{- if ne .Language.Lang $.Language.Lang -}}
{{- end -}}
{{- end -}}
{{- $sectionDefault := dict "ai-technology" "/assets/og-ai-technology.png" "growth" "/assets/og-growth.png" "projects" "/assets/og-projects.png" -}}
{{- $defaultOgImage := index (site.Params.images | default (slice "/assets/og-image.png")) 0 -}}
{{- $sectionOgImage := index $sectionDefault .Section | default $defaultOgImage -}}
{{- $ogImage := $sectionOgImage -}}
{{- with .Params.cover.image -}}{{- $ogImage = . -}}{{- end -}}
{{- if .Params.date -}}
{{- end -}}
{{- if .Lastmod -}}
{{- end -}}
{{- with .Params.tags -}}
{{- range first 5 . -}}
{{- end -}}
{{- end -}}
{{- $cats := .Params.categories -}}
{{- if $cats -}}
{{- if not (reflect.IsSlice $cats) -}}{{- $cats = slice $cats -}}{{- end -}}
{{- range first 3 $cats -}}
{{- end -}}
{{- end -}}
{{- /* Twitter Card */ -}}
{{- with site.Params.social.twitter -}}
{{- end -}}
{{- /* Favicons are emitted once by head.html (with defaults) — do not
duplicate them here. */ -}}
{{- /* RSS Feed */ -}}
{{- range .AlternativeOutputFormats -}}
{{- if eq .Rel "alternate" -}}
{{- end -}}
{{- end -}}
{{- /* Structured Data / JSON-LD */ -}}
{{- partial "seo/structured-data.html" . -}}
{{- /* Preconnect/DNS hints are consolidated in extend_head.html */ -}}