HUGO

Data template content renders locally but not when hosted on github pages

I am new to Hugo and I am trying to set up a blog using the northendlab-light theme.
There is some data in a .yml file that gets rendered to a page.
When I run the local server using Hugo CLI, all works as expected. (see image below)


But, after I deploy to GitHub, pages the content of the .yml file is not rendered.
https://kraulain.me/courses/
Everything else seems to work properly.
I have already checked to make sure I am using the right baseURL in the configs.
What could be the issue?
The full source code for the blog is open here GitHub - kraulain/kraulain-me

First, run hugo --path-warnings.

You have both:

  • content/courses.md
  • content/courses/_index.md

Which one do you want to use?

Second, content/courses.md is malformed (note the leading “x”):

x---
title: "Courses"
draft: false
description : "this is meta description"
layout: courses
---

Third, the above front matter refers to a “courses” layout that doesn’t exist.

1 Like

Thanks @jmooring
I added the courses.md when trying to solve the issue.
But the problem already existed before that.
I have done all the changes recommended but I am still facing the same issue.

I pulled your changes.

content/courses/_index.md is rendered with themes/northendlab-light/layouts/_default/list.html which does this:

{{ $paginator := .Paginate (where .Data.Pages "Type" "post") }}
{{ range $paginator.Pages }}
  {{ .Render "article" }}
{{ end }}

And that doesn’t do anything with data/courses.yml

Maybe you have been making changes to the theme (example: creating a courses layout similar to the tools layout) without updating the theme repository?

1 Like

Yes, I have been modifying the theme.
I didn’t think I would need to change the theme repository too.
Also, how come it works locally? :thinking:

Because you made the changes locally.

It doesn’t work locally for me because I am cloning the theme repository, not what you have on your desktop.

1 Like

Thanks very much @jmooring
I was making changes to the theme without updating the themes repository.
And even after updating it, I had to update the git submodule to use the latest commit
git submodule foreach git pull origin master
Everything works as desired now.

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