Skip to content

How to add a custom css and js file with the new theme (hugo modules) #832

Answered by cosmin-aron
saul-sl asked this question in Q&A
Discussion options

You must be logged in to vote

I had the same issue with custom CSS since migrating to V4. Unfortunately this has not been documented yet, but you can take a look at the toha repo to see how it works. Essentially you need to create an override.scss file in your assets folder like this:

├── assets
    ├── styles
        ├── override.scss

Hope this solves at least part of your problem. For me the old custom CSS did not produce any errors but had no effect either (because it was in the static folder). So I think in your case the custom js causes the errors.

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by hossainemruz
Comment options

You must be logged in to vote
1 reply
@hossainemruz
Comment options

Comment options

You must be logged in to vote
1 reply
@hossainemruz
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants