How can I specify that an org-mode file should not be rendered?

I’m trying to figure out how to include an org-mode file as a page resource in a bundle, without Hugo trying to render that file, in a site that also has some content in org-mode files that should be rendered as normal.

I think what I’m looking for is the right syntax to specify Build options in an org-mode compatible way.

Any suggestions? A little more detail/context on what I’m actually trying to achieve follows…


I use org-mode and org-re-reveal to make slide decks for talks. I want to publish a post on my blog that mentions a recent talk I gave, and includes 1) links to the original org file and the rendered (by emacs & org-re-reveal) HTML slides; 2) the slides themselves embedded in an iframe.

I want hugo to treat both slides.org and slides.html as static files that I can link to via RelPermalink without triggering any further processing on them, because I will manually update slides.html from within emacs when I make changes. Hugo sees slides.org and tries to render it, but chokes on #+date: Thursday 21 August, which is the date I want to appear on my slides but not a date I need Hugo to parse.

I see from the build options docs that I can use frontmatter to disable rendering:

---
build:
  render: never
---

And, indeed, this does solve the error from hugo, but then when I export the slides within emacs it treats the YAML frontmatter as text like any other and outputs it into the HTML.

So… presumably what I need is a way to set the build.render key in such a way that emacs’ org-mode parser ignores it?

If all of your content were Markdown, you could configure Hugo to not process html and org page resources, something like:

[contentTypes]
  [contentTypes.'text/asciidoc']
  [contentTypes.'text/markdown']
  [contentTypes.'text/pandoc']
  [contentTypes.'text/rst']

Note that we have excluded text/html and text/org.

However, given that some of your content files are org files, I think you’ll need to use global resources instead of page resources.