rmfberlin
rmfberlin

Reputation: 33

Automating Frontmatter Removal: Streamlining Hugo and AsciiDoctor PDF Integration

Hugo removes the frontmatter from an Asciidoc file before passing the document to the Asciidoc processor. For example

---
title:
subtitle:
...
__

But how can I hide the frontmatter for Hugo for Asciidoctor PDF if asciidoctor-pdf is to generate the PDF? Without having to comment out the first lines?

Is there a way to automate this?

Conversely, it is possible to adapt individual parameters to Hugo in Asciidoc. See Path Predicament: Navigating Image Rendering Discrepancies Between AsciiDoctor PDF and Hugo

Upvotes: 1

Views: 42

Answers (1)

rmfberlin
rmfberlin

Reputation: 33

The solution is so simple: Asccidoctor-pdf only needs one additional attribute when translating an adoc file into a PDF:

-a skip-front-matter

skip-front-matter attribute

Upvotes: 1

Related Questions