-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
youtube: Need help (again) to set up the youtube module #1383
Comments
Here again, don't copy the configuration of the module. Just add it to your configuration: [module]
[[module.imports]]
path = "github.com/davidsneighbour/hugo-modules/modules/youtube" After that, when you run Have a look at the way I am using them in my own website kollitsch.dev:
Those "mounts" are only available when Hugo is running. There are other mounts available that go into the static folder, so that you could add them via |
Let me add, the "paths" of these mounts are:
and you have to use a relative path there, depending on where you import them. |
Thank for your answer. But this is the first thing I tried... And I get the following error :
To be sure i didn't miss anything (I probably did) :
to assets/js/custom.js But the site won't build... |
I see this in your module.toml
Tried to add this to my hugo.toml but same error... Might be something like this though |
Oh I see... there is stuff in that SCSS file that comes from Bootstrap 5. I will fix that today or tomorrow. To quickly fix it in your website copy the full stylesheet from here locally and replace that one line. Then include YOUR copy instead of the mounted one into your stylesheet. Old line: @extend .object-fit-cover; Replace with object-fit: cover; The reason for this is that I am using BS5 everywhere... That should be taken out of the modules. |
Thank you ! So now the thumbnails are loading but nothing happens when I click on the videos (just youtube button stays red but that's it). |
Open your browser developer console. Check if any error comes up in there. Sounds like SCSS is all fixed and Javscript might not be initialized yet. You need to initialize the component and not just import it. // YouTube element
// @ts-ignore - this is loaded at runtime by GoHugo
import LiteYTEmbed from "./lite-yt-embed.js";
// Initiate custom elements
customElements.define("lite-youtube", LiteYTEmbed); also the way your js is built is important. I have mine in a js.build pipeline. |
But I don't know how to do this... |
How is your |
Not sure what you mean but I added
to layouts/partials/Head/theme-styles.html |
I also have
that I copied from the theme I'm using (hugo-coder) |
from the console I have |
You are ranging JS files and put them into a stylesheet tag... That can't work. Let's go the other route. Remove what you added for my module in
Please don't remove the slash in the beginning. This file is mounted into |
With this I can't build the site :
|
Did you ever link your own repository? If not, please do so. If you can't because of private stuff in there please add @davidsneighbour as contributor and I'll try to fix the issue, create a PR and then explain what was/were the reason for failure. This might save some time. The 404 error should not come up by using the youtube module. You either are using another module that is not configured properly or the theme is broken due to too many changes trying to the youtube shortcode working that needs some fixing/cleaning up. |
I tried to use js/lite-yt-embed.js from here as custom js but I still have the |
Nothing is allowed to come before any |
I uploaded the code to github and invited you to as contributor. I think something must interfere with the theme I'm using, which is also using modules... |
I joined... give me a day or two to work on this. It's 9pm here; only daylight will bring good fixes ;) It's probably an issue with the order of modules (who overrides whom) and configs. |
There is no rush, the site is online and working, I can deal with the video page being slow for now. |
I accidentally commited my changes to your main branch... If you need to remove that just run
And it will create a commit undoing my changes. I did the following:
You could delete the following files:
The videos are loading now. |
No problem I don't use github for hosting my site :) When I look into your commit I don't see anything related to footer.html did you forget to push it ? Without it the site won't build. (or maybe I misunderstood what you meant by "including the direct already compiled script in footer.html" ?) (Yes youtube-lite was previous attempt to do it with a shortcode) |
That was weird, it was not committed indeed. Sent it up now: https://github.com/ksdrummer/website/commit/2a9dc48fa10b401e0c385812022ee9070c85a46e |
Yes ! It works perfectly now ! |
It's me again....
Before going further, I can see a small box (few pixels) in place of youtube videos but not thumnails.
Then I found the documentation here and I'm trying to add the js and scss files to the pipeline.
None of the following worked :
(Here I tried several things like
source = "assets/js/
ortarget = assets/
)hugo server gives the following error :
the
! optionnal
allows me to build the site but I am in the same situation than before : small boxes in place of the youtube videos.Could you help me out ? I'm really new to hugo moduling ...
And again, thank you so much for the work and for your time !
The text was updated successfully, but these errors were encountered: