{{/* Get profile data */}} {{ $displayName := "" }} {{ $name := "" }} {{ $picture := "" }} {{ $about := "" }} {{ range hugo.Data.profile }} {{ range . }} {{ range .tags }} {{ if eq (index . 0) "display_name" }} {{ $displayName = index . 1 }} {{ else if eq (index . 0) "name" }} {{ $name = index . 1 }} {{ else if eq (index . 0) "picture" }} {{ $picture = index . 1 }} {{ else if eq (index . 0) "about" }} {{ $about = index . 1 }} {{ end }} {{ end }} {{ end }} {{ end }} {{/* Fallback if display_name is empty */}} {{ if not $displayName }} {{ $displayName = $name }} {{ end }} {{/* If still empty, use site title */}} {{ if not $displayName }} {{ $displayName = .Site.Title }} {{ end }} {{/* Clean about text - remove markdown and HTML */}} {{ $cleanAbout := $about | plainify | htmlUnescape }} {{ $cleanAbout = trim $cleanAbout " \n\r\t" }} {{/* Truncate to 160 chars for SEO */}} {{ $truncatedAbout := $cleanAbout }} {{ if gt (len $truncatedAbout) 160 }} {{ $truncatedAbout = substr $truncatedAbout 0 160 | printf "%s…" }} {{ end }} {{/* Hugo escaping functions */}} {{ $escapedTitle := $displayName | safeHTMLAttr }} {{ $escapedDescription := $truncatedAbout | safeHTMLAttr }} {{ $escapedPicture := $picture | safeURL }} {{ $escapedSiteTitle := .Site.Title | safeHTMLAttr }} {{/* Build time in ISO 8601 format */}} {{ $buildTime := now.Format "2006-01-02T15:04:05-07:00" }} {{ $buildTimeRFC3339 := now.Format "2006-01-02T15:04:05Z07:00" }} {{/* Hugo version */}} {{ $hugoVersion := hugo.Version }} {{/* Base URL */}} {{ $baseURL := .Site.BaseURL | safeURL }} {{ $permalink := .Permalink | safeURL }}