GDQuest / website

http://gdquest.com/
Other
44 stars 80 forks source link

Add small pictures as placeholders for youtube videos to lazy-load them #227

Closed NathanLovato closed 4 years ago

NathanLovato commented 4 years ago

Youtube videos get loaded automatically on the website, slowing down pages. We should replace them by pictures that load the video on click only.

Here's a tutorial on that: https://webdesign.tutsplus.com/tutorials/how-to-lazy-load-embedded-youtube-videos--cms-26743

marianka6252 commented 4 years ago

Hello, can I work on it?

NathanLovato commented 4 years ago

Sure!

marianka6252 commented 4 years ago

can you assign me? :)

NathanLovato commented 4 years ago

Done, thanks!

marianka6252 commented 4 years ago

Hi @NathanLovato , I have questions about this issue. I'm getting familiar with the code and I'm a little lost. I ran a local environment and I don't know where to find videos about which this task is. And also, where can I apply code in project structure?

NathanLovato commented 4 years ago

Thanks for looking into it. Here are some pointers.

The main target for this task is any page of type video. These are any pages inside of content that have the type = "video" in their metadata at the top. For example, in the tutorial section, you have many pages like this one, that reference a YouTube video:

https://www.gdquest.com/tutorial/godot/2d/raycast2d-turret/

These pages render through layouts/video/single.html, which renders the youtube video using the file layouts/partials/components/video-youtube.html.

This is the main html file you'd be working with. As for the javascript, for now, you can put it directly inside the html template file.

Then, for the scss, you will have to add a new component in assets/scss/components/. You can look at other files there to see the coding style, it's following the rscss methodology.

marianka6252 commented 4 years ago

Hi @NathanLovato, my task is done, but I do not have permission to create a pull request.

NathanLovato commented 4 years ago

You should be able to create a pull request from a fork. Others opened PRS on the website. If you have trouble, could you send me a link to your fork?

NathanLovato commented 4 years ago

Closed by #237