Skip to content

Commit 9ba4d9a

Browse files
authored
Merge branch 'master' into togglefix
2 parents 4c17938 + 4d6c788 commit 9ba4d9a

File tree

6 files changed

+57
-16
lines changed

6 files changed

+57
-16
lines changed

_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ theme: jekyll-theme-chirpy
88
# otherwise, the layout language will use the default value of 'en'.
99
lang: en
1010

11-
# Change to your timezone › https://kevinnovak.github.io/Time-Zone-Picker
11+
# Change to your timezone › https://zones.arilyn.cc
1212
timezone: Asia/Shanghai
1313

1414
# jekyll-seo-tag settings › https://github.com/jekyll/jekyll-seo-tag/blob/master/docs/usage.md

_includes/embed/audio.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{% endunless %}
1010

1111
<p>
12-
<audio class="embed-audio" controls>
12+
<audio class="embed-audio file" controls>
1313
{% assign extension = src | split: '.' | last %}
1414
{% assign types = extension | concat: types %}
1515

_includes/embed/spotify.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{% assign size = 352 %}
2+
{% assign theme = '' %}
3+
4+
{% if include.compact %}
5+
{% assign size = 152 %}
6+
{% endif %}
7+
8+
{% if include.dark %}
9+
{% assign theme = '?theme=0' %}
10+
{% endif %}
11+
12+
<iframe
13+
class="embed-audio spotify"
14+
src="https://open.spotify.com/embed/track/{{ include.id | append: theme }}"
15+
height="{{ size }}"
16+
frameBorder="0"
17+
allowfullscreen=""
18+
allowtransparency="true"
19+
allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture"
20+
loading="lazy"
21+
>
22+
</iframe>

_includes/sidebar.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,21 @@
4242

4343
<div class="sidebar-bottom d-flex flex-wrap align-items-center w-100">
4444
{% for entry in site.data.contact %}
45+
{%- assign url = null -%}
46+
4547
{% case entry.type %}
4648
{% when 'github', 'twitter' %}
49+
{%- unless site[entry.type].username -%}
50+
{%- continue -%}
51+
{%- endunless -%}
4752
{%- capture url -%}
4853
https://{{ entry.type }}.com/{{ site[entry.type].username }}
4954
{%- endcapture -%}
5055
{% when 'email' %}
51-
{% assign email = site.social.email | split: '@' %}
56+
{%- unless site.social.email -%}
57+
{%- continue -%}
58+
{%- endunless -%}
59+
{%- assign email = site.social.email | split: '@' -%}
5260
{%- capture url -%}
5361
javascript:location.href = 'mailto:' + ['{{ email[0] }}','{{ email[1] }}'].join('@')
5462
{%- endcapture -%}

_posts/2019-08-08-write-a-new-post.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -256,27 +256,31 @@ For normal images:
256256
```
257257
{: .nolineno }
258258

259-
### Video
259+
### Social Media Platforms
260260

261-
#### Social Media Platform
262-
263-
You can embed videos from social media platforms with the following syntax:
261+
You can embed video/audio from social media platforms with the following syntax:
264262

265263
```liquid
266264
{% include embed/{Platform}.html id='{ID}' %}
267265
```
268266

269267
Where `Platform` is the lowercase of the platform name, and `ID` is the video ID.
270268

271-
The following table shows how to get the two parameters we need in a given video URL, and you can also know the currently supported video platforms.
269+
The following table shows how to get the two parameters we need in a given video/audio URL, and you can also know the currently supported video platforms.
270+
271+
| Video URL | Platform | ID |
272+
| -------------------------------------------------------------------------------------------------------------------------- | ---------- | :----------------------- |
273+
| [https://www.**youtube**.com/watch?v=**H-B46URT4mg**](https://www.youtube.com/watch?v=H-B46URT4mg) | `youtube` | `H-B46URT4mg` |
274+
| [https://www.**twitch**.tv/videos/**1634779211**](https://www.twitch.tv/videos/1634779211) | `twitch` | `1634779211` |
275+
| [https://www.**bilibili**.com/video/**BV1Q44y1B7Wf**](https://www.bilibili.com/video/BV1Q44y1B7Wf) | `bilibili` | `BV1Q44y1B7Wf` |
276+
| [https://www.open.**spotify**.com/track/**3OuMIIFP5TxM8tLXMWYPGV**](https://open.spotify.com/track/3OuMIIFP5TxM8tLXMWYPGV) | `spotify` | `3OuMIIFP5TxM8tLXMWYPGV` |
277+
278+
Spotify supports some additional parameters:
272279

273-
| Video URL | Platform | ID |
274-
| -------------------------------------------------------------------------------------------------- | ---------- | :------------- |
275-
| [https://www.**youtube**.com/watch?v=**H-B46URT4mg**](https://www.youtube.com/watch?v=H-B46URT4mg) | `youtube` | `H-B46URT4mg` |
276-
| [https://www.**twitch**.tv/videos/**1634779211**](https://www.twitch.tv/videos/1634779211) | `twitch` | `1634779211` |
277-
| [https://www.**bilibili**.com/video/**BV1Q44y1B7Wf**](https://www.bilibili.com/video/BV1Q44y1B7Wf) | `bilibili` | `BV1Q44y1B7Wf` |
280+
- `compact` - to display compact player instead (ex. `{% include embed/spotify.html id='3OuMIIFP5TxM8tLXMWYPGV' compact=1 %}`);
281+
- `dark` - to force dark theme (ex. `{% include embed/spotify.html id='3OuMIIFP5TxM8tLXMWYPGV' dark=1 %}`).
278282

279-
#### Video Files
283+
### Video Files
280284

281285
If you want to embed a video file directly, use the following syntax:
282286

@@ -310,7 +314,7 @@ Consider an example using all of the above:
310314
%}
311315
```
312316

313-
### Audios
317+
### Audio Files
314318

315319
If you want to embed an audio file directly, use the following syntax:
316320

_sass/base/_base.scss

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,14 @@ main {
315315

316316
.embed-audio {
317317
width: 100%;
318-
display: block;
318+
319+
&.file {
320+
display: block;
321+
}
322+
323+
&.spotify {
324+
border-radius: 14px;
325+
}
319326

320327
@extend %img-caption;
321328
}

0 commit comments

Comments
 (0)