Where do we tell Hugo about our CSS?

Hi all,

Where is Hugo getting it’s styling instructions? I went through Steve’s website repo, and I couldn’t see where the styling was invoked in templates or layouts. Maybe I missed it. How does Hugo know to apply a given CSS fIle to a page, post, etc?

Unrelatedly, I need to be able to cite scientific and academic literature. Do you think I’d be able to approximate something like Jekyll scholar with shortcodes? (https://github.com/inukshuk/jekyll-scholar)

The shortcodes would probably need to be able to pull a cite from a list file. Typing inline cites isn’t hard, but having a reference list that populates at the bottom of an essay with all the works you’ve cited in that post is the big feature. Maybe that’s more programmatic. Pandoc can do something like this, but that means it’s already converting md to html, and I don’t know how I’d reconnect with Hugo workflow at that point. Any thoughts?



As to CSS and Steve’s site, see:

This is a partial that is included in the other templates.

1 Like

Thanks. That explains it. What throws me is that his css is in /static/static/css/ but his code above points to /static/css/. And I can’t tell how Hugo knows what to do with posts in this context, unless it’s using the default layout (there’s only a summary layout for posts.) Head_includes is called in the Header partial, which is in turn called in the single template. I set up a full posts template, but I wasn’t sure how to properly bring in the CSS. It makes sense that it would be a header partial.

1 Like