* Re-use metadata variables in header-includes?
@ 2023-06-26 20:43 Indy Singh
[not found] ` <0528e5ed-7b8e-41c0-a67b-0133b17b8955n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Indy Singh @ 2023-06-26 20:43 UTC (permalink / raw)
To: pandoc-discuss
[-- 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 --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Re-use metadata variables in header-includes?
[not found] ` <0528e5ed-7b8e-41c0-a67b-0133b17b8955n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2023-06-26 20:44 ` Indy Singh
0 siblings, 0 replies; 2+ messages in thread
From: Indy Singh @ 2023-06-26 20:44 UTC (permalink / raw)
To: pandoc-discuss
[-- Attachment #1.1: Type: text/plain, Size: 2567 bytes --]
Question is nicely formatted here: https://github.com/jgm/pandoc/issues/8919
On Monday, 26 June 2023 at 21:43:36 UTC+1 Indy Singh wrote:
> 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/fdbc8315-8a84-4ae7-bdea-aa39bfb88fa9n%40googlegroups.com.
[-- Attachment #1.2: Type: text/html, Size: 4376 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-06-26 20:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-26 20:43 Re-use metadata variables in header-includes? Indy Singh
[not found] ` <0528e5ed-7b8e-41c0-a67b-0133b17b8955n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-06-26 20:44 ` Indy Singh
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).