KevsRobots Learning Platform
By Kevin McAleer, 2 Minutes

Static assets are crucial components of any website, contributing to its aesthetics, functionality, and overall user experience. In Jekyll, managing these assets efficiently is key to building a professional and polished site.
Jekyll supports a flexible directory structure, allowing you to organize your assets in a way that makes sense for your project. A common approach is to create dedicated directories for each type of asset within the root of your Jekyll project:
images/ for all your image files.css/ for your stylesheets.js/ for your JavaScript files.To reference static assets in your Jekyll site, use the site.baseurl variable to ensure your paths are correct, especially when your site is hosted in a subpath of a domain.
To use Varables in Jekyll, you can use the following syntax: ``.
For Example:

Images can be included in your content using the following syntax: [Alt Text](URL for the image).
For example:

Include a link to your CSS file in the <head> section of your layout template:
<link rel="stylesheet" href="/css/styles.css">
Include your JavaScript files before the closing </body> tag in your layout template for better page load performance:
<script src="{{ site.baseurl }}/js/scripts.js"></script>
Jekyll has built-in support for Sass, a CSS preprocessor that allows you to use variables, nested rules, mixins, and more in your stylesheets.
.scss or .sass files in a _sass directory.css directory that uses the @import directive to include your Sass files. Ensure this file has a front matter section, even if itβs empty, to tell Jekyll to process it.
---
---
@import "main";
images, css, and js directories.
You can use the arrows β β on your keyboard to navigate between lessons.
Comments