Use a section of a page in home page

Hhallo, I’m starting with hugo and I have a question: I have a page built in this way:

{{ define “main” }}
{{ partial “page-header” . }}

{{ range .RegularPages }}
{{ partial "components/author-card" . }}
{{ end }}
{{ end }}

I would like the content (3 card img+text) in the home page but any experiment fail.
Can someone put me in the right way?
Thanks a lot
Jack

Limit | Hugo is your friend.

Not tested, but something like this:

{{ range .RegularPages.Limit 3 }}
{{ partial "components/author-card" . }}
{{ end }}

Thanks for helping… I put the code in the themes/hugoplate/layouts/index.html but it dosent’t appear

Well, what is inside of components/author-card? Also, what errors are you seeing on the CLI? It’s pretty hard to ascertain the issue from just some lines of code. Maybe have a quick look at Requesting Help about how you can help us to help you.

Hi, the page is excatly this: https://zeon.studio/preview?project=hugoplate and what I wanto to take and put in the home are the 3 cards. I have not error in the CLI

Thanks
Graziano

I’m not sure what that means.

I notice that, on your home page, you are ranging over the PAGE.RegularPages collection. With this content structure that page collection will be empty:

content/
├── posts/
│   ├── _index.md
│   ├── post-1.md
│   └── post-2.md
└── _index.md

With this content structure that page collection will contain about and contact:

content/
├── posts/
│   ├── _index.md
│   ├── post-1.md
│   └── post-2.md
├── _index.md
├── about.md
└── contact.md

I’m not sure what you’re trying to do, but in a home page template you would typically range over the SITE.RegularPages collection, or some subset of it. For example:

{{ range site.RegularPages }}
  <h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
{{ end }}

https://gohugo.io/quick-reference/page-collections/

I jmooring, based on you answer I understand that I NEED TO STUDY A LITTLE BIT MORE!!! :grinning:
So I’ll take this task for the future and start working on basics.
Thanks a lot
Jack