So I am in the process of creating a theme, which derives from my portfolio website. I created the website first and used the website’s Layout and Assets, then when I was happy, moved those files into a theme.
It works all as intended… except a single page. The page has an .md file which includes raw HTML and references CSS in Assets/css/extended.
So basically, the page displays fine when all my files are inside the website directory, but when I move them to /themes/paperjack this single page does not render.
Troubleshooting
The page with the html not displaying properly is the “resume” page.
I have goldmark’s renderer set to unsafe already. As I mentioned, every other page works fine, it is just this one that fails to render the CSS correctly.
I didn’t do any extra steps to include the CSS. I thought it was complied into the single spreadsheet after building.
The HTML is added in the .md file like:
<h3>Hobbies</h3>
I love programming and usually work on side projects. This includes creating mods for my favourite games, participating in game-jams and fun solo projects.
Beside programming, I enjoy playing games, D&D and my guitar. I travel with my friends when I get the chance.</p>
</div>
<div class="resume-item">
<div class="timeline">
<div class="entry-timeline">
<div class="title">
<h3>2023 - Present</h3>
(Truncated)
Also you can look at the repo if you want to see any further details.
Okay, how do I deal with it? And please explain how it works when I move all those files into the website directory but somehow breaks if moved into a theme.
Since all I am simply doing is moving the file’s location, and even then I made no effort to include in that instance, yet it works fine like that. I think I sort of get it, but an explanation would help.
I think jmooring was trying to explain that you need to include the CSS file somewhere. Hugo doesn’t include stylesheets in the HTML files automatically.
Reading this back is funny since the issue had nothing to do with including CSS, and in that repo it is already included. I found that the issue was a folder structure problem, I have been out most of the day without time to fully troubleshoot, just assuming it was a syntax error or Goldmark.
So yea, turns out it the folder step “css” was missing for “extended”. Changed assets/extended to assets/css/extended and it works. I’m still getting used to Hugo project structure I guess