feat: Tencent video shortcode and remark42 integration (#143)

* 增加remark42的评论系统支持,config中增加对应配置。

* remark42评论系统,语言配置加入到config中,修正切换theme时评论区跟随主题切换。

* - 新增腾讯视频的支持
- 支持通过frontmatter配置在文章中插入音频

* 更新readme

* Delete README.md

* Create README.md

* Remove MetingJS

* fix(shortcode/tencent): switch to HTML5

The old one was showing video using Flash.

* style(comments): clean remark42 integration code

Co-authored-by: wood <wood@hfge.cn>
Co-authored-by: Wood <34589275+hfge@users.noreply.github.com>
This commit is contained in:
Jimmy Cai 2021-02-13 11:10:24 +01:00 committed by GitHub
parent 8b6622792d
commit 79d8c1db38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 45 additions and 0 deletions

View File

@ -49,11 +49,17 @@ params:
comments: comments:
enabled: true enabled: true
provider: disqus provider: disqus
utterances: utterances:
repo: repo:
issueTerm: pathname issueTerm: pathname
label: label:
remark42:
host:
site:
locale:
widgets: widgets:
enabled: enabled:
- search - search

View File

@ -0,0 +1,29 @@
{{- with .Site.Params.comments.remark42 -}}
<div id="remark42"></div>
<script>
var remark_config = {
host: "{{ .host }}",
site_id: '{{ .site }}',
components: ['embed'],
url: "{{ $.Permalink }}",
max_shown_comments: {{ default 15 .max_shown_comments }},
theme: document.body.dataset.scheme,
page_title: '{{ $.Title }}',
locale: '{{ default "en" .locale }}',
show_email_subscription: {{ default true .show_email_subscription }}
};
(function (c) {
for (var i = 0; i < c.length; i++) {
var d = document, s = d.createElement('script');
s.src = remark_config.host + '/web/' + c[i] + '.js';
s.defer = true;
(d.head || d.body).appendChild(s);
}
})(remark_config.components || ['embed']);
window.addEventListener('onColorSchemeChange', (e) => {
window.REMARK42.changeTheme(e.detail);
})
</script>
{{- end -}}

View File

@ -0,0 +1,10 @@
{{ $vid := .Get 0 }}
<div style="position: relative; width: 100%; height: 0; padding-bottom: 56.25%;">
<iframe src="http://v.qq.com/txp/iframe/player.html?vid={{ $vid }}&auto=0"
scrolling="no"
frameborder="no"
framespacing="0"
allowfullscreen="true"
style="position: absolute; width: 100%; height: 100%;">
</iframe>
</div>