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:
parent
8b6622792d
commit
79d8c1db38
@ -49,11 +49,17 @@ params:
|
||||
comments:
|
||||
enabled: true
|
||||
provider: disqus
|
||||
|
||||
utterances:
|
||||
repo:
|
||||
issueTerm: pathname
|
||||
label:
|
||||
|
||||
remark42:
|
||||
host:
|
||||
site:
|
||||
locale:
|
||||
|
||||
widgets:
|
||||
enabled:
|
||||
- search
|
||||
|
29
layouts/partials/comments/provider/remark42.html
Normal file
29
layouts/partials/comments/provider/remark42.html
Normal 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 -}}
|
10
layouts/shortcodes/tencent.html
Normal file
10
layouts/shortcodes/tencent.html
Normal 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>
|
Loading…
Reference in New Issue
Block a user