Hi, I posted this to SO earlier this week but didn’t get any replies. Respond here or on SO, don’t matter to me Let me know if you need any additional info!
Running hugo locally. See attached photo of my directory structure.
Hitting localhost:1313/directions-accomodations in Chrome browser. The content file (red box) is loading the single.html template (blue box).
I want it to load a custom template. directions.html ( any of them ). Where do I need to put directions.html , OR, what value do I give the layout front-matter variable in /directions-accomodations/index.md in order to achieve this?
I copied the content from the SO link into this question, I hope that helps. I read through the requesting help guidelines before posting and once again after your comment, is there something I’m missing that I need to add? Let me know, thanks
Okay! I’m trying to load /site/content/Directions-Accomodations/index.md (circled by a red box in the attached screenshot). That’s the page. When I hit localhost:1313/directions-accomodations it loads that markdown file.
BUT, that markdown file CURRENTLY LOADS /site/themes/hello-friend-ng/layouts/_default/single.html (circled by a blue box in the attached screenshot).
That IS NOT the template file I want to load. I set the frontmatter ‘layout’ value to ‘/directions.html’ because that’s the file I want to use for the template.
I know there are many many ‘directions.html’ files in my project, but that’s because I was trying to see where I needed to add it. They’re all the same and therefore It doesn’t matter which one we load I’m just confused why setting the ‘layout’ frontmatter doesn’t seem to change the template being loaded. Once I find out how to set the layout frontmatter or where to put the template files, I can remove the additional directions.html files.
Please let me know if that clears things up. Thank you for your help!
And your layout at layouts/_default/directions.html, it would output what you want. And all your single page content can go in that one pages directory, and you can customize each with front matter.
That sounds… aggravating. I’d avoid the practice, it will definitely mess you up trying to debug it.