The custom head loads the bundled JSZip, docx-preview, and SheetJS scripts inline, injects preview-specific styles, and runs a script that scans .page-content for links to /attachments/{id}. It looks up attachment names in #page-attachments, then replaces each inline link with a structured preview card (.attachment-preview) containing a header (file icon, filename link, extension badge, download action) and a body that renders the appropriate preview: PDF in a resizable <object>, DOCX via docx.renderAsync, XLSX via XLSX.utils.sheet_to_html, images/video/audio via native elements, or a fallback message if unsupported.
This change adds a self-contained install flow that builds a theme-like dist/ folder, copies required frontend assets into dist/public, and installs the custom head template into dist/layouts/parts. It also cleans up the temporary node_modules after copying and aligns the docs and metadata with the new output structure.