Compare commits

..
4 Commits
Author SHA1 Message Date
Jimmy Cai cef9fe2549 release: v2.2.0 2021-02-13 16:30:01 +01:00
Jimmy CaiandGitHub 21b42f0b6c feat: add archetypes (#145) 2021-02-13 15:55:56 +01:00
Jimmy CaiandGitHub 79412144d9 fix: disable svg image processing (#144)
* fix: disable svg image processing

closes https://github.com/CaiJimmy/hugo-theme-stack/issues/132

* style: remove extra blank space
2021-02-13 12:57:19 +01:00
79d8c1db38 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>
2021-02-13 11:10:24 +01:00
9 changed files with 75 additions and 5 deletions
+7
View File
@@ -0,0 +1,7 @@
---
title: "{{ replace .Name "-" " " | title }}"
image:
style:
background: "#2a9d8f"
color: "#fff"
---
+11 -2
View File
@@ -1,2 +1,11 @@
+++
+++
---
title: "{{ replace .Name "-" " " | title }}"
description:
date: {{ .Date }}
image:
math:
license:
hidden: false
comments: true
draft: true
---
+5
View File
@@ -0,0 +1,5 @@
---
title: "{{ replace .Name "-" " " | title }}"
description:
image:
---
+6
View File
@@ -49,11 +49,17 @@ params:
comments:
enabled: true
provider: disqus
utterances:
repo:
issueTerm: pathname
label:
remark42:
host:
site:
locale:
widgets:
enabled:
- search
+1 -1
View File
@@ -1,5 +1,5 @@
{{- $image := .Page.Resources.GetMatch (printf "%s" (.Destination | safeURL)) -}}
{{- if $image -}}
{{- if and $image (ne (path.Ext .Destination) ".svg") -}}
{{- $alt := .PlainText | safeHTML -}}
<figure style="flex-grow: {{ div (mul $image.Width 100) $image.Height }}; flex-basis: {{ div (mul $image.Width 240) $image.Height }}px">
<a href="{{ $image.RelPermalink }}" data-size="{{ $image.Width }}x{{ $image.Height }}">
@@ -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 -}}
+1 -1
View File
@@ -1,4 +1,4 @@
{{- $ThemeVersion := "2.1.0" -}}
{{- $ThemeVersion := "2.2.0" -}}
<footer class="site-footer">
<section class="copyright">
&copy;
+5 -1
View File
@@ -16,7 +16,11 @@
{{ if $pageResourceImage }}
<!-- If image is found under page bundle -->
{{ $result = merge $result (dict "permalink" $pageResourceImage.RelPermalink) }}
{{ $result = merge $result (dict "resource" $pageResourceImage) }}
<!-- Disable SVG image processing, not supported by Hugo -->
{{ if ne (path.Ext $imageValue) ".svg" }}
{{ $result = merge $result (dict "resource" $pageResourceImage) }}
{{ end }}
{{ else }}
<!-- Can not find the image under page bundle. Could be a relative linked image -->
{{ $result = merge $result (dict "permalink" $imageValue) }}
+10
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>