Skip to content

How do I include custom JS properly/elegantly? #491

Answered by pixelfabs
sarkrui asked this question in Q&A
Discussion options

You must be logged in to vote

Answers to your questions and confirmation for your used method:

It seems there is no need to reference the plyr.css in the shortcode and hugo will reference and bundle it automatically, whereas as for plyr.js, I do need to reference it in the head. Why is it? was it a configuration on my side?

There's no need for referencing CSS files, because Papermod tells Hugo where to find them and what to with it, e.g. find the files in /assets/css/* and bundle it together. This is not something Hugo does, Papermod tells Hugo to do so.

BUT, PaperMod only bundles CSS files, not JS files. So, in head.html there's no reference for "bundling" js files. The ones that do get included, but NOT bundled, a…

Replies: 1 comment 1 reply

Comment options

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

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