-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Description
I am looking for a way to integrate Marp presentations more deeply into Hugo. While Hugo has excellent support for Markdown via Goldmark, and external tools like Asciidoctor or Pandoc (as documented in Hugo's Markup Configuration), there is currently no idiomatic way to handle "Slides-as-Content" where the output is a standalone HTML slide deck.
Currently, if I want to use Marp, I have to:
- Run
marp-cliin a separate sidecar process (e.g., viaTaskfile) to build intostatic/. - Manually manage asset syncing for images in presentation bundles.
- Use an
iframein a Hugo layout to wrap the generated HTML, because Hugo's internal rendering pipeline expects to inject.Contentinto a site template (baseof.html).
Describe the solution you'd like
I would like to see Marp supported as an external renderer within the [markup] configuration block.
Following the pattern of asciidocExt or goldmark, we could have a marp block:
[markup.marp]
args = ["--html"] # Pass-through args for marp-cli
standalone = true # A new concept: tell Hugo this renderer produces a full HTML docKey Requirements:
- Security Policy integration: Allow
marp(ornpx @marp-team/marp-cli) insecurity.exec.allow. - Standardized Content Pipeline: Hugo should recognize
.mdfiles withmarp: true(or a specific extension) and delegate tomarp-cli. - Template Bypassing: Since Marp generates a complete HTML file with its own CSS and JS, Hugo should have a mechanism (perhaps a new Layout property) to serve the renderer's output as the final response, bypassing
baseof.htmlwrapping.
Describe alternatives you've considered
- Custom External Helper: Using
[markup.goldmark.extensions.passthrough], but this doesn't solve the standalone document issue. - Sidecar Build: My current approach using
Taskfileandrsync. It works but is brittle and requires users to manage two separate build tools and watchers. - Reveal.js Modules: While great, they don't offer the same "single-file PDF/PPTX export" ecosystem that Marp provides.
Additional context
As noted in the Hugo documentation for External Renderers, Hugo already has a robust framework for calling external binaries. Extending this to support "Presentation-as-Content" would make Hugo the premier platform for technical speakers and educators who want to manage their slides alongside their blog posts in a single, unified Git repository.