hexo-theme-linen 1.0.21 → 1.0.23
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/languages/en.yml +3 -0
- package/languages/zh-CN.yml +4 -1
- package/layout/footer.ejs +62 -0
- package/layout/layout.ejs +22 -9
- package/layout/partials/header.ejs +1 -1
- package/layout/partials/post-item.ejs +5 -5
- package/layout/partials/related-posts.ejs +1 -1
- package/layout/post.ejs +362 -24
- package/layout/series.ejs +277 -4
- package/package.json +1 -1
- package/scripts/font-version.js +5 -3
- package/scripts/helpers/tools.js +187 -191
- package/scripts/lazyload/client.js +11 -2
- package/scripts/lazyload/index.js +7 -5
- package/scripts/lazyload/inject.js +8 -0
- package/scripts/lazyload/process.js +202 -163
- package/scripts/markdown-it-image-grid.js +74 -10
- package/source/linen-theme/css/{mediaquery.scss → _mediaquery.scss} +183 -12
- package/source/linen-theme/css/atom.xsl +37 -0
- package/source/linen-theme/css/font-version.scss +1 -1
- package/source/linen-theme/css/images/layers-2x.png +0 -0
- package/source/linen-theme/css/images/layers.png +0 -0
- package/source/linen-theme/css/images/marker-icon-2x.png +0 -0
- package/source/linen-theme/css/images/marker-icon.png +0 -0
- package/source/linen-theme/css/images/marker-shadow.png +0 -0
- package/source/linen-theme/css/leaflet.css +661 -0
- package/source/linen-theme/css/linen.scss +1198 -114
- package/source/linen-theme/css/linkcard.scss +53 -11
- package/source/linen-theme/css/noscript.css +70 -0
- package/source/linen-theme/css/photoswipe-dynamic-caption-plugin.css +1 -1
- package/source/linen-theme/css/photoswipe.css +166 -1
- package/source/linen-theme/css/rss-en.xsl +1 -1
- package/source/linen-theme/css/rss-zh.xsl +1 -1
- package/source/linen-theme/css/vars.scss +1 -1
- package/source/linen-theme/img/pattern-randomized.svg +1 -0
- package/source/linen-theme/img/travel-map-fallback.svg +30 -0
- package/source/linen-theme/js/hdr.js +42 -12
- package/source/linen-theme/js/lazyload.js +11 -2
- package/source/linen-theme/js/leaflet.js +6 -0
- package/source/linen-theme/js/linen.js +114 -83
- package/source/linen-theme/js/photoswipe/photoswipe.esm.min.js +13 -0
- package/source/linen-theme/js/replace-emoji.js +2 -4
- package/source/linen-theme/js/toc.js +71 -121
- package/layout/partials/footer.ejs +0 -12
- package/source/linen-theme/img/icons/backref.svg +0 -1
- package/source/linen-theme/img/icons/more.svg +0 -4
package/languages/en.yml
CHANGED
|
@@ -20,6 +20,7 @@ common:
|
|
|
20
20
|
prevPost: "Prev"
|
|
21
21
|
nextPost: "Next"
|
|
22
22
|
copyright: "This site and its content are licensed under a Creative Commons Attribution-NonCommercial 4.0 International License."
|
|
23
|
+
copyrightTitle: "Copyright License"
|
|
23
24
|
gallery: "Gallery"
|
|
24
25
|
relatedPosts: "Related Posts"
|
|
25
26
|
series: "Series"
|
|
@@ -37,3 +38,5 @@ common:
|
|
|
37
38
|
thanks: "Thanks to"
|
|
38
39
|
sponsored: "sponsored"
|
|
39
40
|
seriesPostCountShort: "articles"
|
|
41
|
+
navigation: "Navigation"
|
|
42
|
+
subscribe: "Subscribe"
|
package/languages/zh-CN.yml
CHANGED
|
@@ -20,6 +20,7 @@ common:
|
|
|
20
20
|
prevPost: "上一篇"
|
|
21
21
|
nextPost: "下一篇"
|
|
22
22
|
copyright: "本网站及其所有内容都遵循创意共享署名-非商业性使用 4.0 国际许可协议。"
|
|
23
|
+
copyrightTitle: "版权协议"
|
|
23
24
|
gallery: "图库"
|
|
24
25
|
relatedPosts: "相关文章"
|
|
25
26
|
series: "系列"
|
|
@@ -31,9 +32,11 @@ common:
|
|
|
31
32
|
total: "共"
|
|
32
33
|
age_notice: "这是一个创建于 <span class='days-value'></span> 天前的主题,其中的信息可能已经有所发展或是发生改变。"
|
|
33
34
|
minsRead: "分钟阅读"
|
|
34
|
-
switchTo: "
|
|
35
|
+
switchTo: "查看"
|
|
35
36
|
renderedContent: "渲染后的内容"
|
|
36
37
|
rawMarkdownContent: "原始 Markdown 内容"
|
|
37
38
|
thanks: "感谢"
|
|
38
39
|
sponsored: "赞赏了"
|
|
39
40
|
seriesPostCountShort: "篇"
|
|
41
|
+
navigation: "导航"
|
|
42
|
+
subscribe: "订阅"
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<footer id="footer">
|
|
2
|
+
<div class="footerInner">
|
|
3
|
+
<div class="footerTop">
|
|
4
|
+
<div class="footerBrand">
|
|
5
|
+
<img src="<%=url_for('/linen-theme/img/logo_black.svg')%>" class="footerLogo" alt="logo" />
|
|
6
|
+
<% if (theme?.info?.site_desc) { %>
|
|
7
|
+
<p class="footerDesc"><%= theme.info.site_desc %></p>
|
|
8
|
+
<% } %>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="footerLinks">
|
|
11
|
+
<div class="footerLinkCol">
|
|
12
|
+
<h4><%= __('common.navigation') %></h4>
|
|
13
|
+
<% if (theme?.navItems) { %>
|
|
14
|
+
<% theme.navItems.forEach(item => { %>
|
|
15
|
+
<a href="<%=url_for(item.path)%>"><%=item.name%></a>
|
|
16
|
+
<% }); %>
|
|
17
|
+
<% } %>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="footerLinkCol">
|
|
20
|
+
<h4><%= __('common.subscribe') %></h4>
|
|
21
|
+
<%
|
|
22
|
+
const rssPath = config?.feed?.path || theme?.feed?.path;
|
|
23
|
+
if (rssPath) {
|
|
24
|
+
%>
|
|
25
|
+
<a href="<%=url_for(rssPath)%>" target="_blank" class="footerRssLink">
|
|
26
|
+
<svg class="rssSvg" viewBox="0 0 24 24" width="14" height="14">
|
|
27
|
+
<path fill="currentColor" d="M6.18,15.64A2.18,2.18,0,0,1,8.36,17.82a2.18,2.18,0,0,1-2.18,2.18A2.18,2.18,0,0,1,4,17.82,2.18,2.18,0,0,1,6.18,15.64M4,4.44A15.56,15.56,0,0,1,19.56,20h-2.8A12.76,12.76,0,0,0,4,7.24V4.44m0,5.6A9.96,9.96,0,0,1,13.96,20h-2.8A7.16,7.16,0,0,0,4,12.84V10.04Z" />
|
|
28
|
+
</svg>
|
|
29
|
+
<span>RSS</span>
|
|
30
|
+
</a>
|
|
31
|
+
<% } %>
|
|
32
|
+
</div>
|
|
33
|
+
<div class="footerLinkCol footerMetaCol">
|
|
34
|
+
<h4><a href="<%=url_for('/explorers-guide')%>"><%= __('common.aboutThisSite') %></a></h4>
|
|
35
|
+
<span class="footerMetaText copyright">
|
|
36
|
+
<span class="copyright-popover-container">
|
|
37
|
+
<span class="copyright-trigger" tabindex="0" aria-haspopup="true">©</span>
|
|
38
|
+
<span class="copyright-popover-content">
|
|
39
|
+
<span class="copyright-popover-arrow"></span>
|
|
40
|
+
<span class="copyright-popover-header">
|
|
41
|
+
<svg class="copyright-popover-icon" viewBox="0 0 24 24" width="14" height="14">
|
|
42
|
+
<path fill="currentColor" d="M11 17h2v-6h-2v6zm1-15C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-1-13h2V7h-2v2z"/>
|
|
43
|
+
</svg>
|
|
44
|
+
<span class="copyright-popover-title"><%=__('common.copyrightTitle')%></span>
|
|
45
|
+
</span>
|
|
46
|
+
<span class="copyright-popover-text"><%=__('common.copyright')%></span>
|
|
47
|
+
</span>
|
|
48
|
+
</span> <%=date(Date.now(), 'YYYY')+' '+config.author%>
|
|
49
|
+
</span>
|
|
50
|
+
<span class="footerMetaText">
|
|
51
|
+
Powered by <a href="https://hexo.io/" target="_blank">Hexo</a> & <a href="https://github.com/LynanBreeze/hexo-theme-linen" target="_blank">Linen</a>
|
|
52
|
+
</span>
|
|
53
|
+
<% if (theme?.info?.registration) { %>
|
|
54
|
+
<span class="footerMetaText registration">
|
|
55
|
+
<a href="http://beian.miit.gov.cn/" target="_blank"><%=theme.info.registration%></a>
|
|
56
|
+
</span>
|
|
57
|
+
<% } %>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</footer>
|
package/layout/layout.ejs
CHANGED
|
@@ -5,6 +5,7 @@ const version = theme.version;
|
|
|
5
5
|
<%
|
|
6
6
|
var tocs = is_post() ? extractTocFromHtml(page.content) : null;
|
|
7
7
|
var series = is_post() ? site.posts.filter(item=>item.series && item.series === page?.series).sort('date', -1) : []
|
|
8
|
+
var seriesInfo = is_post() && page?.series ? getSeriesInfo(page.series) : {}
|
|
8
9
|
%>
|
|
9
10
|
|
|
10
11
|
<!DOCTYPE html>
|
|
@@ -12,7 +13,7 @@ const version = theme.version;
|
|
|
12
13
|
|
|
13
14
|
<head>
|
|
14
15
|
<meta charset="UTF-8" />
|
|
15
|
-
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1
|
|
16
|
+
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1" />
|
|
16
17
|
<title><%=getPageTitle()%></title>
|
|
17
18
|
<link rel="icon" type="image/x-icon" href="<%=url_for(theme?.icon ?? '/linen-theme/favicon.svg')%>" />
|
|
18
19
|
<meta name="referrer" content="no-referrer-when-downgrade" />
|
|
@@ -44,7 +45,8 @@ const version = theme.version;
|
|
|
44
45
|
<% } %>
|
|
45
46
|
</head>
|
|
46
47
|
|
|
47
|
-
<body>
|
|
48
|
+
<body class="<%- is_post() ? 'is-post' : '' %>">
|
|
49
|
+
<div id=" "></div>
|
|
48
50
|
<div id="page-top"></div>
|
|
49
51
|
<%-partial('partials/header', {
|
|
50
52
|
hasTocs: page?.toc ?? !!tocs?.length
|
|
@@ -79,7 +81,18 @@ const version = theme.version;
|
|
|
79
81
|
<div class="post-series">
|
|
80
82
|
<a class="series-title" href="<%=url_for(`/series/${page.series}/`)%>"><%=page.series%></a>
|
|
81
83
|
<div class="series-items">
|
|
82
|
-
<%
|
|
84
|
+
<%
|
|
85
|
+
let currentSeriesYear = null;
|
|
86
|
+
take(series, 50).forEach((item, index) => {
|
|
87
|
+
const itemYear = item.date?.year ? item.date.year() : new Date(item.date).getFullYear();
|
|
88
|
+
const showYearDivider = seriesInfo?.yearDivider && itemYear && itemYear !== currentSeriesYear;
|
|
89
|
+
if (showYearDivider) {
|
|
90
|
+
currentSeriesYear = itemYear;
|
|
91
|
+
}
|
|
92
|
+
%>
|
|
93
|
+
<% if (showYearDivider) { %>
|
|
94
|
+
<div class="series-year-divider<%-itemYear === page?.date?.year() ? ' active': ''%>"><%=itemYear%></div>
|
|
95
|
+
<% } %>
|
|
83
96
|
<a class="series-item-link<%-item.source === page.source ? ' active': ''%>" href="<%=url_for(item.path)%>"><%-`${item.title}`%><% if (item.subTitle) { %><span class="sub-title"><%=item.subTitle%></span><% } %></a>
|
|
84
97
|
<% }); %>
|
|
85
98
|
<% if(series.length > 50) { %>
|
|
@@ -90,15 +103,15 @@ const version = theme.version;
|
|
|
90
103
|
<% } %>
|
|
91
104
|
</div>
|
|
92
105
|
<div id="content-outer" class="<%= is_post() ? 'post-outer' : page.seriesInfo?.cover ? 'series-outer': '' %>">
|
|
93
|
-
<
|
|
106
|
+
<main id="content-inner" class="content-inner">
|
|
94
107
|
<%- body %>
|
|
95
|
-
</
|
|
108
|
+
</main>
|
|
96
109
|
</div>
|
|
97
110
|
</div>
|
|
98
111
|
|
|
99
|
-
<%-partial('
|
|
112
|
+
<%-partial('footer')%>
|
|
100
113
|
<div id="mask"></div>
|
|
101
|
-
<a id="back-to-top" href="#
|
|
114
|
+
<a id="back-to-top" href="# " title="back to top"></a>
|
|
102
115
|
<noscript id="noscript-styles"></noscript>
|
|
103
116
|
<% if(is_post()) { %>
|
|
104
117
|
<script src="<%=url_for(`/linen-theme/js/toc.js?v=${version}`)%>" defer></script>
|
|
@@ -118,7 +131,7 @@ const version = theme.version;
|
|
|
118
131
|
</script>
|
|
119
132
|
<% } %>
|
|
120
133
|
<% if (page.hdrSwitch) { %>
|
|
121
|
-
<script src="
|
|
134
|
+
<script src="<%=url_for(`/linen-theme/js/hdr.js?v=${version}`)%>"></script>
|
|
122
135
|
<% } %>
|
|
123
136
|
<% if (theme?.appends?.length > 0) { %>
|
|
124
137
|
<% theme.appends.forEach(appendItem => { %>
|
|
@@ -127,4 +140,4 @@ const version = theme.version;
|
|
|
127
140
|
<% } %>
|
|
128
141
|
</body>
|
|
129
142
|
|
|
130
|
-
</html>
|
|
143
|
+
</html>
|
|
@@ -3,7 +3,7 @@ const { hasTranslatation, targetLanguagePath, targetLanguage } = getTranslationP
|
|
|
3
3
|
|
|
4
4
|
const logoConfig = theme?.logo || {};
|
|
5
5
|
const { src: logoSrc, text: logoText, width: logoWidth, height: logoHeight } = logoConfig;
|
|
6
|
-
const rssPath =
|
|
6
|
+
const rssPath = config?.feed?.path || theme?.feed?.path;
|
|
7
7
|
%>
|
|
8
8
|
|
|
9
9
|
<% if (is_post()) { %>
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<div class="post-item" href="<%=url_for(post.path)%>" onclick="onclickPostItem(this)">
|
|
2
2
|
<div class="item-body">
|
|
3
|
+
<% if (post.thumbnail || post.cover) { %>
|
|
4
|
+
<div class="cover-img">
|
|
5
|
+
<img src="<%=url_for(post.thumbnail || post.cover)%>" alt="" loading="lazy" />
|
|
6
|
+
</div>
|
|
7
|
+
<% } %>
|
|
3
8
|
<div class="title-excerpt">
|
|
4
9
|
<div class="title-excerpt-text">
|
|
5
10
|
<a class="title" href="<%=url_for(post.path)%>" onclick="event.stopPropagation()"><%=post.title%><% if (post.subTitle) { %><span class="sub-title"><%=post.subTitle%></span><% } %></a>
|
|
@@ -26,10 +31,5 @@
|
|
|
26
31
|
<span class="read-time"><%-partial('partials/words', { post, count: false, readTime: true })%></span>
|
|
27
32
|
</div>
|
|
28
33
|
</div>
|
|
29
|
-
<% if (post.thumbnail || post.cover) { %>
|
|
30
|
-
<div class="cover-img">
|
|
31
|
-
<img src="<%=url_for(post.thumbnail || post.cover)%>" alt="" loading="lazy" />
|
|
32
|
-
</div>
|
|
33
|
-
<% } %>
|
|
34
34
|
</div>
|
|
35
35
|
</div>
|
|
@@ -15,7 +15,7 @@ const relatedPosts = site.posts.filter(item=>item.source !== page.source).filter
|
|
|
15
15
|
<div id="related-posts">
|
|
16
16
|
<div class="related-posts-title"><%=__('common.relatedPosts')%></div>
|
|
17
17
|
<% relatedPosts.each(post => {
|
|
18
|
-
const coverImg = post.thumbnail || post.cover || '
|
|
18
|
+
const coverImg = post.thumbnail || post.cover || url_for('/linen-theme/img/related-post.jpg')
|
|
19
19
|
%>
|
|
20
20
|
<a href="<%=url_for(post.path)%>">
|
|
21
21
|
<div class="shared-link">
|