Skip to content

Native support for Marp (via marp-cli) as a markup renderer #14475

@wjkoh

Description

@wjkoh

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:

  1. Run marp-cli in a separate sidecar process (e.g., via Taskfile) to build into static/.
  2. Manually manage asset syncing for images in presentation bundles.
  3. Use an iframe in a Hugo layout to wrap the generated HTML, because Hugo's internal rendering pipeline expects to inject .Content into 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 doc

Key Requirements:

  1. Security Policy integration: Allow marp (or npx @marp-team/marp-cli) in security.exec.allow.
  2. Standardized Content Pipeline: Hugo should recognize .md files with marp: true (or a specific extension) and delegate to marp-cli.
  3. 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.html wrapping.

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 Taskfile and rsync. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions