Re: [nikola-discuss] How to reference a metadata value in reStructuredText?

2020-05-04 Thread Chris Warrick
On Mon, 4 May 2020 at 17:46, Steve wrote: > > Why does "title" work but not "slug"? > > > > {{% template %}} > > The title is: ${post.slug()} > > {{% /template %}} > > ... rejected Title has its own function, but slug does not. Use: ${post.meta('slug')} On Mon, 4 May 2020 at 17:54, Steve

Re: [nikola-discuss] How to reference a metadata value in reStructuredText?

2020-05-04 Thread Steve
What is the context for using* echo '${post.title()}' > shortcodes/foo.tmpl *? This is not restructured text, it would be some sort of shell escape that is recognized and executed during a build I suppose? I could not find this documented. If embedded shell hooks are possible, perhaps I

Re: [nikola-discuss] How to reference a metadata value in reStructuredText?

2020-05-04 Thread Steve
Why does "title" work but not "slug"? {{% template %}} The title is: ${post.slug()} {{% /template %}} ... rejected -- 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,

Re: [nikola-discuss] How to reference a metadata value in reStructuredText?

2020-05-04 Thread Roberto Alsina
And yes, the shortcode there HAS to say "template" :-) On Mon, May 4, 2020 at 12:05 PM Roberto Alsina wrote: > This works too: > > > > {{% template %}} > > The title is: ${post.title()} > > {{% /template %}} > ~ > > On Mon, May 4, 2020 at 11:03 AM Chris Warrick wrote: > >> On Mon, 4 May 2020

Re: [nikola-discuss] How to reference a metadata value in reStructuredText?

2020-05-04 Thread Roberto Alsina
This works too: {{% template %}} The title is: ${post.title()} {{% /template %}} ~ On Mon, May 4, 2020 at 11:03 AM Chris Warrick wrote: > On Mon, 4 May 2020 at 16:00, Steve wrote: > > > > Chris, thanks for the clue. I still have not escaped the room. Tried > with no avail: > > > > {{%

Re: [nikola-discuss] How to reference a metadata value in reStructuredText?

2020-05-04 Thread Chris Warrick
On Mon, 4 May 2020 at 16:00, Steve wrote: > > Chris, thanks for the clue. I still have not escaped the room. Tried with > no avail: > > {{% post.title %}} > {{% post.data(title) %}} > {{% post.data title %}} You need to create templated shortcode, and use `post` inside it: echo

Re: [nikola-discuss] How to reference a metadata value in reStructuredText?

2020-05-02 Thread Chris Warrick
On Sat, 2 May 2020 at 17:03, Steve wrote: > > 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 %}} > > >

Re: [nikola-discuss] How to reference a metadata value in reStructuredText?

2020-05-02 Thread Steve
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:

Re: [nikola-discuss] How to reference a metadata value in reStructuredText?

2020-05-01 Thread Chris Warrick
On Fri, 1 May 2020 at 22:11, Steve 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 >

[nikola-discuss] How to reference a metadata value in reStructuredText?

2020-05-01 Thread Steve
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.