hexo-theme-linen 1.0.10 → 1.0.12
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/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# hexo-theme-linen
|
|
2
|
+
|
|
3
|
+
A clean Hexo theme focused on readability, UX, and minimal configuration.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- Elegant and minimal design
|
|
10
|
+
- Responsive layout
|
|
11
|
+
- Optimized typography
|
|
12
|
+
- Customizable navigation
|
|
13
|
+
- Supports tags, categories, archives, and series
|
|
14
|
+
- Fast build and lightweight assets(without plugins)
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pnpm add hexo-theme-linen
|
|
20
|
+
# or
|
|
21
|
+
npm install hexo-theme-linen
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
Edit your Hexo `_config.yml`:
|
|
27
|
+
|
|
28
|
+
```yaml
|
|
29
|
+
theme: linen
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Then start Hexo:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
hexo clean && hexo serve
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Documentation
|
|
39
|
+
|
|
40
|
+
Full documentation and examples:
|
|
41
|
+
|
|
42
|
+
https://lynanbreeze.github.io/hexo-theme-linen-doc-zh-CN/
|
|
43
|
+
|
|
44
|
+
## License
|
|
45
|
+
|
|
46
|
+
MIT
|
|
@@ -7,4 +7,4 @@ var pageTitle = getPageTitle();
|
|
|
7
7
|
<meta property="og:site_name" content="<%=config.title%>">
|
|
8
8
|
<meta property="og:description" content="<%=page?.seriesInfo?.description||page.excerpt||''%>">
|
|
9
9
|
<meta property="og:locale" content="<%=page.language||config.language%>">
|
|
10
|
-
<meta property="og:image" content="<%=page.seriesInfo?.cover||page.ogImage||page.cover||theme?.info?.siteCardBg||''%>">
|
|
10
|
+
<meta property="og:image" content="<%=url_for(page.seriesInfo?.cover||page.ogImage||page.cover||theme?.info?.siteCardBg||'')%>">
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hexo-theme-linen",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"description": "A clean Hexo theme",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"homepage": "https://github.com/lynanbreeze/hexo-theme-linen",
|
|
6
7
|
"repository": {
|
|
7
8
|
"type": "git",
|
|
8
9
|
"url": "https://github.com/LynanBreeze/hexo-theme-linen.git"
|
package/scripts/helpers/tools.js
CHANGED
|
@@ -53,6 +53,7 @@ hexo.extend.helper.register("take", function (arr, n = 1) {
|
|
|
53
53
|
try {
|
|
54
54
|
const page = this.page;
|
|
55
55
|
const config = this.config;
|
|
56
|
+
const rootPath = config.root || "/";
|
|
56
57
|
const translations = page.translations || [];
|
|
57
58
|
const currentLanguage = page.language || config.language;
|
|
58
59
|
const targetLanguage =
|
|
@@ -79,26 +80,27 @@ hexo.extend.helper.register("take", function (arr, n = 1) {
|
|
|
79
80
|
let origin =
|
|
80
81
|
config?.theme_config?.siteOriginLocaleMap?.[targetLanguage] ||
|
|
81
82
|
config.url;
|
|
82
|
-
let
|
|
83
|
+
let targetPath = this.url_for(page.path);
|
|
83
84
|
if (page?.seriesInfo?.mappingName) {
|
|
84
|
-
|
|
85
|
+
targetPath = this.url_for(`/series/${page?.seriesInfo?.mappingName}/`);
|
|
85
86
|
}
|
|
86
87
|
if (this.is_category()) {
|
|
87
88
|
if (categoriesInfo?.[page.category]?.mappingName) {
|
|
88
|
-
|
|
89
|
+
targetPath = this.url_for(`/categories/${
|
|
89
90
|
categoriesInfo?.[page.category]?.mappingName
|
|
90
|
-
}
|
|
91
|
+
}/`);
|
|
91
92
|
} else {
|
|
92
93
|
hasTranslatation = false;
|
|
93
94
|
}
|
|
94
95
|
}
|
|
95
96
|
if (this.is_tag()) {
|
|
96
97
|
if (tagsInfo?.[page.tag]?.mappingName) {
|
|
97
|
-
|
|
98
|
+
targetPath = this.url_for(`/tags/${tagsInfo?.[page.tag]?.mappingName}/`);
|
|
98
99
|
} else {
|
|
99
100
|
hasTranslatation = false;
|
|
100
101
|
}
|
|
101
102
|
}
|
|
103
|
+
const targetLanguagePath = `${origin}${targetPath.replace(rootPath, "")}`;
|
|
102
104
|
return {
|
|
103
105
|
hasTranslatation,
|
|
104
106
|
targetLanguage,
|
package/scripts/rss.js
CHANGED
|
@@ -30,8 +30,6 @@ hexo.extend.generator.register("rss", function (locals) {
|
|
|
30
30
|
const getPostDate = hexo.extend.helper.get("getPostDate");
|
|
31
31
|
const cssUrl = url_for.bind(hexo)(`/linen-theme/css/rss-${language.startsWith("zh") ? "zh" : "en"}.xsl`);
|
|
32
32
|
|
|
33
|
-
console.log(cssUrl)
|
|
34
|
-
|
|
35
33
|
const feed = `<?xml version="1.0" encoding="UTF-8" ?>
|
|
36
34
|
<?xml-stylesheet type="text/xsl" href="${cssUrl}"?>
|
|
37
35
|
<rss version="2.0">
|