From f9b4e1cabf75814ff91031bb73087151618245d1 Mon Sep 17 00:00:00 2001 From: Mark Wiseman Date: Thu, 23 Apr 2020 08:39:43 +1000 Subject: [PATCH 1/2] added youtube video embed --- README.md | 7 +++++++ _includes/youtubePlayer.html | 4 ++++ _sass/tale.scss | 1 + _sass/tale/_youtube.scss | 14 ++++++++++++++ 4 files changed, 26 insertions(+) create mode 100644 _includes/youtubePlayer.html create mode 100644 _sass/tale/_youtube.scss diff --git a/README.md b/README.md index a65f72b597..276ca9316a 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ Tale is a minimal Jekyll theme curated for storytellers. Checkout the demo [here - Markdown and HTML text formatting - Pagination of posts - [Disqus comments (can be enabled if needed)](#enabling-comments) +- YouTube video embed ## Installation There are 3 ways to install this theme @@ -122,6 +123,12 @@ disqus: jekyll-tale Next, add `comments: true` to the YAML front matter of the posts which you would like to enable comments for. +### Embedding YouTube video +Replace XXXXXX with your youtube video id +``` +{% include youtubePlayer.html id="XXXXXX" %} +``` + ## Contributing Found a bug or have a suggestion? Feel free to create an issue or make a pull request! diff --git a/_includes/youtubePlayer.html b/_includes/youtubePlayer.html new file mode 100644 index 0000000000..b775a34886 --- /dev/null +++ b/_includes/youtubePlayer.html @@ -0,0 +1,4 @@ +
+ +
\ No newline at end of file diff --git a/_sass/tale.scss b/_sass/tale.scss index 3cdfa9918d..64a125176d 100644 --- a/_sass/tale.scss +++ b/_sass/tale.scss @@ -6,3 +6,4 @@ @import 'tale/layout'; @import 'tale/pagination'; @import 'tale/catalogue'; +@import 'tale/youtube'; diff --git a/_sass/tale/_youtube.scss b/_sass/tale/_youtube.scss new file mode 100644 index 0000000000..4000705bad --- /dev/null +++ b/_sass/tale/_youtube.scss @@ -0,0 +1,14 @@ +.embed-youtube { + position: relative; + padding-bottom: 56.25%; + padding-top: 25px; + height: 0; +} + +.embed-youtube iframe { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} \ No newline at end of file From f7d6218a80110b251a00c285fae4840a25c996ca Mon Sep 17 00:00:00 2001 From: Mark Wiseman Date: Thu, 23 Sep 2021 09:59:55 +1000 Subject: [PATCH 2/2] added youtube example --- _posts/2021-09-23-youtube.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 _posts/2021-09-23-youtube.md diff --git a/_posts/2021-09-23-youtube.md b/_posts/2021-09-23-youtube.md new file mode 100644 index 0000000000..3397e161cd --- /dev/null +++ b/_posts/2021-09-23-youtube.md @@ -0,0 +1,17 @@ +--- +layout: post +title: "Youtube Videos" +author: "Jekyll" +tags: Tutorial +excerpt_separator: +--- + +You can insert Youtube videos bu using this include. + +{% highlight ruby %} +{% raw %} +{% include youtubePlayer.html id="iWowJBRMtpc" %} +{% endraw %} +{% endhighlight %} + +{% include youtubePlayer.html id="iWowJBRMtpc" %} \ No newline at end of file