%
// Show profile-header unless we're on an admin page or the site explicitly
// disabled it via profile_enabled=0.
const _showProfile = site
&& (site.profile_enabled === undefined || site.profile_enabled !== 0)
&& !(typeof bodyClass !== 'undefined' && bodyClass.indexOf('on-admin') >= 0);
// profile_name and profile_bio used to be optional overrides exposed in the
// admin form. P62 removed those form fields — title and description are the
// single source of truth. We still consult the override columns first for
// backward compat with any legacy data, but the form no longer writes them.
const _displayName = (site && (site.profile_name || site.title)) || '';
const _bioText = (site && (site.profile_bio || site.description || site.tagline)) || '';
// Parse profile_links JSON column once.
let _profileLinks = [];
if (site && site.profile_links) {
try { _profileLinks = JSON.parse(site.profile_links) || []; } catch (e) { _profileLinks = []; }
}
%>
<% if (_showProfile) { %>
<% } %>