🎉 Feat: add douyin shortcode support

This commit is contained in:
Cell
2024-05-20 11:30:23 +08:00
parent aa68514546
commit d7c06360c2
3 changed files with 24 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
.douyin {
position: relative;
width: 100%;
height: 0;
padding-bottom: 60.725%;
margin: 3% auto;
text-align: center;
iframe {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
}
}
+1
View File
@@ -1,5 +1,6 @@
@import '_admonition';
@import '_bilibili';
@import '_douyin';
@import '_cardlink';
@import '_center-quote';
@import '_echarts';
+7
View File
@@ -0,0 +1,7 @@
{{- /* reference https://developer.open-douyin.com/docs/resource/zh-CN/dop/develop/openapi/video-management/douyin/iframe-player/get-iframe-by-video */ -}}
{{- $id := cond .IsNamedParams (.Get "id") (.Get 0) -}}
<div class="douyin">
<iframe src="//open.douyin.com/player/video?vid={{ $id }}&autoplay=0" border="0" framespacing="0" allowfullscreen="true"></iframe>
</div>
{{- /* EOF */ -}}