From: Indy Singh <singh400-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re-use metadata variables in header-includes?
Date: Mon, 26 Jun 2023 13:43:36 -0700 (PDT) [thread overview]
Message-ID: <0528e5ed-7b8e-41c0-a67b-0133b17b8955n@googlegroups.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 2319 bytes --]
Question is nicely formatted here, but a copy and paste:-
Given this as input.md:-
```markdown
---
title: Strings Are Evil
subtitle: Reducing memory allocations from 7.5GB to 32KB
header-includes: |
<meta name="og:type" property="og:type"
content="website">
<meta name="title" property="title"
content="{{title}}" />
<meta name="description" property="description"
content="{{subtitle}}" />
<meta name="og:title" property="og:title"
content="{{title}}" />
<meta name="og:description" property="og:description"
content="{{subtitle}}" />
<meta name="twitter:title" property="twitter:title"
content="{{title}}" />
<meta name="twitter:description" property="twitter:description"
content="{{subtitle}}" />
---
rest of the blog
```
Produce this output:-
```html
<meta name="og:type" property="og:type" content="website">
<meta name="title" property="title" content="Strings Are
Evil" />
<meta name="description" property="description"
content="Reducing memory allocations from 7.5GB to 32KB" />
<meta name="og:title" property="og:title" content="Strings
Are Evil" />
<meta name="og:description" property="og:description"
content="Reducing memory allocations from 7.5GB to 32KB" />
<meta name="twitter:title" property="twitter:title"
content="Strings Are Evil" />
<meta name="twitter:description" property="twitter:description"
content="Reducing memory allocations from 7.5GB to 32KB" />
```
I did try
https://pandoc.org/lua-filters.html#replacing-placeholders-with-their-metadata-value
and played about with
https://github.com/jgm/pandoc/issues/1950#issuecomment-74613325 but I could
never get it to work inside the markdown meta block.
I've tried various incarnations of `{.thing}` too.
Cheers,
Indy
--
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/0528e5ed-7b8e-41c0-a67b-0133b17b8955n%40googlegroups.com.
[-- Attachment #1.2: Type: text/html, Size: 2991 bytes --]
next reply other threads:[~2023-06-26 20:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-26 20:43 Indy Singh [this message]
[not found] ` <0528e5ed-7b8e-41c0-a67b-0133b17b8955n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-06-26 20:44 ` Indy Singh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0528e5ed-7b8e-41c0-a67b-0133b17b8955n@googlegroups.com \
--to=singh400-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).