Chris, the docs indicate that the value still needs to be resolved to be
passed to the template.

Suppose I create  shortcodes/foo.tmpl as such:

This uses the bar variable: ${bar}

And my post contains this:

{{% foo bar=slug %}}


Then the output file will contain:

This uses the bar variable: slug

But I want to output the value of *slug*.  In shell it would be the simple
difference of echo $slug vs echo slug.














On Fri, May 1, 2020 at 4:13 PM Chris Warrick <kwpol...@gmail.com> wrote:

> On Fri, 1 May 2020 at 22:11, Steve <gp6...@gmail.com> wrote:
> >
> > Hi all,
> >
> > I'm sure I overlooked something basic - how can I output a metadata
> variable from my document via reStructuredText?    I've read extensively
> about these values but cannot find how to use one in a post or file.  None
> of the tests below work to render the value assigned to the slug.  Also,
> are there any examples of more advanced .rst documents used with Nikola?
> Maybe I can find some answers by example.
> >
> >
> > .. title: 1960s Macho Legends
> > .. slug: macho-legends
> >
> > My slug is {$slug}
> >
> > or is it ``slug``
> >
> > or is it :slug:
> >
> > our could it be {{% slug %}}
> >
> > nfw it is {{% raw %}}{{% slug %}}{{% /raw %}}
>
> You could use a template-based shortcode:
> https://getnikola.com/handbook.html#template-based-shortcodes
>
> --
> Chris Warrick <https://chriswarrick.com/>
> PGP: 5EAAEA16
>
> --
> You received this message because you are subscribed to the Google Groups
> "nikola-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nikola-discuss+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nikola-discuss/CAMw%2Bj7LWhcs4JrF7Y2tfE94%2B07grZ3hJU9bNaMHFq1fnDm9YkA%40mail.gmail.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"nikola-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nikola-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nikola-discuss/CADP4AcrpfGukVGSeJt%2B3hdLwAcGKu-ZuLctEbu-0SicD1rvY0A%40mail.gmail.com.

Reply via email to