hexo-theme-nblog 1.0.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/.github/workflows/publish.yml +25 -0
- package/LICENSE +21 -0
- package/README.md +46 -0
- package/_config.yml +77 -0
- package/layout/_partial/footer.ejs +49 -0
- package/layout/_partial/header.ejs +49 -0
- package/layout/_partial/open-graph.ejs +77 -0
- package/layout/_partial/post-license.ejs +44 -0
- package/layout/archive.ejs +45 -0
- package/layout/category.ejs +76 -0
- package/layout/friends.ejs +57 -0
- package/layout/index.ejs +104 -0
- package/layout/layout.ejs +92 -0
- package/layout/page.ejs +11 -0
- package/layout/post.ejs +135 -0
- package/layout/tag.ejs +68 -0
- package/package.json +25 -0
- package/scripts/helpers.js +8 -0
- package/source/css/admonition.css +366 -0
- package/source/css/highlight.css +135 -0
- package/source/css/main.css +2057 -0
- package/source/css/markdown.css +454 -0
- package/source/css/twikoo.css +105 -0
- package/source/favicon.svg +3 -0
- package/source/js/main.js +415 -0
package/layout/index.ejs
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<div class="posts-page container">
|
|
2
|
+
<div class="posts-page__content">
|
|
3
|
+
<div class="posts-list">
|
|
4
|
+
<% page.posts.each(function(post) { %>
|
|
5
|
+
<article class="post-card material-card animate-fade-in-up">
|
|
6
|
+
<a href="<%= url_for(post.path) %>" class="post-card__link">
|
|
7
|
+
<div class="post-card__cover">
|
|
8
|
+
<% if (post.cover) { %>
|
|
9
|
+
<img src="<%= post.cover %>" alt="<%= post.title %>" loading="lazy">
|
|
10
|
+
<% } else { %>
|
|
11
|
+
<div class="post-card__cover-placeholder"></div>
|
|
12
|
+
<% } %>
|
|
13
|
+
<div class="post-card__overlay"></div>
|
|
14
|
+
<div class="post-card__info">
|
|
15
|
+
<div class="post-card__meta">
|
|
16
|
+
<span class="post-card__date"><%= date(post.date, 'YYYY-MM-DD') %></span>
|
|
17
|
+
<% if (post.categories && post.categories.length > 0) { %>
|
|
18
|
+
<span class="post-card__category"><%= post.categories.toArray()[0].name %></span>
|
|
19
|
+
<% } %>
|
|
20
|
+
</div>
|
|
21
|
+
<h2 class="post-card__title"><%= post.title %></h2>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</a>
|
|
25
|
+
</article>
|
|
26
|
+
<% }); %>
|
|
27
|
+
|
|
28
|
+
<% if (page.total > 1) { %>
|
|
29
|
+
<nav class="pagination">
|
|
30
|
+
<%- paginator({
|
|
31
|
+
prev_text: '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="15 18 9 12 15 6"></polyline></svg>',
|
|
32
|
+
next_text: '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="9 18 15 12 9 6"></polyline></svg>',
|
|
33
|
+
escape: false
|
|
34
|
+
}) %>
|
|
35
|
+
</nav>
|
|
36
|
+
<% } %>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<aside class="sidebar">
|
|
40
|
+
<div class="author-card material-card animate-fade-in-right">
|
|
41
|
+
<div class="author-card__avatar">
|
|
42
|
+
<img src="<%= theme.avatar %>" alt="<%= theme.author %>" loading="lazy">
|
|
43
|
+
</div>
|
|
44
|
+
<h3 class="author-card__name"><%= theme.author %></h3>
|
|
45
|
+
<p class="author-card__bio"><%= theme.bio %></p>
|
|
46
|
+
<div class="author-card__stats">
|
|
47
|
+
<div class="author-card__stat">
|
|
48
|
+
<span class="author-card__stat-value"><%= site.posts.length %></span>
|
|
49
|
+
<span class="author-card__stat-label">文章</span>
|
|
50
|
+
</div>
|
|
51
|
+
<div class="author-card__stat">
|
|
52
|
+
<span class="author-card__stat-value"><%= site.categories.length %></span>
|
|
53
|
+
<span class="author-card__stat-label">分类</span>
|
|
54
|
+
</div>
|
|
55
|
+
<div class="author-card__stat">
|
|
56
|
+
<span class="author-card__stat-value"><%= site.tags.length %></span>
|
|
57
|
+
<span class="author-card__stat-label">标签</span>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
<% if (theme.social && theme.social.length > 0) { %>
|
|
61
|
+
<div class="author-card__social">
|
|
62
|
+
<% for (var link of theme.social) { %>
|
|
63
|
+
<a href="<%= link.url %>" target="_blank" rel="noopener" class="author-card__social-link" title="<%= link.platform %>">
|
|
64
|
+
<%- link.icon %>
|
|
65
|
+
</a>
|
|
66
|
+
<% } %>
|
|
67
|
+
</div>
|
|
68
|
+
<% } %>
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
<div class="sidebar-widget material-card animate-fade-in-right animate-delay-1">
|
|
72
|
+
<h3 class="sidebar-widget__title">
|
|
73
|
+
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
74
|
+
<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path>
|
|
75
|
+
</svg>
|
|
76
|
+
分类
|
|
77
|
+
</h3>
|
|
78
|
+
<div class="sidebar-widget__content">
|
|
79
|
+
<% site.categories.sort('name').forEach(function(category) { %>
|
|
80
|
+
<a href="<%= url_for(category.path) %>" class="sidebar-widget__item">
|
|
81
|
+
<span class="sidebar-widget__item-name"><%= category.name %></span>
|
|
82
|
+
<span class="sidebar-widget__item-count"><%= category.length %></span>
|
|
83
|
+
</a>
|
|
84
|
+
<% }); %>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
<div class="sidebar-widget material-card animate-fade-in-right animate-delay-2">
|
|
89
|
+
<h3 class="sidebar-widget__title">
|
|
90
|
+
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
91
|
+
<path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"></path>
|
|
92
|
+
<line x1="7" y1="7" x2="7.01" y2="7"></line>
|
|
93
|
+
</svg>
|
|
94
|
+
标签云
|
|
95
|
+
</h3>
|
|
96
|
+
<div class="sidebar-widget__content sidebar-widget__content--tags">
|
|
97
|
+
<% site.tags.sort('name').forEach(function(tag) { %>
|
|
98
|
+
<a href="<%= url_for(tag.path) %>" class="tag-cloud__tag"><%= tag.name %></a>
|
|
99
|
+
<% }); %>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
</aside>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="<%= config.language || 'zh-CN' %>">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<meta name="description" content="<%= config.description %>">
|
|
8
|
+
<meta name="keywords" content="<%= config.keywords %>">
|
|
9
|
+
<title>
|
|
10
|
+
<% if (is_post()) { %>
|
|
11
|
+
<%= page.title %> | <% } %>
|
|
12
|
+
<%= config.title %>
|
|
13
|
+
</title>
|
|
14
|
+
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
|
|
15
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
16
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
17
|
+
<link
|
|
18
|
+
href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&family=Noto+Sans+SC:wght@400;500;700&display=swap"
|
|
19
|
+
rel="stylesheet">
|
|
20
|
+
<link rel="stylesheet" href="<%= url_for('/css/main.css') %>">
|
|
21
|
+
<% if (is_post()) { %>
|
|
22
|
+
<link rel="stylesheet" href="<%= url_for('/css/markdown.css') %>">
|
|
23
|
+
<link rel="stylesheet" href="<%= url_for('/css/highlight.css') %>">
|
|
24
|
+
<link rel="stylesheet" href="<%= url_for('/css/admonition.css') %>">
|
|
25
|
+
<% if (theme.twikoo && theme.twikoo.enable) { %>
|
|
26
|
+
<link rel="stylesheet" href="<%= url_for('/css/twikoo.css') %>">
|
|
27
|
+
<% } %>
|
|
28
|
+
<% } %>
|
|
29
|
+
<%- partial('_partial/open-graph') %>
|
|
30
|
+
<% if (theme.canonical && theme.canonical.enable && typeof autoCanonical==='function' ) { %>
|
|
31
|
+
<%- autoCanonical(config, page) %>
|
|
32
|
+
<% } %>
|
|
33
|
+
</head>
|
|
34
|
+
|
|
35
|
+
<body>
|
|
36
|
+
<div class="app">
|
|
37
|
+
<div class="app__background">
|
|
38
|
+
<div class="app__circle app__circle--1"></div>
|
|
39
|
+
<div class="app__circle app__circle--2"></div>
|
|
40
|
+
<div class="app__circle app__circle--3"></div>
|
|
41
|
+
</div>
|
|
42
|
+
<%- partial('_partial/header') %>
|
|
43
|
+
<main class="main" id="pjax-container">
|
|
44
|
+
<%- body %>
|
|
45
|
+
</main>
|
|
46
|
+
<%- partial('_partial/footer') %>
|
|
47
|
+
</div>
|
|
48
|
+
<script src="<%= url_for('/js/main.js') %>"></script>
|
|
49
|
+
<% if (theme.pjax && theme.pjax.enable) { %>
|
|
50
|
+
<script src="https://cdn.jsdelivr.net/npm/pjax@0.2.8/pjax.min.js"></script>
|
|
51
|
+
<script>
|
|
52
|
+
var pjax = new Pjax({
|
|
53
|
+
selectors: [
|
|
54
|
+
'title',
|
|
55
|
+
'meta[name="description"]',
|
|
56
|
+
'meta[property="og:title"]',
|
|
57
|
+
'meta[property="og:description"]',
|
|
58
|
+
'meta[property="og:url"]',
|
|
59
|
+
'meta[property="og:image"]',
|
|
60
|
+
'meta[property="article:published_time"]',
|
|
61
|
+
'meta[property="article:modified_time"]',
|
|
62
|
+
'#pjax-container',
|
|
63
|
+
'#header'
|
|
64
|
+
],
|
|
65
|
+
cacheBust: false
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
document.addEventListener('pjax:complete', function () {
|
|
69
|
+
if (typeof initPage === 'function') {
|
|
70
|
+
initPage();
|
|
71
|
+
}
|
|
72
|
+
if (typeof twikoo !== 'undefined' && twikoo.init) {
|
|
73
|
+
twikoo.init({
|
|
74
|
+
envId: '<%= theme.twikoo.envId %>',
|
|
75
|
+
el: '#twikoo-comment'
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
</script>
|
|
80
|
+
<% } %>
|
|
81
|
+
<% if (is_post() && theme.twikoo && theme.twikoo.enable) { %>
|
|
82
|
+
<script src="https://cdn.jsdelivr.net/npm/twikoo@1.6.39/dist/twikoo.all.min.js"></script>
|
|
83
|
+
<script>
|
|
84
|
+
twikoo.init({
|
|
85
|
+
envId: '<%= theme.twikoo.envId %>',
|
|
86
|
+
el: '#twikoo-comment'
|
|
87
|
+
});
|
|
88
|
+
</script>
|
|
89
|
+
<% } %>
|
|
90
|
+
</body>
|
|
91
|
+
|
|
92
|
+
</html>
|
package/layout/page.ejs
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<div class="<%= page.layout %>-page container">
|
|
2
|
+
<div class="page-header animate-fade-in-up">
|
|
3
|
+
<h1 class="page-header__title"><%= page.title %></h1>
|
|
4
|
+
<% if (page.description) { %>
|
|
5
|
+
<p class="page-header__description"><%= page.description %></p>
|
|
6
|
+
<% } %>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="page-content animate-fade-in-up animate-delay-1">
|
|
9
|
+
<%- page.content %>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
package/layout/post.ejs
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
<article class="post-page container">
|
|
2
|
+
<% if (page.toc !==false) { %>
|
|
3
|
+
<aside class="post-toc" id="postToc" role="navigation" aria-label="文章目录">
|
|
4
|
+
<div class="post-toc__inner">
|
|
5
|
+
<div class="post-toc__header">
|
|
6
|
+
<span class="post-toc__title">目录</span>
|
|
7
|
+
<button class="post-toc__toggle" id="tocToggle" type="button" aria-label="折叠目录" aria-expanded="true"
|
|
8
|
+
aria-controls="tocContent">
|
|
9
|
+
<svg class="post-toc__toggle-icon" width="16" height="16" viewBox="0 0 24 24" fill="none"
|
|
10
|
+
stroke="currentColor" stroke-width="2">
|
|
11
|
+
<polyline points="9 18 15 12 9 6"></polyline>
|
|
12
|
+
</svg>
|
|
13
|
+
</button>
|
|
14
|
+
</div>
|
|
15
|
+
<nav class="post-toc__content js-toc" id="tocContent"></nav>
|
|
16
|
+
</div>
|
|
17
|
+
</aside>
|
|
18
|
+
<% } %>
|
|
19
|
+
<div class="post-page__content">
|
|
20
|
+
<header class="post-header animate-fade-in-up">
|
|
21
|
+
<% if (page.cover) { %>
|
|
22
|
+
<div class="post-header__cover">
|
|
23
|
+
<img src="<%= page.cover %>" alt="<%= page.title %>" loading="lazy">
|
|
24
|
+
</div>
|
|
25
|
+
<% } %>
|
|
26
|
+
<h1 class="post-header__title">
|
|
27
|
+
<%= page.title %>
|
|
28
|
+
</h1>
|
|
29
|
+
<div class="post-header__meta">
|
|
30
|
+
<span class="post-header__date">
|
|
31
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
32
|
+
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect>
|
|
33
|
+
<line x1="16" y1="2" x2="16" y2="6"></line>
|
|
34
|
+
<line x1="8" y1="2" x2="8" y2="6"></line>
|
|
35
|
+
<line x1="3" y1="10" x2="21" y2="10"></line>
|
|
36
|
+
</svg>
|
|
37
|
+
<%= date(page.date, 'YYYY-MM-DD' ) %>
|
|
38
|
+
</span>
|
|
39
|
+
<% if (page.updated && page.updated.valueOf() !==page.date.valueOf()) { %>
|
|
40
|
+
<span class="post-header__updated">
|
|
41
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
42
|
+
<path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path>
|
|
43
|
+
<path d="M21 3v5h-5"></path>
|
|
44
|
+
</svg>
|
|
45
|
+
更新于 <%= date(page.updated, 'YYYY-MM-DD' ) %>
|
|
46
|
+
</span>
|
|
47
|
+
<% } %>
|
|
48
|
+
<% if (page.categories && page.categories.length> 0) { %>
|
|
49
|
+
<a href="<%= url_for(page.categories.toArray()[0].path) %>" class="post-header__category">
|
|
50
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|
51
|
+
stroke-width="2">
|
|
52
|
+
<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path>
|
|
53
|
+
</svg>
|
|
54
|
+
<%= page.categories.toArray()[0].name %>
|
|
55
|
+
</a>
|
|
56
|
+
<% } %>
|
|
57
|
+
<span class="post-header__reading-time">
|
|
58
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|
59
|
+
stroke-width="2">
|
|
60
|
+
<circle cx="12" cy="12" r="10"></circle>
|
|
61
|
+
<polyline points="12 6 12 12 16 14"></polyline>
|
|
62
|
+
</svg>
|
|
63
|
+
约 <%= Math.ceil(strip_html(page.content).length / 400) %> 分钟
|
|
64
|
+
</span>
|
|
65
|
+
</div>
|
|
66
|
+
</header>
|
|
67
|
+
|
|
68
|
+
<div class="post-body-wrapper" id="postBodyWrapper">
|
|
69
|
+
<div class="post-body animate-fade-in-up animate-delay-1" id="postBody">
|
|
70
|
+
<%- page.content %>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
<% if (page.tags && page.tags.length> 0) { %>
|
|
75
|
+
<footer class="post-footer animate-fade-in-up animate-delay-2">
|
|
76
|
+
<div class="post-footer__tags">
|
|
77
|
+
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
78
|
+
<path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"></path>
|
|
79
|
+
<line x1="7" y1="7" x2="7.01" y2="7"></line>
|
|
80
|
+
</svg>
|
|
81
|
+
<% page.tags.toArray().forEach(function(tag) { %>
|
|
82
|
+
<a href="<%= url_for(tag.path) %>" class="post-footer__tag">#<%= tag.name %></a>
|
|
83
|
+
<% }); %>
|
|
84
|
+
</div>
|
|
85
|
+
</footer>
|
|
86
|
+
<% } %>
|
|
87
|
+
|
|
88
|
+
<%- partial('_partial/post-license') %>
|
|
89
|
+
|
|
90
|
+
<nav class="post-nav animate-fade-in-up animate-delay-3">
|
|
91
|
+
<% if (page.prev) { %>
|
|
92
|
+
<a href="<%= url_for(page.prev.path) %>" class="post-nav__item post-nav__item--prev">
|
|
93
|
+
<span class="post-nav__label">
|
|
94
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|
95
|
+
stroke-width="2">
|
|
96
|
+
<polyline points="15 18 9 12 15 6"></polyline>
|
|
97
|
+
</svg>
|
|
98
|
+
上一篇
|
|
99
|
+
</span>
|
|
100
|
+
<span class="post-nav__title">
|
|
101
|
+
<%= page.prev.title %>
|
|
102
|
+
</span>
|
|
103
|
+
</a>
|
|
104
|
+
<% } else { %>
|
|
105
|
+
<span class="post-nav__item post-nav__item--prev post-nav__item--disabled">
|
|
106
|
+
<span class="post-nav__label">没有更多了</span>
|
|
107
|
+
</span>
|
|
108
|
+
<% } %>
|
|
109
|
+
<% if (page.next) { %>
|
|
110
|
+
<a href="<%= url_for(page.next.path) %>" class="post-nav__item post-nav__item--next">
|
|
111
|
+
<span class="post-nav__label">
|
|
112
|
+
下一篇
|
|
113
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|
114
|
+
stroke-width="2">
|
|
115
|
+
<polyline points="9 18 15 12 9 6"></polyline>
|
|
116
|
+
</svg>
|
|
117
|
+
</span>
|
|
118
|
+
<span class="post-nav__title">
|
|
119
|
+
<%= page.next.title %>
|
|
120
|
+
</span>
|
|
121
|
+
</a>
|
|
122
|
+
<% } else { %>
|
|
123
|
+
<span class="post-nav__item post-nav__item--next post-nav__item--disabled">
|
|
124
|
+
<span class="post-nav__label">没有更多了</span>
|
|
125
|
+
</span>
|
|
126
|
+
<% } %>
|
|
127
|
+
</nav>
|
|
128
|
+
</div>
|
|
129
|
+
|
|
130
|
+
<% if (theme.twikoo && theme.twikoo.enable) { %>
|
|
131
|
+
<section class="post-comments animate-fade-in-up animate-delay-4">
|
|
132
|
+
<div id="twikoo-comment"></div>
|
|
133
|
+
</section>
|
|
134
|
+
<% } %>
|
|
135
|
+
</article>
|
package/layout/tag.ejs
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<% if (page.posts && page.posts.length > 0) { %>
|
|
2
|
+
<div class="tag-posts-page container">
|
|
3
|
+
<div class="page-header animate-fade-in-up">
|
|
4
|
+
<h1 class="page-header__title">
|
|
5
|
+
<svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
6
|
+
<path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"></path>
|
|
7
|
+
<line x1="7" y1="7" x2="7.01" y2="7"></line>
|
|
8
|
+
</svg>
|
|
9
|
+
标签: <%= page.tag %>
|
|
10
|
+
</h1>
|
|
11
|
+
<p class="page-header__description">共 <%= page.posts.length %> 篇文章</p>
|
|
12
|
+
<a href="<%= url_for('/tags/') %>" class="page-header__back">
|
|
13
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
14
|
+
<polyline points="15 18 9 12 15 6"></polyline>
|
|
15
|
+
</svg>
|
|
16
|
+
返回标签列表
|
|
17
|
+
</a>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<div class="posts-list animate-fade-in-up animate-delay-1">
|
|
21
|
+
<% page.posts.each(function(post) { %>
|
|
22
|
+
<article class="post-card material-card">
|
|
23
|
+
<a href="<%= url_for(post.path) %>" class="post-card__link">
|
|
24
|
+
<div class="post-card__cover">
|
|
25
|
+
<% if (post.cover) { %>
|
|
26
|
+
<img src="<%= post.cover %>" alt="<%= post.title %>" loading="lazy">
|
|
27
|
+
<% } else { %>
|
|
28
|
+
<div class="post-card__cover-placeholder"></div>
|
|
29
|
+
<% } %>
|
|
30
|
+
<div class="post-card__overlay"></div>
|
|
31
|
+
<div class="post-card__info">
|
|
32
|
+
<div class="post-card__meta">
|
|
33
|
+
<span class="post-card__date"><%= date(post.date, 'YYYY-MM-DD') %></span>
|
|
34
|
+
<% if (post.categories && post.categories.length > 0) { %>
|
|
35
|
+
<span class="post-card__category"><%= post.categories.toArray()[0].name %></span>
|
|
36
|
+
<% } %>
|
|
37
|
+
</div>
|
|
38
|
+
<h2 class="post-card__title"><%= post.title %></h2>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</a>
|
|
42
|
+
</article>
|
|
43
|
+
<% }); %>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
<% } else { %>
|
|
47
|
+
<div class="tags-page container">
|
|
48
|
+
<div class="page-header animate-fade-in-up">
|
|
49
|
+
<h1 class="page-header__title">
|
|
50
|
+
<svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
51
|
+
<path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"></path>
|
|
52
|
+
<line x1="7" y1="7" x2="7.01" y2="7"></line>
|
|
53
|
+
</svg>
|
|
54
|
+
标签
|
|
55
|
+
</h1>
|
|
56
|
+
<p class="page-header__description">共 <%= site.tags.length %> 个标签</p>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<div class="tags-cloud animate-fade-in-up animate-delay-1">
|
|
60
|
+
<% site.tags.sort('name').forEach(function(tag) { %>
|
|
61
|
+
<a href="<%= url_for(tag.path) %>" class="tags-cloud__tag" style="font-size: <%= Math.max(0.9, Math.min(1.5, 0.9 + tag.length * 0.05)) %>rem">
|
|
62
|
+
<span class="tags-cloud__name"><%= tag.name %></span>
|
|
63
|
+
<span class="tags-cloud__count"><%= tag.length %></span>
|
|
64
|
+
</a>
|
|
65
|
+
<% }); %>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
<% } %>
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "hexo-theme-nblog",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A lightweight and minimalist blog theme",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/Nitai9h/nBlogHexo.git"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"hexo",
|
|
15
|
+
"theme",
|
|
16
|
+
"nblog",
|
|
17
|
+
"material-design",
|
|
18
|
+
"glassmorphism",
|
|
19
|
+
"dark-mode",
|
|
20
|
+
"pjax",
|
|
21
|
+
"responsive"
|
|
22
|
+
],
|
|
23
|
+
"author": "",
|
|
24
|
+
"license": "MIT"
|
|
25
|
+
}
|