forked from kitian616/jekyll-TeXt-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add media plugins (Netease Cloud Music, YouTube and bilibili)
- Loading branch information
Showing
6 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<div class="plugin plugin--video"> | ||
<iframe src="//player.bilibili.com/player.html?aid={{ include.id }}&page=1" | ||
scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"> | ||
</iframe> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<iframe class="plugin--audio" width="330" height="86" | ||
src="//music.163.com/outchain/player?type=2&id={{ include.id }}&auto=1&height=66" | ||
frameborder="no" border="0" marginwidth="0" marginheight="0"> | ||
</iframe> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<div class="plugin plugin--video"> | ||
<iframe class="plugin-iframe plugin-iframe--video" | ||
src="https://www.youtube.com/embed/{{ include.id }}?showinfo=0" | ||
frameborder="0" allowfullscreen></iframe> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.plugin { | ||
margin: map-get($base, vertical-space-lg) 0; | ||
} | ||
|
||
.plugin--video { | ||
position: relative; | ||
width: 100%; | ||
padding: 0; | ||
padding-top: 56.25%; | ||
& > iframe { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
} | ||
|
||
.plugin--audio { | ||
display: block; | ||
max-width: 100% !important; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
title: TeXt - Media | ||
key: 20170802 | ||
tags: TeXt | ||
toc: true | ||
category: post | ||
--- | ||
|
||
With the help of plugins for media, you can easily add **audio** and **video** in your posts. | ||
|
||
<div>{%- include plugins/youtube.html id='wbY97-hdD5c' -%}</div> | ||
|
||
<!--more--> | ||
|
||
## Audio | ||
|
||
### Netease Cloud Music (网易云音乐) | ||
|
||
Available in Chinese mainland. | ||
|
||
<div>{%- include plugins/netease-cloud-music.html id='413812448' -%}</div> | ||
|
||
{% raw %} | ||
```html | ||
{%- include plugins/netease-cloud-music.html id='413812448' -%} | ||
``` | ||
|
||
``` | ||
<div>{%- include plugins/netease-cloud-music.html id='413812448' -%}</div> | ||
``` | ||
{% endraw %} | ||
|
||
## Video | ||
|
||
### YouTube | ||
|
||
<div>{%- include plugins/youtube.html id='wbY97-hdD5c' -%}</div> | ||
|
||
{% raw %} | ||
```html | ||
{%- include plugins/youtube.html id='wbY97-hdD5c' -%} | ||
``` | ||
|
||
``` | ||
<div>{%- include plugins/youtube.html id='wbY97-hdD5c' -%}</div> | ||
``` | ||
{% endraw %} | ||
|
||
### Bilibili (哔哩哔哩) | ||
|
||
<div>{%- include plugins/bilibili.html id='6890938' -%}</div> | ||
|
||
{% raw %} | ||
```html | ||
{%- include plugins/bilibili.html id='6890938' -%} | ||
``` | ||
|
||
``` | ||
<div>{%- include plugins/bilibili.html id='6890938' -%}</div> | ||
``` | ||
{% endraw %} |