Update the embed
case in /frontend/components/BlockRenderer.tsx
to handle PDF embeds from glance-pdf-embed.val.run
with special rendering while maintaining fallback for other embed types.
Locate the target code: Find the case 'embed':
block in the switch statement (around lines 333-343)
Replace the entire case block with this exact code:
case 'embed': const url = blockData?.url || '';
// handle the special case of the PDF embed, which rewrites the placeholder embed as a PDF link // note that the slug below builds a link to the PDF at /demo/:id/pdf // and has the Glance className to render it in the Glance PDF viewer: a.pdf if (url.includes("glance-pdf-embed.val.run")) { const slug = [location.pathname, "pdf"].join("/"); return (
); }return (
Embedded content: {url}
pdf pdf-download-btn
classesurl.includes("glance-pdf-embed.val.run")
[location.pathname, "pdf"].join("/")
renderChildren()
glance-pdf-embed.val.run
render as blue button linking to /current-path/pdf
pdf pdf-download-btn
classes preserved