Skip to content

Commit 7ddeb0f

Browse files
authored
Merge pull request #55 from f-dong/BUG修复
v1.4.4 全文搜索
2 parents b704d85 + 5c06e7f commit 7ddeb0f

File tree

17 files changed

+395
-12
lines changed

17 files changed

+395
-12
lines changed

_config.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ contact:
3333
zhihu:
3434
facebook:
3535
email:
36+
bluesky:
3637

3738
# 首页头像图片
3839
avatar: /images/avatar.png
@@ -90,3 +91,12 @@ cdn:
9091
enable: false
9192
# CDN 提供者
9293
provider: jsdelivr # 可选 jsdelivr、unpkg、bootcdn
94+
95+
search:
96+
enable: false # 是否启用搜索
97+
type: algolia # 可选:json 或 algolia
98+
placeholder: 输入关键词搜索...
99+
algolia:
100+
appID: ''
101+
apiKey: ''
102+
indexName: ''

layout/includes/footer.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<footer>
22
<div class="site-footer">
33
<div class="social-container">
4-
<% ['github', 'twitter', 'weibo', 'zhihu', 'facebook', 'email', 'rss'].forEach((item) => { %>
4+
<% ['github', 'twitter', 'weibo', 'zhihu', 'facebook', 'email', 'rss', 'bluesky'].forEach((item) => { %>
55
<% if (theme.contact[item]) { %>
66
<a aria-label="跳转至<%= item %>" href="<%= theme.contact[item] %>" target="_blank">
77
<i class="icon icon-<%= item %>"></i>

layout/includes/head.ejs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<%
2+
var lang = config.language || 'zh-CN';
23
var title = page.title;
34
// tags, categories, about pages title
45
if (title === 'tags') {
5-
title = '标签 | '+ config.title;
6+
title = lang === 'en' ? 'Tags | ' + config.title : '标签 | ' + config.title;
67
} else if (title === 'categories') {
7-
title = '分类归档 | '+ config.title;
8+
title = lang === 'en' ? 'Categories | ' + config.title : '分类归档 | ' + config.title;
89
} else if (title === 'about') {
9-
title = '关于 | '+ config.title;
10+
title = lang === 'en' ? 'About | ' + config.title : '关于 | ' + config.title;
1011
} else if (!title) {
1112
title = config.title;
1213
}

layout/includes/post-list.ejs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@
3838

3939
<% if (page.total > 1) { %>
4040
<div class="pagination-container">
41+
<% var lang = config.language || 'zh-CN'; %>
4142
<% if (page.prev) { %>
42-
<a href="<%- url_for(page.prev_link) %>" class="prev"><i class="icon icon-arrow-ios-back-outline"></i> 上一页</a>
43+
<a href="<%- url_for(page.prev_link) %>" class="prev"><i class="icon icon-arrow-ios-back-outline"></i> <%= lang === 'en' ? 'Prev' : '上一页' %></a>
4344
<% } %>
4445
<% if (page.next) { %>
45-
<a href="<%- url_for(page.next_link) %>" class="next">下一页 <i class="icon icon-arrow-ios-forward-outline"></i></a>
46+
<a href="<%- url_for(page.next_link) %>" class="next"><%= lang === 'en' ? 'Next' : '下一页' %> <i class="icon icon-arrow-ios-forward-outline"></i></a>
4647
<% } %>
4748
</div>
4849
<% } %>

layout/post.ejs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
<div class="next-post">
4040
<a class="purple-link" href="<%- url_for(page.next.path) %>">
4141
<h3 class="post-title">
42-
下一篇:<%= page.next.title %>
42+
<% var lang = config.language || 'zh-CN'; %>
43+
<%= lang === 'en' ? 'Next post: ' : '下一篇:' %><%= page.next.title %>
4344
</h3>
4445
</a>
4546
</div>

layout/tags.ejs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
<div class="content-container">
44

55
<div class="tags-container">
6+
<% var lang = config.language || 'zh-CN'; %>
67
<% if (site.tags.length <= 0) { %>
7-
<a class="tag" href="">暂无标签</a>
8+
<a class="tag" href=""><%= lang === 'en' ? 'No tags yet' : '暂无标签' %></a>
89
<% } %>
910
<% site.tags.forEach((tag) => { %>
1011
<a class="tag" href="<%= url_for(tag.path) %>"><%= tag.name %></a>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hexo-theme-minimalism",
3-
"version": "1.4.3",
3+
"version": "1.4.4",
44
"private": false,
55
"description": "a minimalist Hexo theme that is simple yet elegant, enabling your blog content to shine. Its powerful features also help you create a personalized blog that truly stands out.",
66
"scripts": {

scripts/helper/export-config.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@ hexo.extend.helper.register('export_config', function() {
99

1010
const {theme} = this;
1111

12-
const { image } = Object.assign({image: {
12+
const { image, search } = Object.assign({image: {
1313
lazyload_enable: true,
1414
photo_zoom: 'simple-lightbox'
15-
}}, theme.config);
15+
}, search: {
16+
enable: false
17+
}}, theme);
1618

1719
const theme_config = {
18-
image: image
20+
image: image,
21+
search: search,
22+
language: this.config.language
1923
};
2024

2125
const script = `<script id="hexo-configurations">

source/fonts/iconfont.eot

296 Bytes
Binary file not shown.

source/fonts/iconfont.svg

Lines changed: 2 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)