Currently, I am in the process of uploading a webpage to github pages via jekyll and ensuring that all my pages and posts are able to access the bootstrap 3 stylesheets. These stylesheets are located in the css folder within the root directory: ./css/
When I include the following code snippet in my homepage:
<link href="./css/bootstrap.css" rel="stylesheet">
<link href="./css/bootstrap-responsive.css" rel="stylesheet">
<link rel="stylesheet" href="./css/custom.css" type="text/css"/>
The homepage (index.html in root) loads perfectly with the correct formatting. However, other pages in different locations or folders do not recognize these stylesheets because ./ is specific to the current directory - as far as I understand. To bypass this issue with Jekyll, I tried:
<link href="{{site.url}}/css/bootstrap.css" rel="stylesheet">
<link href="{{site.url}}/css/bootstrap-responsive.css" rel="stylesheet">
<link rel="stylesheet" href="{{site.url}}/css/custom.css" type="text/css"/>
After trying this, the result is:
<link href="ward9250.github.io/HybRIDS/css/bootstrap.css" rel="stylesheet">
<link href="ward9250.github.io/HybRIDS/css/bootstrap-responsive.css" rel="stylesheet">
<link rel="stylesheet" href="ward9250.github.io/HybRIDS/css/custom.css" type="text/css"/>
Nevertheless, applying this to the homepage does not display correctly with any of bootstrap's settings or styles along with my custom tweaks.
I need assistance in rectifying this issue. How can I ensure that all my pages, regardless of their location, have access to my stylesheets?
Thank you, Ben.
UPDATE
I've made an interesting discovery - if I adjust my HTML to:
<link href="/HybRIDS/css/bootstrap.css" rel="stylesheet">
<link href="/HybRIDS/css/bootstrap-responsive.css" rel="stylesheet">
<link rel="stylesheet" href="/HybRIDS/css/custom.css" type="text/css"/>
Then the page renders correctly. However, I thought it was recommended to steer clear of absolute paths like /?