Template-based shortcodes and reST

5 views
Skip to first unread message

Hartmut Goebel

unread,
Jun 13, 2024, 9:08:52 AMJun 13
to nikola-discuss

Hi,

I created a template based shortcode "button", and using it as directive according to the example for "post-list":

.. button::
   :icon: paperplane
   :color: blue

   This is the text in the button

Anyhow. when using it in reST file, I get "Unknown directive type "button"".

I tried both

  • themes/mytheme/shortcodes/button.tmpl
  • themes/mytheme/templates/shortcodes/button.tmpl

without success.

What am I doing wrong?

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.go...@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |

Roberto Alsina

unread,
Jun 13, 2024, 1:08:57 PMJun 13
to nikola-...@googlegroups.com
That's a directive, shortcodes look more like this:

{{% button icon=paperplance color=blue %}}

--
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-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nikola-discuss/f7b086ec-592b-44de-9228-66bc0d7ab38e%40crazy-compilers.com.

Hartmut Goebel

unread,
Jun 14, 2024, 8:36:46 AMJun 14
to nikola-...@googlegroups.com
Am 13.06.24 um 19:08 schrieb Roberto Alsina:
> That's a directive, shortcodes look more like this:
>
> {{% button icon=paperplance color=blue %}}

Thanks. I thought shortcodes can be used like directives, since
"post-list" is available as both shortcode and directive.
Reply all
Reply to author
Forward
0 new messages