How can I add header metadata without adding the <h1>?

Viewed 193

I'm writing something in markdown and converting it to html with pandoc, but when I add the title variable in the yaml header, it also adds an <h1> to the top of the document, which I don't want. In the pandoc documentation it says to use the title-meta variable, but it still says

[WARNING] This document format requires a nonempty <title> element.

Is there a way to set the title without adding the title block?

command I'm using:

pandoc -s "file.md" -o "file.html"`

output of pandoc --version:

pandoc 2.10.1
Compiled with pandoc-types 1.21, texmath 0.12.0.2, skylighting 0.8.5
Default user data directory: C:\Users\noah\AppData\Roaming\pandoc
Copyright (C) 2006-2020 John MacFarlane
Web:  https://pandoc.org
This is free software; see the source for copying conditions.
There is no warranty, not even for merchantability or fitness
for a particular purpose.
1 Answers

One can set an explicit title with --metadata=title="My title" while simultaneously preventing the output of the <h1> and <header> elements by setting the template variable title to an empty string:

pandoc --metadata=title="Fancy title" --variable=title="" ... 
Related