Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Commit

Permalink
docs: 英文文档框架
Browse files Browse the repository at this point in the history
  • Loading branch information
zkz098 committed Dec 22, 2023
1 parent de5dd69 commit a4a8ab2
Show file tree
Hide file tree
Showing 7 changed files with 148 additions and 4 deletions.
15 changes: 14 additions & 1 deletion docs/.vuepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { googleAnalyticsPlugin } from '@vuepress/plugin-google-analytics'
import { viteBundler } from 'vuepress'
import theme from "./theme";
export default defineUserConfig({

plugins: [
docsearchPlugin({
apiKey: 'c30c4d59605d21483f6b76cdde63ce96',
Expand Down Expand Up @@ -32,5 +33,17 @@ export default defineUserConfig({
cssMinify: "lightningcss"
}
}
})
}),
locales: {
'/': {
lang: "zh-CN",
title: "Hexo-theme-ShokaX",
description: '基于 shoka 的高度可定制现代hexo主题,简洁、高效、易用。'
},
'/en/': {
lang: "en-US",
title: "Hexo-theme-ShokaX",
description: 'Shoka-based highly customizable modern Hexo theme that is clean, efficient, and easy to use.'
}
}
})
32 changes: 32 additions & 0 deletions docs/.vuepress/nav/navbar-en.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
export default [
{
text: 'Home',
link: '/en/',
icon: 'home'
},
{
text: 'About',
link: '/en/about',
icon: "user"
},
{
text: 'User Guide',
link: '/en/guide/',
icon: "book"
},
{
text: 'Development Guide',
link: '/en/develop/basic/',
icon: "code"
},
{
text: 'API Guide',
link: '/en/develop/interface/',
icon: "plug"
},
{
text: 'Changelog',
link: '/en/changelog',
icon: "newspaper"
}
]
50 changes: 50 additions & 0 deletions docs/.vuepress/nav/sidebar-en.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
export default {
'/guide/': [
{
text: "User Guide",
collapsible: true,
children: [
{text: "Quick Start", link: "/guide/"},
{text: "More Configurations", link: "/guide/config.html"},
{text: "Theme Configuration", link: "/guide/theme.html"},
{text: "Comment System", link: "/guide/comment.html"},
{text: "Content Modules", link: "/guide/tags.html"},
{text: "Error Codes", link: "/guide/error-code.html"}
]
},
{
text: "Migration Guide",
collapsible: true,
children: [
{text: "Migrating from Shoka", link: "/guide/shoka.html"}
]
},
{
text: "Best Practices",
collapsible: true,
children: [
{text: "Performance Optimization", link: "/guide/performance.html"}
]
}
],
'/develop/': [
{
text: "Development Guide",
collapsible: true,
children: [
{text: "Quick Start", link: "/develop/basic/"},
{text: "Writing Plugins", link: "/develop/basic/plugin.html"}
]
},
{
text: "API Guide",
collapsible: true,
children: [
{text: "Glossary and Explanation", link: "/develop/interface/"},
{text: "DOM Helper Functions", link: "/develop/interface/dom.html"},
{text: "Storage Helper Functions", link: "/develop/interface/storage.html"},
{text: "Theme ShokaX Anime", link: "/develop/interface/anime.html"}
]
}
]
}
14 changes: 12 additions & 2 deletions docs/.vuepress/theme.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
import { hopeTheme } from "vuepress-theme-hope";
import navbar from './nav/navbar'
import sidebar from './nav/sidebar'
import navbarEn from './nav/navbar-en'
import sidebarEn from './nav/sidebar-en'

export default hopeTheme({
locales: {
'/': {
sidebar: sidebar,
navbar: navbar,
},
'/en/': {
navbar: navbarEn,
sidebar: sidebarEn
}
},
displayFooter: true,
footer: "<a href=\"https://beian.miit.gov.cn/\" target=\"_blank\">津ICP备2022001375号</a>",
sidebar: sidebar,
navbar: navbar,
hostname: "docs.kaitaku.xyz",
plugins: {
mdEnhance: {
Expand Down
33 changes: 33 additions & 0 deletions docs/en/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
home: true

heroText: ShokaX
tagline: Highly customizable Hexo theme that sets your blog apart
actions:
- type: primary
text: Quick Start
link: /guide/
- type: secondary
text: Custom Development
link: /develop/basic/

features:
- title: Easy to Use
details: ShokaX provides an installation CLI to simplify the setup process, ensuring that theme installation is no longer a stumbling block for new website owners.
icon: boxes-stacked
- title: Performance Improvement
details: ShokaX, through code and third-party resource optimization, reduces loading times by around 40% compared to Shoka.
icon: gears
- title: Scalability & Customization Friendly
details: ShokaX solves upgrade issues post-theme customization via InjectAPI and introduces a community plugin system.
icon: plug
- title: Developer-Friendly
details: ShokaX leverages TypeScript for enhanced type hinting, along with comprehensive comments and development documentation.
icon: code
- title: Easy Migration
details: Migrating from Shoka to ShokaX is relatively straightforward, requiring modifications to a few configurations and a reinstallation of npm packages.
icon: truck-fast
- title: Rich Functionality
details: ShokaX offers out-of-the-box features like native PWA, multiple comment systems, and various widgets.
icon: toolbox
---
5 changes: 5 additions & 0 deletions docs/guide/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,23 @@
:::

## 文件压缩

:::warning
如果您正在使用 0.1.8 或更低版本的 MD 渲染器,那么文件压缩不适用
:::

建议使用 [hexo-lightning-minify](https://github.com/theme-shoka-x/hexo-lightning-minify),由 ShokaX 开发,安装方式:

```shell
pnpm add hexo-lightning-minify
```

:::tip
使用 SXC core 0.3+(预计2024年1月发布)时此插件会和markdown渲染核心捆绑安装
:::

配置如下:

```yaml
minify:
js:
Expand All @@ -44,6 +48,7 @@ minify:
# 我们更建议使用 Service Worker 来在用户侧实现 replaceSrc 的功能,这将能够以一种侵入式更小的方式实现链接替换
exclude:
```
自动 WebP 化功能在初次`hexo g`或`hexo cl`后不可用,需要再运行一次`hexo g`

## feed 生成
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "index.js",
"scripts": {
"docs:dev": "vuepress dev docs",
"docs:build": "vuepress build docs"
"docs:build": "vuepress build docs",
"lint": "markdownlint-cli2 \"**/*.md\" \"#node_modules\" --fix"
},
"keywords": [],
"author": "zkz098",
Expand Down

0 comments on commit a4a8ab2

Please sign in to comment.