Skip to content

Commit

Permalink
v1.3.0-alpha.2 updated 2020.4.24
Browse files Browse the repository at this point in the history
版本特性:
1. 支持文章页与首页 SEO Meta
2. 支持文章页与首页 JSON-LD 结构化数据
3. 支持 Gitalk 评论
4. 支持 Valine 评论
5. 支持 Utterances 评论
以上评论系统均以能够通过 AMP 验证的方式实现,由于不是官方给出的实现方案,可能存在一些常规情况下不会出现的问题,在后面的版本中随时可能被移除。
  • Loading branch information
jiansing committed Apr 24, 2020
1 parent 388d8db commit 494f7e1
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 3 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ https://jiansing.github.io/include-images-and-video/
添加评论
https://jiansing.github.io/add-comment-for-gridea-theme-inlineamp/

## v1.3.0-alpha.2 updated 2020.4.24
版本特性:
1. 支持文章页与首页 SEO Meta
2. 支持文章页与首页 JSON-LD 结构化数据
3. 支持 Gitalk 评论
4. 支持 Valine 评论
5. 支持 Utterances 评论
以上评论系统均以能够通过 AMP 验证的方式实现,由于不是官方给出的实现方案,可能存在一些常规情况下不会出现的问题,在后面的版本中随时可能被移除。


## v1.2.1 updated 2020.4.24
1. 修复了 Disqus 评论区重复显示的问题

Expand Down
14 changes: 13 additions & 1 deletion inlineamp/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,13 @@
"value": "gitalk"
},
{
"label": "utterances 评论(实验性)",
"label": "Utterances 评论(实验性)",
"value": "utterances"
},
{
"label": "Valine 评论(实验性)",
"value": "valine"
},
{
"label": "Disqus",
"value": "disqus"
Expand All @@ -142,6 +146,14 @@
"type": "input",
"note": "该文件不能与 blog 使用同一域名(可以使用不同的子域名如 cdn.example.com)"
},
{
"name": "valineurl",
"label": "Valine 代码 URL",
"group": "评论",
"value": "",
"type": "input",
"note": "该文件不能与 blog 使用同一域名(可以使用不同的子域名如 cdn.example.com)"
},
{
"name": "facebookcommentslanguage",
"label": "Facebook 评论系统语言",
Expand Down
2 changes: 1 addition & 1 deletion inlineamp/templates/includes/head.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ footer{width:100vw;background:#222;display:flex;justify-content:center}
<link rel="canonical" href="<%= themeConfig.domain %>" />
<link rel="shortcut icon" href="<%= themeConfig.domain %>/favicon.ico?v=<%= site.utils.now %>">

<%- include('./includes/seo') %>
<%- include('./seo') %>

<% if (site.customConfig.search) { %><script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script><% } %>
<% if (site.customConfig.video) { %><script async custom-element="amp-video" src="https://cdn.ampproject.org/v0/amp-video-0.1.js"></script><% } %>
Expand Down
5 changes: 4 additions & 1 deletion inlineamp/templates/includes/post-head.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2496,7 +2496,7 @@ footer {
<link rel="canonical" href="<%= post.link %>" />
<link rel="shortcut icon" href="<%= themeConfig.domain %>/favicon.ico?v=<%= site.utils.now %>">

<%- include('./includes/postseo') %>
<%- include('./postseo') %>

<% if (site.customConfig.search) { %><script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script><% } %>
<% if (site.customConfig.video) { %><script async custom-element="amp-video" src="https://cdn.ampproject.org/v0/amp-video-0.1.js"></script><% } %>
Expand All @@ -2516,6 +2516,9 @@ footer {
<% if (site.customConfig.comments === 'disqus') { %>
<script async custom-element="amp-iframe" src="https://cdn.ampproject.org/v0/amp-iframe-0.1.js"></script>
<% } %>
<% if (site.customConfig.comments === 'valine') { %>
<script async custom-element="amp-iframe" src="https://cdn.ampproject.org/v0/amp-iframe-0.1.js"></script>
<% } %>
<% if (site.customConfig.comments === 'gitalk') { %>
<script async custom-element="amp-iframe" src="https://cdn.ampproject.org/v0/amp-iframe-0.1.js"></script>
<% } %>
Expand Down
15 changes: 15 additions & 0 deletions inlineamp/templates/includes/valine.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<div id="comments" class="comments content">
<div id="respond" class="comment-respond">
<amp-iframe width=600 height=200 layout="responsive"
sandbox="allow-scripts allow-same-origin allow-modals allow-popups allow-forms" resizable
src="<%= site.customConfig.valineurl %>?id=<%= post.link %>">
<div
overflow
tabindex=0
role=button
aria-label="Loading"
>Loading</div>
</amp-iframe>

</div>
</div>
4 changes: 4 additions & 0 deletions inlineamp/templates/post.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@
<%- include('./includes/utterances') %>
<% } %>
<% if (site.customConfig.comments === 'valine') { %>
<%- include('./includes/valine') %>
<% } %>
<% if (site.customConfig.comments === 'facebookcomments') { %>
<%- include('./includes/facebookcomments') %>
<% } %>
Expand Down

0 comments on commit 494f7e1

Please sign in to comment.