First time using Hugo and finding it a bit confusing. For my first project I am trying to develop and single page site, not a blog, just a single page with different sections/components.
The approach I’ve used is as follows:
Content structure:
/content
–/homepage
----about.md
----hero.md
Heres and example of a .md file
---
title: 'Heating, Gas, Plumbing.</br>Servicing & Repair.'
date: 2024-02-08T06:34:07Z
draft: true
ctaText: 'Need a quote?'
ctaLink: '#contact'
---
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sodales, nisl eu ultricies fermentum, nunc leo ultricies nunc, quis mattis leo libero vitae libero. Nulla facilisi. Nulla facilisi.
Layout structure:
/layouts
–/_default
----baseof.html
–/partials
----header.html
----footer.html
----hero.html
----about.html
index.html
I’ve been attempting to call my partials inside my index.html using the following structure
{{ partial "hero.html" . }}
I am then unsure how I can output the content of the hero.md in the hero.html, e.g.
<section class="hero">
<h1>{{ .Params.title }}</h1>
{{ .Content }}
</section>
The partial is successfully called as I can hardcode html and view it, but struggling to get front matter properties and main content.
Where am I going wrong? I know I haven’t got the hang of Hugo workflow, but really do want to get to grips with it. I’ve tried looking at the docs, but find it confusing.
Thanks in advance.