Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pug file not loading CSS

I've got an express project set up. I'm using Pug as the view engine.

I've got the following lines in my app.js,

app.set('views', path.join(__dirname, './views'));
app.set('view engine', 'pug');
app.use(express.static(path.join(__dirname, './public')));

And I've got the following in my index.pug view,

    link(rel='stylesheet', href='/stylesheets/style.css', type='text/css')
    link(rel='stylesheet', href='/stylesheets/boostrap.min.css', type='text/css')

The CSS files are in the right folders (public/stylesheets), but when I load up the app, the view does not seem to load the CSS files.

The full project with its directories and all the code can be found here

like image 537
Human Cyborg Relations Avatar asked Nov 30 '25 11:11

Human Cyborg Relations


1 Answers

Typo in your link to bootstrap, you have boostrap:

link(rel='stylesheet', href='/stylesheets/boostrap.min.css', type='text/css')
like image 140
worc Avatar answered Dec 02 '25 01:12

worc



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!