Looping in md page?

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.

Content (markdown + shortcode calls) goes in content files.

Template code goes in template files.

You cannot mix the two.

Cool. Doesn’t help even a little bit.

I am clearly trying other options - like the partial page (which is template, right? So I put template in template but it still doesn’t work). I do not know how to accomplish a task as simple as “put three blog entires on the homepage” and your response did nothing to move that forward. In fact for a struggling user who is legitimately trying to find the right answer, it’s extremely insulting.

I’ve been searching for hours and all I’ve found is short codes can’t go in shortcodes, shortcodes can’t go in partial. So… there appears to be no way to loop the use of shortcodes? Or use any templating inside of any other templating?

I’m sorry you feel insulted.
I’m sorry you’ve been searching for hours.

Either create a new shortcode that does what you want, or modify the home page template.