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
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
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,
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
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:
> >
> > {{%
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
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 %}}
>
>
>
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:
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
>
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.
10 matches
Mail list logo