I’m returning to Hugo after being gone for a long time and things have changed a lot and I’ve forgotten a lot.
In my _index.md, homepage, I want to include just the last three blog entries somewhere down in the page. It’s a documentation static site using the Docsy theme, so the blog isn’t the important info
<!-- THREE BLOG ENTRIES HERE -->
{{% blocks/feature icon="fa-lightbulb" title="" %}}
<a href="bloglink1">Blog Title 1</a>
{{% /blocks/feature %}}
{{% blocks/feature icon="fa-lightbulb" title="" %}}
<a href="bloglink2">Blog Title 2</a>
{{% /blocks/feature %}}
{{% blocks/feature icon="fa-lightbulb" title="" %}}
<a href="bloglink3">Blog Title 3</a>
{{% /blocks/feature %}}
<!-- THREE BLOG ENTRIES HERE -->
This is what I’d like the results to be, effectively. Blog entries inside of the existing short code blocks.
As I understand it, roughly this should work:
{{ range first 3 (where .Site.RegularPages "Type" "blog") }}
{{% blocks/feature icon="fa-lightbulb" title="" %}}
<a href="{{ .Permalink }}">{{ .Title }}</a>
{{% /blocks/feature %}}
{{ end }}
However, when I do that, it renders that literally. I’ve tried to make it a shortcode, but I can’t shortcode inside shortcodes. I’m clearly missing something fundamental here that has changed.
I’ve also tried moving the loop code into a partial file, but it doesn’t like invoking the shortcodes in there either.