Make youtube links work with Jekyll & Github Pages
I try with the youtube plugin. It works fine at my local machine, but it does not at Github Pages (official documentation).
Them I did it with some coffeescript.
- At the markdown post, I added this small HTML snippet
<div id="youtube_video_id" class="youtube"></div>
. - At
_includes/footer.html
, which is called at mydefault
layout. I put this line:<script src="/assets/js/youtube.js"></script>
- And add this new file:
assets/js/youtube.coffee
Some advices here: the file must start with 2 lines of ---
. Since the file has extension .coffee
, the script at src requires the same file with extension .js
.