// Shared layout, icons and small HTML helpers for every page.
import { LOCALES, LOCALE_NAMES, LOCALE_SHORT, OG_LOCALE, dirOf, localize } from './i18n.mjs';
export const SITE = {
url: 'https://dylanmazzei.com',
email: 'dylan@dylanmazzei.com',
pressEmail: 'press@dylanmazzei.com',
linkedin: 'https://www.linkedin.com/in/dylanmazzei/',
instagram: 'https://www.instagram.com/thedylanmazzei',
// Replace with the real scheduling link (Calendly, Cal.com, etc.).
calendar: '/contact/book/',
// GoHighLevel (LeadConnector) widgets. Contacts land in Dylan's GHL account.
ghl: {
form: 'xm10A7alZrxeKDtkMkD2', // "Dylan – Lead Form"
freeCalendar: '81JqpCRit6APOwavApzh', // Free 15-min intro call with Dylan's team
vipCalendar: 'lK9IYtCRGIuA7W93WjMF', // 15-min 1:1 with Dylan ($100)
},
};
const ICONS = {
arrow: '',
'arrow-ur': '',
check: '',
plus: '',
chev: '',
menu: '',
close: '',
brace: '',
search: '',
chip: '',
bottle: '',
edu: '',
shield: '',
bag: '',
umbrella: '',
megaphone: '',
heart: '',
shirt: '',
building: '',
gauge: '',
truck: '',
compass: '',
target: '',
users: '',
chart: '',
layers: '',
mic: '',
rocket: '',
route: '',
mail: '',
calendar: '',
pin: '',
book: '',
pen: '',
moon: '',
sun: '',
spark: '',
};
const SMALL = new Set(['arrow', 'arrow-ur', 'check', 'plus', 'chev', 'brace']);
export function icon(name, cls = '') {
const vb = SMALL.has(name) ? '0 0 16 16' : name === 'menu' || name === 'close' ? '0 0 18 18' : '0 0 24 24';
const sw = SMALL.has(name) || name === 'menu' || name === 'close' ? '' : ' stroke-width="1.75"';
// Arrows point the other way on right-to-left pages (rtl.css).
const c = name.startsWith('arrow') ? (cls ? cls + ' flip' : 'flip') : cls;
return ``;
}
// Dylan Mazzei monogram: italic "D" (inherits text color) and the sky-blue blade.
export const mark = (cls = 'logo-mark') => ``;
export const logo = () => `
${mark()}Dylan Mazzei`;
export const eyebrow = (t) => `${t}`;
export function btn(text, href, variant = 'primary', extra = '') {
const ext = /^https?:/.test(href) ? ' target="_blank" rel="noopener"' : '';
return ``;
}
export function textLink(text, href) {
const ext = /^https?:/.test(href) ? ' target="_blank" rel="noopener"' : '';
return `${text} ${icon('arrow')}`;
}
export const paras = (arr, cls = '') => arr.map((t) => `
${t}
`).join('');
export function faq(items) {
return `${items
.map(
([q, a], i) => `
${q}${icon('plus')}
${paras(a)}
`
)
.join('')}
`;
}
const NAV = [
{ label: 'Portfolio', href: '/portfolio/' },
{ label: 'About', href: '/about/' },
{
label: 'Consulting',
href: '/consulting/',
children: [
{ label: 'Consulting', desc: 'Find the Real Problem. Then Fix the Right One.', href: '/consulting/', icon: 'compass' },
{ label: 'Marketing & AI Search', desc: 'Get Found Where Attention Is Moving.', href: '/consulting/marketing/', icon: 'search' },
{ label: 'Business Setup', desc: 'Start With Fewer Expensive Mistakes.', href: '/consulting/business-setup/', icon: 'building' },
{ label: 'Business Optimization', desc: 'Find What Growth Made Messy.', href: '/consulting/business-optimization/', icon: 'gauge' },
{ label: 'Supply Chain', desc: 'Know What Happens Before It Reaches the Customer.', href: '/consulting/supply-chain/', icon: 'truck' },
{ label: 'Cybersecurity', desc: 'Find the Exposure Before Someone Else Does.', href: '/consulting/cybersecurity/', icon: 'shield' },
{ label: 'Education', desc: 'Make the Strategy Survive the Classroom.', href: '/consulting/education/', icon: 'edu' },
{ label: 'Fractional Leadership', desc: 'When the Business Needs an Owner, Not Another Recommendation.', href: '/consulting/fractional/', icon: 'users' },
],
},
{ label: 'Press', href: '/press/' },
];
// EN · ES · AR. Plain links: each language is its own static page.
function langSwitch(path, locale) {
return ``;
}
function nav(path, locale) {
const isActive = (href) => (href === '/' ? path === '/' : path.startsWith(href));
const desktop = NAV.map((item) => {
if (!item.children) {
return `${item.label}`;
}
return `
`;
}).join('');
const mobile = NAV.map((item) => {
const top = `${item.label} ${icon('arrow', 'check')}`;
if (!item.children) return top;
return top + item.children.slice(1).map((c) => `${c.label}`).join('');
}).join('');
return `Skip to content
`;
}
function footer() {
return ``;
}
export function page({ path, title, description, body, schema = [], head = '', scripts = '', noindex = false }, locale = 'en') {
const canonical = SITE.url + localize(path, locale);
const alternates = noindex ? '' : [...LOCALES.map((l) => [l, l]), ['x-default', 'en']]
.map(([hl, l]) => `\n`).join('');
const person = {
'@context': 'https://schema.org',
'@type': 'Person',
'@id': SITE.url + '/#dylan',
name: 'Dylan Mazzei',
url: SITE.url,
email: SITE.email,
image: SITE.url + '/assets/dylan-portrait.jpg',
jobTitle: 'Founder & Operator',
sameAs: [SITE.linkedin, SITE.instagram],
};
const ld = [person, ...schema].map((s) => ``).join('\n');
return `
${title}
${alternates}${noindex ? '\n' : ''}
${locale === 'ar' ? '\n\n' : ''}
${head}
${ld}
${nav(path, locale)}
${body}
${footer()}
${scripts}
`;
}
// GoHighLevel embeds. form_embed.js resizes the iframes to their content.
export const GHL_SCRIPT = '';
export const ghlForm = (id, name) =>
``;
export const ghlCalendar = (id, title) =>
``;