How to call short-code in a loop with all the pages in section

I need help on calling a shortcode from the theme I use multiple times for each content page I have.

I’m using the theme Hextra: Hextra

I want to use the card shortcode in the section page,

My contents folder is something like:

├── posts
│   ├── _index.md
│   ├── Group1
│   │   ├── Project1
│   │   └── Project2
│   ├── Group2
│   │   └── Project20

I want to do this in the _index.md page and list all the projects with cards (and maybe with filtering of frontmatter param)

My initial thought is like in a for loop in programming

{{range .Page.Pages -}}
{{< card title:=.Title link:=.Path >}}
{{- end -}}

Which I figured out that I can’t call shortcode within shortcode.

So what is the best way of achieving this: listing all sub pages with card shortcode without typing out each individual page manually.

Create a “card” partial template, and call the partial within the loop.

If you need additional assistance with the Hextra theme, please ask your questions here:
https://github.com/imfing/hextra/discussions

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.