Closed benbarbour closed 1 month ago
If found https://github.com/imfing/hextra/issues/439 but I don't think the workaround posted there works anymore.
@benbarbour I'm not sure as a partial, but that code should work as a shortcode. I.e. save it as layouts/shortcodes/card-list.html
and then call it in the _index.md
using {{< card-list >}}
.
Or does that not work for you?
Feature Description
I would like to make either a list template or a shortcode (or both) that displays a collection of pages as cards.
Problem/Solution
If I'm understanding things correctly, you can't call
layouts/shortcodes/cards.html
from within a partial, so it's functionality would need to be moved to a partial and the shortcode should become a very thin wrapper around the partial. I think, in general, this is a good pattern to follow. The Relearn theme seems to do it a lot.Alternatives Considered
If found #439 but I don't think the workaround posted there works anymore.