alanorth / hugo-theme-bootstrap4-blog

A blogging-centric Bootstrap v4 theme for the Hugo static site generator.
Other
204 stars 132 forks source link

Recommended way to customize CSS on the theme? #143

Closed evankarageorgos closed 3 years ago

evankarageorgos commented 3 years ago

Thanks for the great work on this theme.

What's the recommended way to customize the CSS without resorting to using Hugo Extended?

alanorth commented 3 years ago

Hi, you can add custom code to the <head> by placing it in your site's layouts/partials/head-custom.html. For example, to include custom CSS:

{{ $customStyle := resources.Get "css/custom.css" | resources.Fingerprint }}
<link href="{{ $customStyle.Permalink }}" rel="stylesheet" integrity="{{ $customStyle.Data.Integrity }}" crossorigin="anonymous">

Then put your custom CSS in your site's assets/css/custom.css:

body {
  color: green;
}

I don't think this requires Hugo extended...? I use Hugo from my Linux distribution and I'm not sure if they build the extended version.

evankarageorgos commented 3 years ago

Thanks, I closed this issue in the meantime in the meantime 'cause I noticed in your docs this very thing. Thanks again! :)