I seem to be having issues with getting a specific Hugo partial to render once my site is deployed to Netlify. There are no build errors in Netlify, and locally the partial renders without issues. All other content, including UI that’s rendered via partials, displays once deployed to Netlify.
I’ve unsuccessfully tried troubleshooting by:
- Changing partial name
- Simplifying code within partial (ex: not include image)
- Updating Hugo $baseURL with netlify URL
- Updating Hugo production env variable
Site URL: https://clever-leavitt-dbe713.netlify.app/
Hugo Partial:
<article class="card"> <a href="{{ .Permalink }}"> <div class="card__image"> {{ with $.Page.Resources.GetMatch "*" }} {{ partial "components/image.html" . }} {{ end }} </div> <div class="card__header"> <h2 class="card__title">{{ .Title }}</h2> </div> <div class="card__footer"> <ul class="card__list"> {{- range $i, $e := .Params.specialties -}} {{- if $i -}}, {{ end -}} <li class="card__list-item">{{ . | title }}</li> {{- end -}} </ul> </div> </a> </article>
Netlify config:
[build]
command = “hugo -b $URL && npm run build”
publish = “public”
functions = “functions”
[build.environment]
HUGO_VERSION = “0.58.3”
[context.production.environment]
HUGO_ENV = “production”
NODE_ENV = “production”
[context.deploy-preview]
command = “hugo -b $DEPLOY_PRIME_URL”
[context.branch-deploy]
command = “hugo -b $DEPLOY_PRIME_URL”
Local Screenshot:
Netlify Screenshot: