hexo-theme-linen 1.0.2 → 1.0.3
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/package.json +1 -1
- package/scripts/helpers/tools.js +1 -3
- package/scripts/rss.js +2 -1
package/package.json
CHANGED
package/scripts/helpers/tools.js
CHANGED
|
@@ -10,8 +10,7 @@ function getFile(filePath, defaultValue) {
|
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
hexo.extend.helper.register("take", function (arr, n = 1) {
|
|
13
|
+
hexo.extend.helper.register("take", function (arr, n = 1) {
|
|
15
14
|
return arr.slice(0, Math.max(0, n));
|
|
16
15
|
});
|
|
17
16
|
|
|
@@ -215,4 +214,3 @@ module.exports = (hexo) => {
|
|
|
215
214
|
|
|
216
215
|
return toc;
|
|
217
216
|
});
|
|
218
|
-
};
|
package/scripts/rss.js
CHANGED
|
@@ -27,6 +27,7 @@ hexo.extend.generator.register("rss", function (locals) {
|
|
|
27
27
|
const posts = locals.posts.sort("-date").limit(themeConfig?.feed?.limit ?? 10);
|
|
28
28
|
const config = hexo.config;
|
|
29
29
|
const language = config.language || "";
|
|
30
|
+
const getPostDate = hexo.extend.helper.get("getPostDate");
|
|
30
31
|
|
|
31
32
|
const feed = `<?xml version="1.0" encoding="UTF-8" ?>
|
|
32
33
|
<?xml-stylesheet type="text/xsl" href="/css/rss-${language.startsWith("zh") ? "zh" : "en"}.xsl"?>
|
|
@@ -74,7 +75,7 @@ hexo.extend.generator.register("rss", function (locals) {
|
|
|
74
75
|
<title>${escape(`${post.title}${post?.subTitle ? `(${post.subTitle})` : ""}`)}</title>
|
|
75
76
|
<link>${config.url + url_for.bind(hexo)(post.path)}</link>
|
|
76
77
|
<guid>${config.url + url_for.bind(hexo)(post.path)}</guid>
|
|
77
|
-
<pubDate>${
|
|
78
|
+
<pubDate>${getPostDate(post, language)}</pubDate>
|
|
78
79
|
<description><![CDATA[${rawHtml}]]></description>
|
|
79
80
|
</item>`;
|
|
80
81
|
})
|