Skip to content
Discussion options

You must be logged in to vote

Kind of. You can access any metadata variable in the template. Note, though, that Pandoc's template language is pretty basic compared to something like Jinja or Handlebars. There is no equivalent to and or not, $if(variable)$ only checks for the existence and "truth" of the variable, so something like what you suggest will need to be built up from more primitive parts. One way to fake if not is to check for the variable, but then immediately have an else clause, so the contents are only output if the variable is absent or false. Something like this:

$if(title)$
$if(hideTitle)$
$else$
...
$endif$
$endif$

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
6 replies
@bpj
Comment options

@helloitsclayton
Comment options

@alerque
Comment options

@bpj
Comment options

@helloitsclayton
Comment options

Comment options

You must be logged in to vote
3 replies
@helloitsclayton
Comment options

@HeirOfNorton
Comment options

Answer selected by helloitsclayton
@helloitsclayton
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants