[RESOLVED]Get content from specific markdown file

I have a jumbotron and I want to add the content from the jumbotron into a markdown file

Here is what I have :

./content/jumbotron/jumbotron.md

      {{ range where .Data.Pages "Section" "jumbotron" }}
        <h1 class="jumbotron-name">{{ .Title | markdownify }}</h1>
        <div class="jumbotron-content">
          {{ .Content }}
        </div>
        <button class="btn btn-primary js-more">En savoir plus</button>
      {{ end }}

This works, but if I add another markdown file in the section, it will loop. What I am trying to do is : get content from the specific markdown file jumbotron.md

Is this possible with Hugo?

Have a look at the .GetPage function in the Docs.

Particularly this example

{{ with .Site.GetPage "page" "blog" "my-post.md" }}

3 Likes

oh wow this is exatly what I need, thank you so much