Lizzy
Lizzy
KPCKevin Powell - Community
Created by Lizzy on 5/4/2024 in #front-end
Jekyll error for stylesheet linked to html file
I am new to using Github Pages/Jekyll and I have encountered an issue that I just cannot seem to resolve. I am trying to host my project locally for developing. My (relevant) file structure is:
jekyll-site/
├── _assets/
│ └── css/
│ └── 404.css
└── pages/
└── 404.html
jekyll-site/
├── _assets/
│ └── css/
│ └── 404.css
└── pages/
└── 404.html
in 404.html head I have
<link rel="stylesheet" type="text/css" href="{{ '/assets/css/404.css' | relative_url }}">
<link rel="stylesheet" type="text/css" href="{{ '/assets/css/404.css' | relative_url }}">
When I run the server and navigate to the 404 page, my github codespaces terminal says
ERROR `/assets/css/404.css' not found.
ERROR `/assets/css/404.css' not found.
When I use the inspect console on the page, I get the error
Refused to apply style from 'https://[codespacesid-]4000.app.github.dev/assets/css/404.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled
Refused to apply style from 'https://[codespacesid-]4000.app.github.dev/assets/css/404.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled
How can I make it so that the stylesheet is applied? Note: It does this for all html/css pairs
4 replies