I’m a newb, but I got pretty far with my first Hugo site and theme. I even managed to push it on to Netlify. However, the only thing that is failing is this loop:
{{ range .Data.Pages }}
<a href="{{.Permalink}}">{{.Title}}</a>
{{ end }}
No doubt I’ve missed something I need to init before working with Netlify. But am I right in thinking that, in general, Hugo functions and loops should just work on Netlify once deployed?
In general yes. But how your loop behaves is also affected by what content gets published. For instance, on localhost I always render the website with drafts and future posts. But that’s not what gets deployed, so a loop over all pages acts a bit different in those two environments.
But other than that there should be no unexpected differences between your local build and the one on Netlify.
What does failing mean in this context? Does the loop not start, do you get odd output, are page missing, or are there pages you think shouldn’t be there?
baseURL
Hostname (and path) to the root, e.g. http://bep.is/
But I’m not sure that your problem is related to configuring the baseURL.
I wanted to test your repo locally but something is wrong with GitHub right now and I cannot clone it.
Anyway I took a cursory look earlier.
The one thing that seemed a bit weird to me was that you have defined the Ananke theme as a git submodule and yet you use another theme for your project.
Try setting the theme you use as a submodule and see if that fixes your deployment on Netlify.
I don’t think so. The submodules are meant for external themes so that you can receive updates. Since this is your custom theme I suppose that you could simple delete that submodule file.
Anyway I managed to download your repo. So far no console errors but let me have a look.
Ok. You have no template for single pages hence the 404 for your post at https://pedantic-leavitt-3a9909.netlify.com/posts/16-medical-benefits-marijuana/
Also your index page is full of dummy posts.
Please familiarize yourself with Hugo’s single page templates lookup order and create that template.
Also your /layouts/_default/list.html template is blank. You MUST have a list template for your posts to show up on your site.
I’ve searched your theme directory and there is no instance of the following: