Including CSS in JekyllFebruary 28, 2014
Now, most folks use
_includes for standard partials like a site’s header or footer. Lately though, I’ve been using them to easily include CSS dependencies for fewer page requests.
Say you have three CSS files to include in your Jekyll project. Normally you’d do something like this:
<link rel="stylesheet" href="site.css"> <link rel="stylesheet" href="font-awesome.css"> <link rel="stylesheet" href="syntax.css">
The front-matter tells Jekyll to treat this page as a buildable file rather than simply another asset to copy to the generated
_site folder. With that in place, add any
_includes you like, and run