'use strict'; const GITHUB_SVG = ''; const BLUESKY_SVG = ''; /** * @typedef {Object} NavLink * @property {string} label * @property {string} href * @property {boolean} [external] * @property {string} [svg] - Inline SVG string shown instead of label text. */ /** @type {NavLink[]} */ const NAV_LINKS = [ { label: 'home', href: '/' }, { label: 'blog', href: '/blog.html' }, { label: 'docs', href: '/docs/' }, { label: 'materials', href: '/materials' }, { label: 'GitHub', href: 'https://github.com/litruv', external: true, svg: GITHUB_SVG }, { label: 'Bluesky', href: 'https://bsky.app/profile/lit.mates.dev', external: true, svg: BLUESKY_SVG }, ]; /** * Renders nav link `` elements as an HTML string. * * @param {string} [indent=' '] - Leading whitespace for each line. * @returns {string} */ function renderNavLinkItems(indent = ' ') { return NAV_LINKS.map(({ label, href, external, svg }) => { const attrs = external ? ' target="_blank" rel="noopener"' : ''; const content = svg ? svg : label; const extraClass = svg ? ' quick-link--icon' : ''; return `${indent}${content}`; }).join('\n'); } module.exports = { NAV_LINKS, renderNavLinkItems };