jeffreymorganio/responsive-youtube-jekyll-tag

How to use it in jekyll

Closed this issue · 4 comments

Hi

I want to know how to use it in jekyll. I get the same result in this way

{%youtube {post.youyube} %}

output html:
src="https://www.youtube.com/embed/{post.youyube}"

thank you.

Hi hahalin,

To use the YouTube tag in Jekyll, you need to copy the responsive-youtube-jekyll-tag.rb file into the _plugins folder of your self-hosted Jekyll website.

In a page or post, insert the tag with a YouTube video ID. For example, to insert the video with the URL https://www.youtube.com/watch?v=tnq2gwBhvCc, you would use the tag:

{% youtube tnq2gwBhvCc %}

where tnq2gwBhvCc is the YouTube video ID in the URL.

Hi

I have copy the responsive-youtube-jekyll-tag.rb file into _plugins folder and do the same thing as you write. But still get the same result.Should I feedback more data to find out anything I do it wrong?

Thank you,
hahalin

Hi hahalin,

Are you using Jekyll with GitHub pages? GitHub pages only allows a few official Jekyll plugins for security reasons: https://help.github.com/articles/adding-jekyll-plugins-to-a-github-pages-site/. The Responsive YouTube Jekyll plugin only works for self-hosted Jekyll websites.

If you are self-hosting, you need to stop and restart Jekyll (jekyll serve) for Jekyll to recognize the new plugin.

The discussion here might be helpful: http://usabilityetc.com/2015/04/responsive-youtube-jekyll-plugin/

Dear Sir,

I have understand,thank you.