hexo-theme-ayeria 1.9.7-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +38 -0
- package/README.md +553 -0
- package/_config.yml +271 -0
- package/_scaffolds/post.md +8 -0
- package/index.js +2 -0
- package/languages/de.yml +39 -0
- package/languages/default.yml +39 -0
- package/languages/en.yml +39 -0
- package/languages/es.yml +39 -0
- package/languages/fr.yml +39 -0
- package/languages/ja.yml +39 -0
- package/languages/ko.yml +39 -0
- package/languages/nl.yml +39 -0
- package/languages/no.yml +39 -0
- package/languages/pt.yml +39 -0
- package/languages/ru.yml +39 -0
- package/languages/vi.yml +39 -0
- package/languages/zh-CN.yml +39 -0
- package/languages/zh-TW.yml +39 -0
- package/layout/_partial/ads.ejs +9 -0
- package/layout/_partial/after-footer.ejs +84 -0
- package/layout/_partial/archive-post.ejs +14 -0
- package/layout/_partial/archive.ejs +62 -0
- package/layout/_partial/article.ejs +94 -0
- package/layout/_partial/ayeria.ejs +53 -0
- package/layout/_partial/baidu-analytics.ejs +11 -0
- package/layout/_partial/broadcast.ejs +20 -0
- package/layout/_partial/float-btns.ejs +8 -0
- package/layout/_partial/footer.ejs +62 -0
- package/layout/_partial/google-analytics.ejs +10 -0
- package/layout/_partial/head.ejs +67 -0
- package/layout/_partial/katex.ejs +22 -0
- package/layout/_partial/lock.ejs +37 -0
- package/layout/_partial/mathjax.ejs +19 -0
- package/layout/_partial/modal.ejs +77 -0
- package/layout/_partial/music.ejs +16 -0
- package/layout/_partial/post/albums.ejs +17 -0
- package/layout/_partial/post/author.ejs +8 -0
- package/layout/_partial/post/busuanzi.ejs +5 -0
- package/layout/_partial/post/category.ejs +10 -0
- package/layout/_partial/post/clipboard.ejs +54 -0
- package/layout/_partial/post/date.ejs +3 -0
- package/layout/_partial/post/gallery.ejs +15 -0
- package/layout/_partial/post/giscus.ejs +40 -0
- package/layout/_partial/post/gitalk.ejs +12 -0
- package/layout/_partial/post/justifiedGallery.ejs +9 -0
- package/layout/_partial/post/nav.ejs +22 -0
- package/layout/_partial/post/search.ejs +4 -0
- package/layout/_partial/post/share.ejs +51 -0
- package/layout/_partial/post/tag.ejs +6 -0
- package/layout/_partial/post/title.ejs +16 -0
- package/layout/_partial/post/tocbot.ejs +6 -0
- package/layout/_partial/post/topping.ejs +3 -0
- package/layout/_partial/post/twikoo.ejs +7 -0
- package/layout/_partial/post/valine.ejs +48 -0
- package/layout/_partial/post/word.ejs +20 -0
- package/layout/_partial/sidebar.ejs +34 -0
- package/layout/_partial/viewer.ejs +106 -0
- package/layout/archive.ejs +1 -0
- package/layout/categories.ejs +8 -0
- package/layout/friends.ejs +20 -0
- package/layout/index.ejs +4 -0
- package/layout/layout.ejs +31 -0
- package/layout/page.ejs +3 -0
- package/layout/plain-page.ejs +4 -0
- package/layout/post.ejs +3 -0
- package/layout/tags.ejs +88 -0
- package/logo.png +0 -0
- package/package.json +38 -0
- package/scripts/default_config.js +6 -0
- package/scripts/events/index.js +11 -0
- package/scripts/events/lib/hello.js +45 -0
- package/scripts/events/lib/merge-configs.js +28 -0
- package/scripts/filters/index.js +13 -0
- package/scripts/filters/meta_generator.js +17 -0
- package/scripts/helpers/ayeria-plus-vendors.js +9 -0
- package/scripts/helpers/category-tree.js +90 -0
- package/scripts/helpers/wordcount.js +39 -0
- package/scripts/lib/core.js +25 -0
- package/scripts/utils/join-path.js +12 -0
- package/scripts/utils/object.js +31 -0
- package/source/404.html +187 -0
- package/source/css/clipboard.styl +37 -0
- package/source/css/custom.styl +971 -0
- package/source/css/fonts/remixicon.css +1816 -0
- package/source/css/fonts/remixicon.eot +0 -0
- package/source/css/fonts/remixicon.svg +5329 -0
- package/source/css/fonts/remixicon.ttf +0 -0
- package/source/css/fonts/remixicon.woff +0 -0
- package/source/css/fonts/remixicon.woff2 +0 -0
- package/source/data/random-sentences.txt +136 -0
- package/source/dist/main.css +1 -0
- package/source/dist/main.js +1 -0
- package/source/favicon.svg +1 -0
- package/source/images/ayeria-side.svg +1 -0
- package/source/images/ayeria.png +0 -0
- package/source/images/ayeria.svg +1 -0
- package/source/images/beian.png +0 -0
- package/source/images/cover1.jpg +0 -0
- package/source/images/cover2.webp +0 -0
- package/source/images/cover3.jpg +0 -0
- package/source/images/cover4.jpg +0 -0
- package/source/images/cover5.jpg +0 -0
- package/source/images/cover6.jpg +0 -0
- package/source/images/forkme.png +0 -0
- package/source/images/gitee.png +0 -0
- package/source/images/github.png +0 -0
- package/source/images/hexo-tag-chart.png +0 -0
- package/source/images/hexo.png +0 -0
- package/source/images/mouse.cur +0 -0
- package/source/js/busuanzi-2.3.pure.min.js +1 -0
- package/source/js/clickBoom1.js +152 -0
- package/source/js/clickBoom2.js +180 -0
- package/source/js/clickLove.js +1 -0
- package/source/js/dz.js +1 -0
- package/source/js/jquery-3.6.0.min.js +2 -0
- package/source/js/lazyload.min.js +8 -0
- package/source/js/random-sentences.js +166 -0
- package/source/js/search.js +127 -0
- package/source/js/tocbot.min.js +1 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<% if ( theme.katex.enable ) { %>
|
|
2
|
+
<% if( theme.katex.allpost || page.math ) { %>
|
|
3
|
+
<link rel="stylesheet" href="https://cdn.staticfile.org/KaTeX/0.15.1/katex.min.css">
|
|
4
|
+
<script src="https://cdn.staticfile.org/KaTeX/0.15.1/katex.min.js"></script>
|
|
5
|
+
<script src="https://cdn.staticfile.org/KaTeX/0.15.1/contrib/auto-render.min.js"></script>
|
|
6
|
+
<% if ( theme.katex.copy_tex ) { %>
|
|
7
|
+
<script src="https://cdn.staticfile.org/KaTeX/0.15.1/contrib/copy-tex.min.js"></script>
|
|
8
|
+
<link rel="stylesheet" href="https://cdn.staticfile.org/KaTeX/0.15.1/contrib/copy-tex.min.css">
|
|
9
|
+
<% } %>
|
|
10
|
+
<script>
|
|
11
|
+
document.addEventListener("DOMContentLoaded", function() {
|
|
12
|
+
renderMathInElement(document.body, {
|
|
13
|
+
delimiters: [
|
|
14
|
+
{left: "$$", right: "$$", display: true},
|
|
15
|
+
{left: "$", right: "$", display: false}
|
|
16
|
+
],
|
|
17
|
+
throwOnError: false
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
</script>
|
|
21
|
+
<% } %>
|
|
22
|
+
<% } %>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<% if (theme.lock.enable){ %>
|
|
2
|
+
<script>
|
|
3
|
+
const password = "<%= theme.lock.password %>";
|
|
4
|
+
const lock_password = window.sessionStorage.getItem("lock_password");
|
|
5
|
+
console.log(password, lock_password);
|
|
6
|
+
if (lock_password !== password) {
|
|
7
|
+
Swal.fire({
|
|
8
|
+
title: "<%= __('lock.lock_info') %>",
|
|
9
|
+
input: "text",
|
|
10
|
+
inputAttributes: {
|
|
11
|
+
autocapitalize: "off",
|
|
12
|
+
},
|
|
13
|
+
showCancelButton: false,
|
|
14
|
+
showLoaderOnConfirm: true,
|
|
15
|
+
allowOutsideClick: false,
|
|
16
|
+
confirmButtonText: "<%= __('lock.confirm_text') %>",
|
|
17
|
+
}).then((result) => {
|
|
18
|
+
console.log(result);
|
|
19
|
+
if (result.isConfirmed) {
|
|
20
|
+
console.log(password);
|
|
21
|
+
if (result.value === password) {
|
|
22
|
+
window.sessionStorage.setItem("lock_password", result.value);
|
|
23
|
+
} else {
|
|
24
|
+
Swal.fire({
|
|
25
|
+
icon: "error",
|
|
26
|
+
title: "<%= __('lock.lock_error') %>",
|
|
27
|
+
confirmButtonText: "<%= __('lock.confirm_text') %>",
|
|
28
|
+
allowOutsideClick: false,
|
|
29
|
+
}).then(() => {
|
|
30
|
+
window.location.reload();
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
</script>
|
|
37
|
+
<% } %>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script type="text/x-mathjax-config">
|
|
2
|
+
MathJax.Hub.Config({
|
|
3
|
+
tex2jax: {
|
|
4
|
+
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
|
|
5
|
+
processEscapes: true,
|
|
6
|
+
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
MathJax.Hub.Queue(function() {
|
|
11
|
+
var all = MathJax.Hub.getAllJax(), i;
|
|
12
|
+
for(i=0; i < all.length; i += 1) {
|
|
13
|
+
all[i].SourceElement().parentNode.className += ' has-jax';
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<script src="https://cdn.staticfile.org/mathjax/2.7.7/MathJax.js"></script>
|
|
19
|
+
<script src="https://cdn.staticfile.org/mathjax/2.7.7/config/TeX-AMS-MML_HTMLorMML-full.js"></script>
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<div id="mask"></div>
|
|
2
|
+
|
|
3
|
+
<% var channels = (theme.reward && theme.reward.channels) ? theme.reward.channels : []; %>
|
|
4
|
+
<% if (channels.length > 0) { %>
|
|
5
|
+
<div id="reward" class="reward-modal" style="--reward-accent: <%= channels[0].color %>">
|
|
6
|
+
<span class="reward-close"><i class="ri-close-line"></i></span>
|
|
7
|
+
|
|
8
|
+
<p class="reward-wording">
|
|
9
|
+
<i class="ri-cup-line"></i><%= theme.reward_wording %>
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
<% if (channels.length > 1) { %>
|
|
13
|
+
<div class="reward-tabs">
|
|
14
|
+
<% channels.forEach(function(ch, i) { %>
|
|
15
|
+
<button class="reward-tab<%= i === 0 ? ' active' : '' %>"
|
|
16
|
+
data-index="<%= i %>"
|
|
17
|
+
data-color="<%= ch.color %>">
|
|
18
|
+
<i class="<%= ch.icon %>"></i>
|
|
19
|
+
<span><%= ch.name %></span>
|
|
20
|
+
</button>
|
|
21
|
+
<% }); %>
|
|
22
|
+
</div>
|
|
23
|
+
<% } %>
|
|
24
|
+
|
|
25
|
+
<div class="reward-panels">
|
|
26
|
+
<% channels.forEach(function(ch, i) { %>
|
|
27
|
+
<div class="reward-panel<%= i === 0 ? ' active' : '' %>" data-index="<%= i %>">
|
|
28
|
+
|
|
29
|
+
<% if (ch.children && ch.children.length) { %>
|
|
30
|
+
<% if (ch.description) { %>
|
|
31
|
+
<p class="reward-chain-hint"><%= ch.description %></p>
|
|
32
|
+
<% } %>
|
|
33
|
+
<div class="reward-sub-tabs">
|
|
34
|
+
<% ch.children.forEach(function(sub, j) { %>
|
|
35
|
+
<button class="reward-sub-tab<%= j === 0 ? ' active' : '' %>"
|
|
36
|
+
data-parent="<%= i %>" data-sub="<%= j %>">
|
|
37
|
+
<%= sub.name %>
|
|
38
|
+
<% if (sub.badge) { %><span class="reward-sub-badge"><%= sub.badge %></span><% } %>
|
|
39
|
+
</button>
|
|
40
|
+
<% }); %>
|
|
41
|
+
</div>
|
|
42
|
+
<% ch.children.forEach(function(sub, j) { %>
|
|
43
|
+
<div class="reward-sub-panel<%= j === 0 ? ' active' : '' %>"
|
|
44
|
+
data-parent="<%= i %>" data-sub="<%= j %>">
|
|
45
|
+
<div class="reward-qrcode-wrap">
|
|
46
|
+
<img class="reward-qrcode" src="<%- url_for(sub.qrcode) %>" alt="<%= ch.name %> - <%= sub.name %>">
|
|
47
|
+
</div>
|
|
48
|
+
<% if (sub.description) { %>
|
|
49
|
+
<p class="reward-desc"><%= sub.description %></p>
|
|
50
|
+
<% } %>
|
|
51
|
+
<% if (sub.link) { %>
|
|
52
|
+
<a class="reward-link" href="<%= sub.link %>" target="_blank" rel="noopener">
|
|
53
|
+
前往<%= sub.name %> <i class="ri-external-link-line"></i>
|
|
54
|
+
</a>
|
|
55
|
+
<% } %>
|
|
56
|
+
</div>
|
|
57
|
+
<% }); %>
|
|
58
|
+
<% } else { %>
|
|
59
|
+
|
|
60
|
+
<div class="reward-qrcode-wrap">
|
|
61
|
+
<img class="reward-qrcode" src="<%- url_for(ch.qrcode) %>" alt="<%= ch.name %>">
|
|
62
|
+
</div>
|
|
63
|
+
<% if (ch.description) { %>
|
|
64
|
+
<p class="reward-desc"><%= ch.description %></p>
|
|
65
|
+
<% } %>
|
|
66
|
+
<% if (ch.link) { %>
|
|
67
|
+
<a class="reward-link" href="<%= ch.link %>" target="_blank" rel="noopener">
|
|
68
|
+
前往<%= ch.name %> <i class="ri-external-link-line"></i>
|
|
69
|
+
</a>
|
|
70
|
+
<% } %>
|
|
71
|
+
<% } %>
|
|
72
|
+
|
|
73
|
+
</div>
|
|
74
|
+
<% }); %>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
<% } %>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<div id="music">
|
|
2
|
+
<%# "bottom:120px; left:auto;position:fixed; width:85%" %>
|
|
3
|
+
<% var defaultHeight = theme.music.type == 1 ? '32' : '66'; %>
|
|
4
|
+
<% var defaultIframeHeight = theme.music.type == 1 ? '52' : '86'; %>
|
|
5
|
+
<iframe frameborder="no" border="1" marginwidth="0" marginheight="0" width="200" height="<%=defaultIframeHeight%>"
|
|
6
|
+
src="//music.163.com/outchain/player?type=2&id=<%=theme.music.id||22707008%>&auto=<%=theme.music.autoPlay?1:0%>&height=<%=defaultHeight%>"></iframe>
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<style>
|
|
10
|
+
#music {
|
|
11
|
+
position: fixed;
|
|
12
|
+
right: 15px;
|
|
13
|
+
bottom: 0;
|
|
14
|
+
z-index: 998;
|
|
15
|
+
}
|
|
16
|
+
</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<% if (post.albums && post.albums.length){ %>
|
|
2
|
+
<div class="article-albums">
|
|
3
|
+
<ul class="article-albums-photos" id="basicExample">
|
|
4
|
+
<% post.albums.forEach(function(photo){ %>
|
|
5
|
+
|
|
6
|
+
<li class="article-albums-item" data-scroll-reveal>
|
|
7
|
+
<img class="lazy" data-original="<%- url_for(photo[0]) %>" itemprop="image" alt="<%- photo[1] %>"
|
|
8
|
+
style="cursor: pointer;">
|
|
9
|
+
<% if (photo && photo.length > 1){ %>
|
|
10
|
+
<span class="article-albums-caption"> <%- photo[1] %> </span>
|
|
11
|
+
<% } %>
|
|
12
|
+
</li>
|
|
13
|
+
|
|
14
|
+
<% }) %>
|
|
15
|
+
</ul>
|
|
16
|
+
</div>
|
|
17
|
+
<% } %>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<% if (post.authors && post.authors.length){ %>
|
|
2
|
+
<div class="<%= class_name %>" <% if (!index){ %> style="text-align: center" <% }%>>
|
|
3
|
+
作者:<% for (var i = 0; i < post.authors.length - 1; i++) { %>
|
|
4
|
+
<%= post.authors[i]%> ,
|
|
5
|
+
<% }%> <%= post.authors[post.authors.length - 1] %>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<% } %>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<span>
|
|
2
|
+
<span><i class="ri-user-3-fill"></i><%- __('site_visitors') %>:<span id="busuanzi_value_site_uv"></span></span>
|
|
3
|
+
<span class="division">|</span>
|
|
4
|
+
<span><i class="ri-eye-fill"></i><%- __('page_views') %>:<span id="busuanzi_value_page_pv"></span></span>
|
|
5
|
+
</span>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<script src="https://cdn.staticfile.org/clipboard.js/2.0.10/clipboard.min.js"></script>
|
|
2
|
+
<script>
|
|
3
|
+
function wait(callback, seconds) {
|
|
4
|
+
var timelag = null;
|
|
5
|
+
timelag = window.setTimeout(callback, seconds);
|
|
6
|
+
}
|
|
7
|
+
!function (e, t, a) {
|
|
8
|
+
var initCopyCode = function(){
|
|
9
|
+
var copyHtml = '';
|
|
10
|
+
copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
|
|
11
|
+
copyHtml += '<i class="ri-file-copy-2-line"></i><span>COPY</span>';
|
|
12
|
+
copyHtml += '</button>';
|
|
13
|
+
$(".highlight .code pre").before(copyHtml);
|
|
14
|
+
$(".article pre code").before(copyHtml);
|
|
15
|
+
var clipboard = new ClipboardJS('.btn-copy', {
|
|
16
|
+
target: function(trigger) {
|
|
17
|
+
return trigger.nextElementSibling;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
clipboard.on('success', function(e) {
|
|
21
|
+
let $btn = $(e.trigger);
|
|
22
|
+
$btn.addClass('copied');
|
|
23
|
+
let $icon = $($btn.find('i'));
|
|
24
|
+
$icon.removeClass('ri-file-copy-2-line');
|
|
25
|
+
$icon.addClass('ri-checkbox-circle-line');
|
|
26
|
+
let $span = $($btn.find('span'));
|
|
27
|
+
$span[0].innerText = 'COPIED';
|
|
28
|
+
|
|
29
|
+
wait(function () { // 等待两秒钟后恢复
|
|
30
|
+
$icon.removeClass('ri-checkbox-circle-line');
|
|
31
|
+
$icon.addClass('ri-file-copy-2-line');
|
|
32
|
+
$span[0].innerText = 'COPY';
|
|
33
|
+
}, 2000);
|
|
34
|
+
});
|
|
35
|
+
clipboard.on('error', function(e) {
|
|
36
|
+
e.clearSelection();
|
|
37
|
+
let $btn = $(e.trigger);
|
|
38
|
+
$btn.addClass('copy-failed');
|
|
39
|
+
let $icon = $($btn.find('i'));
|
|
40
|
+
$icon.removeClass('ri-file-copy-2-line');
|
|
41
|
+
$icon.addClass('ri-time-line');
|
|
42
|
+
let $span = $($btn.find('span'));
|
|
43
|
+
$span[0].innerText = 'COPY FAILED';
|
|
44
|
+
|
|
45
|
+
wait(function () { // 等待两秒钟后恢复
|
|
46
|
+
$icon.removeClass('ri-time-line');
|
|
47
|
+
$icon.addClass('ri-file-copy-2-line');
|
|
48
|
+
$span[0].innerText = 'COPY';
|
|
49
|
+
}, 2000);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
initCopyCode();
|
|
53
|
+
}(window, document);
|
|
54
|
+
</script>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<% if (post.photos && post.photos.length){ %>
|
|
2
|
+
<div class="article-gallery">
|
|
3
|
+
<div class="article-gallery-photos">
|
|
4
|
+
<% post.photos.forEach(function(photo, i){ %>
|
|
5
|
+
<% if (index){ %>
|
|
6
|
+
<a class="article-gallery-img" href="<%- url_for(post.path) %>" rel="gallery_<%= post._id %>">
|
|
7
|
+
<img src="<%- url_for(photo) %>" itemprop="image">
|
|
8
|
+
</a>
|
|
9
|
+
<% } else { %>
|
|
10
|
+
<img src="<%- url_for(photo) %>" itemprop="image">
|
|
11
|
+
<% } %>
|
|
12
|
+
<% }) %>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
<% } %>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<% if (theme.giscus && theme.giscus.enable && post.comments !== false) { %>
|
|
2
|
+
<div class="giscus-container" style="margin-top: 2rem; padding: 0 1rem;">
|
|
3
|
+
<script
|
|
4
|
+
src="https://giscus.app/client.js"
|
|
5
|
+
data-repo="<%- theme.giscus.repo %>"
|
|
6
|
+
data-repo-id="<%- theme.giscus.repo_id %>"
|
|
7
|
+
data-category="<%- theme.giscus.category %>"
|
|
8
|
+
data-category-id="<%- theme.giscus.category_id %>"
|
|
9
|
+
data-mapping="<%- theme.giscus.mapping || 'pathname' %>"
|
|
10
|
+
data-strict="0"
|
|
11
|
+
data-reactions-enabled="<%- theme.giscus.reactions_enabled || 1 %>"
|
|
12
|
+
data-emit-metadata="<%- theme.giscus.emit_metadata || 0 %>"
|
|
13
|
+
data-input-position="<%- theme.giscus.input_position || 'top' %>"
|
|
14
|
+
data-theme="dark"
|
|
15
|
+
data-lang="<%- theme.giscus.lang || 'zh-CN' %>"
|
|
16
|
+
crossorigin="anonymous"
|
|
17
|
+
async
|
|
18
|
+
></script>
|
|
19
|
+
<script>
|
|
20
|
+
/* giscus 通过 async 加载,iframe 可能在 ayeria.js 初始化之后才就绪。
|
|
21
|
+
站点默认暗色模式所以 data-theme="dark" 覆盖多数情况,
|
|
22
|
+
但若用户之前选择了亮色模式(sessionStorage darkmode==0),
|
|
23
|
+
需要在 iframe 就绪后修正主题。 */
|
|
24
|
+
if (sessionStorage.getItem("darkmode") == 0) {
|
|
25
|
+
window.addEventListener("message", function _giscusThemeFix(e) {
|
|
26
|
+
if (e.origin !== "https://giscus.app") return;
|
|
27
|
+
if (!(typeof e.data === "object" && e.data.giscus)) return;
|
|
28
|
+
var f = document.querySelector("iframe.giscus-frame");
|
|
29
|
+
if (f) {
|
|
30
|
+
f.contentWindow.postMessage(
|
|
31
|
+
{ giscus: { setConfig: { theme: "light" } } },
|
|
32
|
+
"https://giscus.app"
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
window.removeEventListener("message", _giscusThemeFix);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
</script>
|
|
39
|
+
</div>
|
|
40
|
+
<% } %>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<%#
|
|
2
|
+
[已停用] Gitalk 评论系统模板
|
|
3
|
+
停用时间: 2026-03
|
|
4
|
+
停用原因: OAuth clientSecret 泄露 + 纯前端架构的固有安全缺陷
|
|
5
|
+
迁移目标: giscus (基于 GitHub Discussions)
|
|
6
|
+
详情参见: doc/audit-report.md #1 #9
|
|
7
|
+
历史评论: 保留在 blog-comments 仓库的 GitHub Issues 中
|
|
8
|
+
|
|
9
|
+
如需恢复,需要重新创建 OAuth App 并在 _config.ayeria.yml 中
|
|
10
|
+
设置 gitalk.enable: true 及对应的 clientID / clientSecret。
|
|
11
|
+
原始模板代码可在 git 历史记录中查看。
|
|
12
|
+
%>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<% if (post.albums && post.albums.length){ %>
|
|
2
|
+
<div class="justified-gallery" id="gallery">
|
|
3
|
+
<% post.albums.forEach(function(photo){ %>
|
|
4
|
+
<div>
|
|
5
|
+
<img src="<%- url_for(photo[0]) %>" itemprop="image" alt="<%- photo[1] %>" style="cursor: pointer;">
|
|
6
|
+
</div>
|
|
7
|
+
<% }) %>
|
|
8
|
+
</div>
|
|
9
|
+
<% } %>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<% if (post.prev || post.next){ %>
|
|
2
|
+
<nav class="article-nav">
|
|
3
|
+
<% if (post.prev){ %>
|
|
4
|
+
<a href="<%- url_for(post.prev.path) %>" class="article-nav-link">
|
|
5
|
+
<strong class="article-nav-caption"><%- theme.nav_text.post_prev %></strong>
|
|
6
|
+
<div class="article-nav-title">
|
|
7
|
+
<% if (post.prev.title){ %>
|
|
8
|
+
<%= post.prev.title %>
|
|
9
|
+
<% } else { %>
|
|
10
|
+
(no title)
|
|
11
|
+
<% } %>
|
|
12
|
+
</div>
|
|
13
|
+
</a>
|
|
14
|
+
<% } %>
|
|
15
|
+
<% if (post.next){ %>
|
|
16
|
+
<a href="<%- url_for(post.next.path) %>" class="article-nav-link">
|
|
17
|
+
<strong class="article-nav-caption"><%- theme.nav_text.post_next %></strong>
|
|
18
|
+
<div class="article-nav-title"><%= post.next.title %></div>
|
|
19
|
+
</a>
|
|
20
|
+
<% } %>
|
|
21
|
+
</nav>
|
|
22
|
+
<% } %>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<%
|
|
2
|
+
var sUrl = url.replace(/index\.html$/, '');
|
|
3
|
+
sUrl = /^(http:|https:)\/\//.test(sUrl) ? sUrl : 'http:' + sUrl;
|
|
4
|
+
%>
|
|
5
|
+
<div class="share-btn">
|
|
6
|
+
<span class="share-sns share-outer">
|
|
7
|
+
<i class="ri-share-forward-line"></i>
|
|
8
|
+
<%- theme.share_text %>
|
|
9
|
+
</span>
|
|
10
|
+
<div class="share-wrap">
|
|
11
|
+
<i class="arrow"></i>
|
|
12
|
+
<div class="share-icons">
|
|
13
|
+
<% if( theme.share_china ){ %>
|
|
14
|
+
<a class="weibo share-sns" href="javascript:;" data-type="weibo">
|
|
15
|
+
<i class="ri-weibo-fill"></i>
|
|
16
|
+
</a>
|
|
17
|
+
<a class="weixin share-sns wxFab" href="javascript:;" data-type="weixin">
|
|
18
|
+
<i class="ri-wechat-fill"></i>
|
|
19
|
+
</a>
|
|
20
|
+
<a class="qq share-sns" href="javascript:;" data-type="qq">
|
|
21
|
+
<i class="ri-qq-fill"></i>
|
|
22
|
+
</a>
|
|
23
|
+
<a class="douban share-sns" href="javascript:;" data-type="douban">
|
|
24
|
+
<i class="ri-douban-line"></i>
|
|
25
|
+
</a>
|
|
26
|
+
<!-- <a class="qzone share-sns" href="javascript:;" data-type="qzone">
|
|
27
|
+
<i class="icon icon-qzone"></i>
|
|
28
|
+
</a> -->
|
|
29
|
+
<% } %>
|
|
30
|
+
<a class="facebook share-sns" href="javascript:;" data-type="facebook">
|
|
31
|
+
<i class="ri-facebook-circle-fill"></i>
|
|
32
|
+
</a>
|
|
33
|
+
<a class="twitter share-sns" href="javascript:;" data-type="twitter">
|
|
34
|
+
<i class="ri-twitter-fill"></i>
|
|
35
|
+
</a>
|
|
36
|
+
<a class="google share-sns" href="javascript:;" data-type="google">
|
|
37
|
+
<i class="ri-google-fill"></i>
|
|
38
|
+
</a>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div class="wx-share-modal">
|
|
44
|
+
<a class="modal-close" href="javascript:;"><i class="ri-close-circle-line"></i></a>
|
|
45
|
+
<p>扫一扫,分享到微信</p>
|
|
46
|
+
<div class="wx-qrcode">
|
|
47
|
+
<img src="<%- 'qrcode' in locals ? qrcode(sUrl) : '//api.qrserver.com/v1/create-qr-code/?size=150x150&data=' + sUrl %>" alt="微信分享二维码">
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<div id="share-mask"></div>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<% if (post.link){ %>
|
|
2
|
+
<h2 itemprop="name">
|
|
3
|
+
<a class="<%= class_name %>" href="<%- url_for(post.link) %>" itemprop="url"
|
|
4
|
+
><%= post.title %></a
|
|
5
|
+
>
|
|
6
|
+
</h2>
|
|
7
|
+
<% } else if (post.title){ %> <% if (index){ %>
|
|
8
|
+
<h2 itemprop="name">
|
|
9
|
+
<a class="<%= class_name %>" href="<%- url_for(post.path) %>"
|
|
10
|
+
><%= post.title %><%- partial('topping') %></a>
|
|
11
|
+
</h2>
|
|
12
|
+
<% } else { %>
|
|
13
|
+
<h1 class="<%= class_name %> sea-center" style="border-left:0" itemprop="name">
|
|
14
|
+
<%= post.title %>
|
|
15
|
+
</h1>
|
|
16
|
+
<% } %> <% } %>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<% if (!index && theme.leancloud && theme.leancloud.enable && post.comments){ %>
|
|
2
|
+
<!-- valine评论 -->
|
|
3
|
+
<div id="vcomments-box">
|
|
4
|
+
<div id="vcomments"></div>
|
|
5
|
+
</div>
|
|
6
|
+
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
|
|
7
|
+
<script src="https://cdn.staticfile.org/valine/1.4.16/Valine.min.js"></script>
|
|
8
|
+
<script>
|
|
9
|
+
new Valine({
|
|
10
|
+
el: "#vcomments",
|
|
11
|
+
app_id: "<%- theme.leancloud.app_id %>",
|
|
12
|
+
app_key: "<%- theme.leancloud.app_key %>",
|
|
13
|
+
path: window.location.pathname,
|
|
14
|
+
avatar: "<%- theme.valine.avatar %>",
|
|
15
|
+
placeholder: "<%- theme.valine.placeholder %>",
|
|
16
|
+
recordIP: true,
|
|
17
|
+
});
|
|
18
|
+
const infoEle = document.querySelector("#vcomments .info");
|
|
19
|
+
if (infoEle && infoEle.childNodes && infoEle.childNodes.length > 0) {
|
|
20
|
+
infoEle.childNodes.forEach(function (item) {
|
|
21
|
+
item.parentNode.removeChild(item);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
</script>
|
|
25
|
+
<style>
|
|
26
|
+
#vcomments-box {
|
|
27
|
+
padding: 5px 30px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@media screen and (max-width: 800px) {
|
|
31
|
+
#vcomments-box {
|
|
32
|
+
padding: 5px 0px;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
#vcomments-box #vcomments {
|
|
37
|
+
background-color: #fff;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.v .vlist .vcard .vh {
|
|
41
|
+
padding-right: 20px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.v .vlist .vcard {
|
|
45
|
+
padding-left: 10px;
|
|
46
|
+
}
|
|
47
|
+
</style>
|
|
48
|
+
<% } %>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<% if (!theme.word_count.only_article_visit || (!index && theme.word_count.only_article_visit)){ %>
|
|
2
|
+
<div class="word_count">
|
|
3
|
+
<span class="post-time">
|
|
4
|
+
<span class="post-meta-item-icon">
|
|
5
|
+
<i class="ri-quill-pen-line"></i>
|
|
6
|
+
<span class="post-meta-item-text"> <%= __('post.word_count') %>:</span>
|
|
7
|
+
<span class="post-count"><%= wordcount(post.content) %></span>
|
|
8
|
+
</span>
|
|
9
|
+
</span>
|
|
10
|
+
|
|
11
|
+
<span class="post-time">
|
|
12
|
+
|
|
|
13
|
+
<span class="post-meta-item-icon">
|
|
14
|
+
<i class="ri-book-open-line"></i>
|
|
15
|
+
<span class="post-meta-item-text"> <%= __('post.read_time') %>≈</span>
|
|
16
|
+
<span class="post-count"><%= min2read(post.content) %> <%= __('post.minutes') %></span>
|
|
17
|
+
</span>
|
|
18
|
+
</span>
|
|
19
|
+
</div>
|
|
20
|
+
<% } %>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<button class="float-btn navbar-toggle"></button>
|
|
2
|
+
<nav class="navbar">
|
|
3
|
+
<% if (theme.logo){ %>
|
|
4
|
+
<div class="logo">
|
|
5
|
+
<a href="<%- url_for() %>"><img src="<%- theme.logo %>" alt="<%= config.title %>"></a>
|
|
6
|
+
</div>
|
|
7
|
+
<% } %>
|
|
8
|
+
<ul class="nav nav-main">
|
|
9
|
+
<% for (var i in theme.menu){ %>
|
|
10
|
+
<li class="nav-item">
|
|
11
|
+
<a class="nav-item-link" href="<%- url_for(theme.menu[i]) %>"><%= i %></a>
|
|
12
|
+
</li>
|
|
13
|
+
<% } %>
|
|
14
|
+
</ul>
|
|
15
|
+
</nav>
|
|
16
|
+
<nav class="navbar navbar-bottom">
|
|
17
|
+
<ul class="nav">
|
|
18
|
+
<li class="nav-item">
|
|
19
|
+
<% if (theme.search){ %>
|
|
20
|
+
<a class="nav-item-link nav-item-search" title="<%= __('search') %>">
|
|
21
|
+
<i class="ri-search-line"></i>
|
|
22
|
+
</a>
|
|
23
|
+
<% } %>
|
|
24
|
+
<% if (theme.rss){ %>
|
|
25
|
+
<a class="nav-item-link" target="_blank" href="<%- url_for(theme.rss) %>" title="<%= __('rss_feed') %>">
|
|
26
|
+
<i class="ri-rss-line"></i>
|
|
27
|
+
</a>
|
|
28
|
+
<% } %>
|
|
29
|
+
</li>
|
|
30
|
+
</ul>
|
|
31
|
+
</nav>
|
|
32
|
+
<div class="search-form-wrap">
|
|
33
|
+
<%- partial('post/search') %>
|
|
34
|
+
</div>
|