{{- if or (eq .Kind "404") .Params.robotsNoIndex }} {{- else if hugo.IsProduction | or (eq site.Params.env "production") }} {{- else }} {{- end }} {{- /* Title */}} {{- $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) -}} {{- if eq .Language.Lang "zh" -}} {{- $pagerSuffix = printf " - 第 %d 页" .Paginator.PageNumber -}} {{- else -}} {{- $pagerSuffix = printf " - Page %d" .Paginator.PageNumber -}} {{- end -}} {{- end -}} {{- $titleCore := cond (gt (len $baseTitle) 50) (printf "%s…" (substr $baseTitle 0 50)) $baseTitle -}} {{- $pageTitle := cond .IsHome site.Title (printf "%s%s | %s" $titleCore $pagerSuffix $shortTitle) -}}