Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
wintbiit committed Oct 15, 2023
0 parents commit dfdd655
Show file tree
Hide file tree
Showing 37 changed files with 7,116 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: docs

on:
push:
branches: [master]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
docs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: true

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm

- name: Build VuePress site
run: pnpm docs:build

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: '.vuepress/dist'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.idea/
node_modules/
/.vuepress/.cache/
/.vuepress/.temp/
/.vuepress/dist/
28 changes: 28 additions & 0 deletions .vuepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { defineUserConfig } from "vuepress";
import theme from "./theme.js";
import plugins from "./plugins.js";

export default defineUserConfig({
base: "/",

locales: {
"/": {
lang: "zh-CN",
title: "华工生存手册",
},
"/zh-Hant/": {
lang: "zh-TW",
title: "華工生存手冊",
},
"/en/": {
lang: "en-US",
title: "Survive in SCUT",
},
},

theme,

plugins,

shouldPrefetch: false,
});
18 changes: 18 additions & 0 deletions .vuepress/plugins.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { searchProPlugin } from "vuepress-plugin-search-pro";

export default [
searchProPlugin({
searchMaxSuggestions: 10,
indexContent: true,
customFields: [
{
getter: (page) => page.frontmatter.category,
formatter: "分类:$content",
},
{
getter: (page) => page.frontmatter.tag,
formatter: "标签:$content",
},
],
})
]
Binary file added .vuepress/public/assets/icon/guide-maskable.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .vuepress/public/assets/image/genshin.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .vuepress/public/favicon.ico
Binary file not shown.
Binary file added .vuepress/public/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions .vuepress/sidebar/en.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { sidebar } from "vuepress-theme-hope";

export const enSidebar = sidebar({
"/en/": [
{
prefix: "docs/",
link: "docs/",
children: [
"",
{
text: "Aspiration",
prefix: "ambition/",
link: "ambition/",
icon: "activity",
children: "structure"
},
{
text: "Newbee!!!",
prefix: "newbee/",
link: "newbee/",
icon: "launch",
children: "structure"
},
{
text: "About",
prefix: "about/",
link: "about/",
icon: "info",
children: "structure"
}
],
},
],
});
3 changes: 3 additions & 0 deletions .vuepress/sidebar/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from "./en.js";
export * from "./zh.js";
export * from "./zhHant.js";
34 changes: 34 additions & 0 deletions .vuepress/sidebar/zh.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { sidebar } from "vuepress-theme-hope";

export const zhSidebar = sidebar({
"/": [
{
prefix: "docs/",
link: "docs/",
children: [
"",
{
text: "立志篇",
prefix: "ambition/",
link: "ambition/",
icon: "activity",
children: "structure"
},
{
text: "致新生",
prefix: "newbee/",
link: "newbee/",
icon: "launch",
children: "structure"
},
{
text: "关于",
prefix: "about/",
link: "about/",
icon: "info",
children: "structure"
}
],
},
],
});
34 changes: 34 additions & 0 deletions .vuepress/sidebar/zhHant.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { sidebar } from "vuepress-theme-hope";

export const zhHantSidebar = sidebar({
"/zh-Hant/": [
{
prefix: "docs/",
link: "docs/",
children: [
"",
{
text: "立志篇",
prefix: "ambition/",
link: "ambition/",
icon: "activity",
children: "structure"
},
{
text: "致新生",
prefix: "newbee/",
link: "newbee/",
icon: "launch",
children: "structure"
},
{
text: "關於",
prefix: "about/",
link: "about/",
icon: "info",
children: "structure"
}
],
},
],
});
3 changes: 3 additions & 0 deletions .vuepress/styles/config.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// you can change config here
$colors: #c0392b, #d35400, #f39c12, #27ae60, #16a085, #2980b9, #8e44ad, #2c3e50,
#7f8c8d !default;
1 change: 1 addition & 0 deletions .vuepress/styles/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// place your custom styles here
6 changes: 6 additions & 0 deletions .vuepress/styles/palette.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// you can change colors here
$theme-color: #0AA7A0;
$bg-color: (
light: #EBEDF0,
dark: #19191A,
)
119 changes: 119 additions & 0 deletions .vuepress/theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
import { hopeTheme } from "vuepress-theme-hope";
import { enSidebar, zhSidebar, zhHantSidebar } from "./sidebar";

export default hopeTheme({
hostname: "https://scut.life",

iconAssets: "iconfont",

logo: "/logo.png",

repo: "scutrobotlab/Survive-in-SCUT",

docsDir: "src",

navbarAutoHide: "always",

navbarLayout: {
start: ["Brand", "Search"],
end: ["Language", "Outlook", "Repo"]
},

locales: {
"/": {
sidebar: zhSidebar,

displayFooter: false,
},

"/en/": {
sidebar: enSidebar,

displayFooter: false,
},

"/zh-Hant/": {
sidebar: zhHantSidebar,

displayFooter: false
}
},

plugins: {
// You should generate and use your own comment service
comment: {
provider: "Giscus",
repo: "vuepress-theme-hope/giscus-discussions",
repoId: "R_kgDOKgXN2w",
category: "Announcements",
categoryId: "DIC_kwDOKgXN284CaI5d",
},

// All features are enabled for demo, only preserve features you need here
mdEnhance: {
align: true,
attrs: true,
chart: true,
codetabs: true,
demo: true,
echarts: true,
figure: true,
flowchart: true,
gfm: true,
imgLazyload: true,
imgSize: true,
include: true,
katex: true,
mark: true,
mermaid: true,
playground: {
presets: ["ts", "vue"],
},
revealjs: {
plugins: ["highlight", "math", "search", "notes", "zoom"],
},
stylize: [
{
matcher: "Recommended",
replacer: ({ tag }) => {
if (tag === "em")
return {
tag: "Badge",
attrs: { type: "tip" },
content: "Recommended",
};
},
},
],
sub: true,
sup: true,
tabs: true,
vPre: true,
vuePlayground: true,
},

pwa: {
favicon: "/favicon.ico",
cacheHTML: true,
cachePic: true,
appendBase: true,
manifest: {
shortcuts: [
{
name: "华工生存手册",
short_name: "scut.life",
url: "/docs/",
icons: [
{
src: "/assets/icon/guide-maskable.png",
sizes: "192x192",
purpose: "maskable",
type: "image/png",
},
],
},
],
},
},
},
});
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
home: true
icon: home
title : "主页"
heroImage: /logo.png
heroFullScreen: true
heroText: 华工生存手册
tagline: 下一站 五山 / 大学城南
actions:
- text: "> 开始游戏 <"
link: ./docs/
type: primary

- text: 关于
link: ./about
---
4 changes: 4 additions & 0 deletions about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: 关于
icon: about
---
9 changes: 9 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: 华工生存手册
icon: home
---

## 前言
![](/assets/image/genshin.jpg)


3 changes: 3 additions & 0 deletions docs/about/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: 什么是华工生存手册
---
Loading

0 comments on commit dfdd655

Please sign in to comment.