public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Determining that a Pandoc Variable is the Empty String
@ 2023-03-08  4:41 S. Manning
       [not found] ` <baea52e4f4b9a22d832faa30ab3fd116-aFO/2INALiozYggVrLCuDg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: S. Manning @ 2023-03-08  4:41 UTC (permalink / raw)
  To: Pandoc discuss

I would like to add a tag system to my static site which I generate with 
Pandoc templates.  Adding a tags: variable in myPage.yaml is easy, but 
then I want to add links from pages with the tag to the page for that 
tag.  Code like:

$for(tags)$
<a href="https://mysite.org/tags/$tags$.html">⇐ back to $tags$</a>&nbsp;
$endfor$

adds a link even if the tags variable is empty ("tags: " in the YAML 
file).

How can I check that the tag is not empty or a null string or however 
Pandoc defines it?

https://pandoc.org/MANUAL.html#interpolated-variables alludes to 
variable types such as string and list, but does not define them or 
explain how to get the attributes of complex variables such as lists.

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/baea52e4f4b9a22d832faa30ab3fd116%40ageofdatini.info.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-08  4:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-08  4:41 Determining that a Pandoc Variable is the Empty String S. Manning
     [not found] ` <baea52e4f4b9a22d832faa30ab3fd116-aFO/2INALiozYggVrLCuDg@public.gmane.org>
2023-03-08  4:44   ` John MacFarlane
     [not found]     ` <DA455835-3B72-4022-A761-E7A96E904EEA-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2023-03-08  4:50       ` S. Manning

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).