diff --git a/.gitignore b/.gitignore index e800261..b96f69e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,23 @@ *.suo *.user *.userossc -*.sln.docstates \ No newline at end of file +*.sln.docstates + +# Ignore OS hidden files +.DS_Store +.DS_Store? + +# Ignore node modules +node_modules +.npmrc +pnpm-lock.yaml +package-lock.json +yarn.lock + +*.log + +# Ignore build files +build/ +dist/ +docs/.vitepress/dist +docs/.vitepress/cache \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 41da2d3..1438490 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,8 +11,9 @@ include: stages: - test - auto-update + - build-web -auto_update: +auto-update: # 需要配置 REPO_TOKEN 和 THE_REPO stage: auto-update image: python:3.9 @@ -28,4 +29,20 @@ auto_update: # 安装 PyYAML 用于解析 list.yaml - pip install pyyaml # 运行更新脚本 - - python update_files.py \ No newline at end of file + - python update_files.py + +# build-web: +# stage: build-web +# image: node:22.14.0 +# rules: +# # 当非 定时触发 且位于 main 分支时执行。 +# - if: '$CI_COMMIT_BRANCH == "main" && $CI_PIPELINE_SOURCE != "schedule"' +# before_script: +# - npm config set registry https://registry.npmmirror.com # 设置淘宝镜像 +# script: +# - npm install +# - echo "📦 开始构建 ···" +# - npm run docs:build +# artifacts: +# paths: +# - $BUILD_DIR \ No newline at end of file diff --git a/docker/README.md b/docker/README.md index eb22cc3..94ef875 100644 --- a/docker/README.md +++ b/docker/README.md @@ -16,13 +16,13 @@ Docker 提供了一个自动配置与安装的脚本,支持 Debian、RHEL、SU 使用 curl ```bash - curl -fsSL https://git.sugarscat.cn/me/bash/-/raw/main/docker/install.sh | sh + curl -fsSL https://git.sugarscat.cn/me/bash/-/raw/main/docker/install/install.sh | sh ``` 使用 wget ```bash - wget -O- https://git.sugarscat.cn/me/bash/-/raw/main/docker/install.sh | sh + wget -O- https://git.sugarscat.cn/me/bash/-/raw/main/docker/install/install.sh | sh ``` ## Debian/Ubuntu/Raspbian @@ -48,7 +48,7 @@ apt-get install ca-certificates curl gnupg ```bash install -m 0755 -d /etc/apt/keyrings -curl -fsSL https://git.sugarscat.cn/me/bash/-/raw/main/docker/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg +curl -fsSL https://git.sugarscat.cn/me/bash/-/raw/main/docker/install/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg sudo chmod a+r /etc/apt/keyrings/docker.gpg echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/debian \ @@ -60,7 +60,7 @@ echo \ ```bash install -m 0755 -d /etc/apt/keyrings -curl -fsSL https://git.sugarscat.cn/me/bash/-/raw/main/docker/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg +curl -fsSL https://git.sugarscat.cn/me/bash/-/raw/main/docker/install/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg sudo chmod a+r /etc/apt/keyrings/docker.gpg echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/debian \ @@ -72,7 +72,7 @@ echo \ ```bash install -m 0755 -d /etc/apt/keyrings -curl -fsSL https://git.sugarscat.cn/me/bash/-/raw/main/docker/raspbian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg +curl -fsSL https://git.sugarscat.cn/me/bash/-/raw/main/docker/install/raspbian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg sudo chmod a+r /etc/apt/keyrings/docker.gpg echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/debian \ @@ -108,7 +108,7 @@ dnf remove docker \ ```bash dnf -y install dnf-plugins-core -dnf config-manager --add-repo https://git.sugarscat.cn/me/bash/-/raw/main/docker/fedora/docker-ce.repo +dnf config-manager --add-repo https://git.sugarscat.cn/me/bash/-/raw/main/docker/install/fedora/docker-ce.repo sed -i 's+https://download.docker.com+https://mirrors.tuna.tsinghua.edu.cn/docker-ce+' /etc/yum.repos.d/docker-ce.repo ``` @@ -137,7 +137,7 @@ yum remove docker \ ```bash yum install -y yum-utils -yum-config-manager --add-repo https://git.sugarscat.cn/me/bash/-/raw/main/docker/centos/docker-ce.repo +yum-config-manager --add-repo https://git.sugarscat.cn/me/bash/-/raw/main/docker/install/centos/docker-ce.repo sed -i 's+https://download.docker.com+https://mirrors.tuna.tsinghua.edu.cn/docker-ce+' /etc/yum.repos.d/docker-ce.repo ``` diff --git a/docker-compose/README.md b/docker/docker-compose/README.md similarity index 100% rename from docker-compose/README.md rename to docker/docker-compose/README.md diff --git a/docker-compose/clash/README.md b/docker/docker-compose/clash/README.md similarity index 69% rename from docker-compose/clash/README.md rename to docker/docker-compose/clash/README.md index 65d54f8..595f720 100644 --- a/docker-compose/clash/README.md +++ b/docker/docker-compose/clash/README.md @@ -11,7 +11,7 @@ mkdir -p /opt/docker/clash && mkdir -p /opt/docker/clash/data && cd /opt/docker/ 下载 docker-compose.yml ```bash -curl -fsSL https://git.sugarscat.cn/me/bash/-/raw/main/clash/docker-compose.yml > docker-compose.yml +curl -fsSL https://git.sugarscat.cn/me/bash/-/raw/main/docker/docker-compose/docker-compose.yml > docker-compose.yml ``` 启动 diff --git a/docker-compose/clash/docker-compose.yml b/docker/docker-compose/clash/docker-compose.yml similarity index 100% rename from docker-compose/clash/docker-compose.yml rename to docker/docker-compose/clash/docker-compose.yml diff --git a/docker-compose/frps/.env b/docker/docker-compose/frps/.env similarity index 100% rename from docker-compose/frps/.env rename to docker/docker-compose/frps/.env diff --git a/docker-compose/frps/README.md b/docker/docker-compose/frps/README.md similarity index 54% rename from docker-compose/frps/README.md rename to docker/docker-compose/frps/README.md index a04002a..a1e728c 100644 --- a/docker-compose/frps/README.md +++ b/docker/docker-compose/frps/README.md @@ -9,13 +9,13 @@ mkdir -p /opt/docker/frps && mkdir -p /opt/docker/frps/data && cd /opt/docker/fr 下载 `.env` 文件 ```bash -curl -fsSL https://git.sugarscat.cn/me/bash/-/raw/main/frps/.env > .env +curl -fsSL https://git.sugarscat.cn/me/bash/-/raw/main/docker/docker-compose/.env > .env ``` 下载 docker-compose.yml ```bash -curl -fsSL https://git.sugarscat.cn/me/bash/-/raw/main/frps/docker-compose.yml > docker-compose.yml +curl -fsSL https://git.sugarscat.cn/me/bash/-/raw/main/docker/docker-compose/docker-compose.yml > docker-compose.yml ``` 启动 diff --git a/docker-compose/frps/docker-compose.yml b/docker/docker-compose/frps/docker-compose.yml similarity index 100% rename from docker-compose/frps/docker-compose.yml rename to docker/docker-compose/frps/docker-compose.yml diff --git a/docker-compose/frps/install.sh b/docker/docker-compose/frps/install.sh similarity index 100% rename from docker-compose/frps/install.sh rename to docker/docker-compose/frps/install.sh diff --git a/docker-compose/frps/scripts/init.sh b/docker/docker-compose/frps/scripts/init.sh similarity index 100% rename from docker-compose/frps/scripts/init.sh rename to docker/docker-compose/frps/scripts/init.sh diff --git a/docker/centos/docker-ce.repo b/docker/install/centos/docker-ce.repo similarity index 100% rename from docker/centos/docker-ce.repo rename to docker/install/centos/docker-ce.repo diff --git a/docker/debian/gpg b/docker/install/debian/gpg similarity index 100% rename from docker/debian/gpg rename to docker/install/debian/gpg diff --git a/docker/fedora/docker-ce.repo b/docker/install/fedora/docker-ce.repo similarity index 100% rename from docker/fedora/docker-ce.repo rename to docker/install/fedora/docker-ce.repo diff --git a/docker/install.sh b/docker/install/install.sh similarity index 100% rename from docker/install.sh rename to docker/install/install.sh diff --git a/docker/raspbian/gpg b/docker/install/raspbian/gpg similarity index 100% rename from docker/raspbian/gpg rename to docker/install/raspbian/gpg diff --git a/docker/ubuntu/gpg b/docker/install/ubuntu/gpg similarity index 100% rename from docker/ubuntu/gpg rename to docker/install/ubuntu/gpg diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts new file mode 100644 index 0000000..420aa05 --- /dev/null +++ b/docs/.vitepress/config.mts @@ -0,0 +1,28 @@ +import { defineConfig } from 'vitepress' + +// https://vitepress.dev/reference/site-config +export default defineConfig({ + title: "Bash", + description: "My Bash!", + themeConfig: { + // https://vitepress.dev/reference/default-theme-config + nav: [ + { text: 'Home', link: '/' }, + { text: 'Examples', link: '/markdown-examples' } + ], + + sidebar: [ + { + text: 'Examples', + items: [ + { text: 'Markdown Examples', link: '/markdown-examples' }, + { text: 'Runtime API Examples', link: '/api-examples' } + ] + } + ], + + socialLinks: [ + { icon: 'github', link: 'https://github.com/vuejs/vitepress' } + ] + } +}) diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts new file mode 100644 index 0000000..def4cfc --- /dev/null +++ b/docs/.vitepress/theme/index.ts @@ -0,0 +1,17 @@ +// https://vitepress.dev/guide/custom-theme +import { h } from 'vue' +import type { Theme } from 'vitepress' +import DefaultTheme from 'vitepress/theme' +import './style.css' + +export default { + extends: DefaultTheme, + Layout: () => { + return h(DefaultTheme.Layout, null, { + // https://vitepress.dev/guide/extending-default-theme#layout-slots + }) + }, + enhanceApp({ app, router, siteData }) { + // ... + } +} satisfies Theme diff --git a/docs/.vitepress/theme/style.css b/docs/.vitepress/theme/style.css new file mode 100644 index 0000000..1a61cb1 --- /dev/null +++ b/docs/.vitepress/theme/style.css @@ -0,0 +1,139 @@ +/** + * Customize default theme styling by overriding CSS variables: + * https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/vars.css + */ + +/** + * Colors + * + * Each colors have exact same color scale system with 3 levels of solid + * colors with different brightness, and 1 soft color. + * + * - `XXX-1`: The most solid color used mainly for colored text. It must + * satisfy the contrast ratio against when used on top of `XXX-soft`. + * + * - `XXX-2`: The color used mainly for hover state of the button. + * + * - `XXX-3`: The color for solid background, such as bg color of the button. + * It must satisfy the contrast ratio with pure white (#ffffff) text on + * top of it. + * + * - `XXX-soft`: The color used for subtle background such as custom container + * or badges. It must satisfy the contrast ratio when putting `XXX-1` colors + * on top of it. + * + * The soft color must be semi transparent alpha channel. This is crucial + * because it allows adding multiple "soft" colors on top of each other + * to create a accent, such as when having inline code block inside + * custom containers. + * + * - `default`: The color used purely for subtle indication without any + * special meanings attached to it such as bg color for menu hover state. + * + * - `brand`: Used for primary brand colors, such as link text, button with + * brand theme, etc. + * + * - `tip`: Used to indicate useful information. The default theme uses the + * brand color for this by default. + * + * - `warning`: Used to indicate warning to the users. Used in custom + * container, badges, etc. + * + * - `danger`: Used to show error, or dangerous message to the users. Used + * in custom container, badges, etc. + * -------------------------------------------------------------------------- */ + +:root { + --vp-c-default-1: var(--vp-c-gray-1); + --vp-c-default-2: var(--vp-c-gray-2); + --vp-c-default-3: var(--vp-c-gray-3); + --vp-c-default-soft: var(--vp-c-gray-soft); + + --vp-c-brand-1: var(--vp-c-indigo-1); + --vp-c-brand-2: var(--vp-c-indigo-2); + --vp-c-brand-3: var(--vp-c-indigo-3); + --vp-c-brand-soft: var(--vp-c-indigo-soft); + + --vp-c-tip-1: var(--vp-c-brand-1); + --vp-c-tip-2: var(--vp-c-brand-2); + --vp-c-tip-3: var(--vp-c-brand-3); + --vp-c-tip-soft: var(--vp-c-brand-soft); + + --vp-c-warning-1: var(--vp-c-yellow-1); + --vp-c-warning-2: var(--vp-c-yellow-2); + --vp-c-warning-3: var(--vp-c-yellow-3); + --vp-c-warning-soft: var(--vp-c-yellow-soft); + + --vp-c-danger-1: var(--vp-c-red-1); + --vp-c-danger-2: var(--vp-c-red-2); + --vp-c-danger-3: var(--vp-c-red-3); + --vp-c-danger-soft: var(--vp-c-red-soft); +} + +/** + * Component: Button + * -------------------------------------------------------------------------- */ + +:root { + --vp-button-brand-border: transparent; + --vp-button-brand-text: var(--vp-c-white); + --vp-button-brand-bg: var(--vp-c-brand-3); + --vp-button-brand-hover-border: transparent; + --vp-button-brand-hover-text: var(--vp-c-white); + --vp-button-brand-hover-bg: var(--vp-c-brand-2); + --vp-button-brand-active-border: transparent; + --vp-button-brand-active-text: var(--vp-c-white); + --vp-button-brand-active-bg: var(--vp-c-brand-1); +} + +/** + * Component: Home + * -------------------------------------------------------------------------- */ + +:root { + --vp-home-hero-name-color: transparent; + --vp-home-hero-name-background: -webkit-linear-gradient( + 120deg, + #bd34fe 30%, + #41d1ff + ); + + --vp-home-hero-image-background-image: linear-gradient( + -45deg, + #bd34fe 50%, + #47caff 50% + ); + --vp-home-hero-image-filter: blur(44px); +} + +@media (min-width: 640px) { + :root { + --vp-home-hero-image-filter: blur(56px); + } +} + +@media (min-width: 960px) { + :root { + --vp-home-hero-image-filter: blur(68px); + } +} + +/** + * Component: Custom Block + * -------------------------------------------------------------------------- */ + +:root { + --vp-custom-block-tip-border: transparent; + --vp-custom-block-tip-text: var(--vp-c-text-1); + --vp-custom-block-tip-bg: var(--vp-c-brand-soft); + --vp-custom-block-tip-code-bg: var(--vp-c-brand-soft); +} + +/** + * Component: Algolia + * -------------------------------------------------------------------------- */ + +.DocSearch { + --docsearch-primary-color: var(--vp-c-brand-1) !important; +} + diff --git a/docs/api-examples.md b/docs/api-examples.md new file mode 100644 index 0000000..6bd8bb5 --- /dev/null +++ b/docs/api-examples.md @@ -0,0 +1,49 @@ +--- +outline: deep +--- + +# Runtime API Examples + +This page demonstrates usage of some of the runtime APIs provided by VitePress. + +The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files: + +```md + + +## Results + +### Theme Data +
{{ theme }}
+
+### Page Data
+{{ page }}
+
+### Page Frontmatter
+{{ frontmatter }}
+```
+
+
+
+## Results
+
+### Theme Data
+{{ theme }}
+
+### Page Data
+{{ page }}
+
+### Page Frontmatter
+{{ frontmatter }}
+
+## More
+
+Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata).
diff --git a/docs/index.md b/docs/index.md
new file mode 100644
index 0000000..8c2678a
--- /dev/null
+++ b/docs/index.md
@@ -0,0 +1,25 @@
+---
+# https://vitepress.dev/reference/default-theme-home-page
+layout: home
+
+hero:
+ name: "Bash"
+ text: "My Bash!"
+ tagline: My great project tagline
+ actions:
+ - theme: brand
+ text: Markdown Examples
+ link: /markdown-examples
+ - theme: alt
+ text: API Examples
+ link: /api-examples
+
+features:
+ - title: Feature A
+ details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
+ - title: Feature B
+ details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
+ - title: Feature C
+ details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
+---
+
diff --git a/docs/markdown-examples.md b/docs/markdown-examples.md
new file mode 100644
index 0000000..f9258a5
--- /dev/null
+++ b/docs/markdown-examples.md
@@ -0,0 +1,85 @@
+# Markdown Extension Examples
+
+This page demonstrates some of the built-in markdown extensions provided by VitePress.
+
+## Syntax Highlighting
+
+VitePress provides Syntax Highlighting powered by [Shiki](https://github.com/shikijs/shiki), with additional features like line-highlighting:
+
+**Input**
+
+````md
+```js{4}
+export default {
+ data () {
+ return {
+ msg: 'Highlighted!'
+ }
+ }
+}
+```
+````
+
+**Output**
+
+```js{4}
+export default {
+ data () {
+ return {
+ msg: 'Highlighted!'
+ }
+ }
+}
+```
+
+## Custom Containers
+
+**Input**
+
+```md
+::: info
+This is an info box.
+:::
+
+::: tip
+This is a tip.
+:::
+
+::: warning
+This is a warning.
+:::
+
+::: danger
+This is a dangerous warning.
+:::
+
+::: details
+This is a details block.
+:::
+```
+
+**Output**
+
+::: info
+This is an info box.
+:::
+
+::: tip
+This is a tip.
+:::
+
+::: warning
+This is a warning.
+:::
+
+::: danger
+This is a dangerous warning.
+:::
+
+::: details
+This is a details block.
+:::
+
+## More
+
+Check out the documentation for the [full list of markdown extensions](https://vitepress.dev/guide/markdown).
diff --git a/list.yaml b/list.yaml
index 51dedd9..478c013 100644
--- a/list.yaml
+++ b/list.yaml
@@ -1,13 +1,13 @@
# 需要自动更新的文件列表
-- file: /docker/install.sh
+- file: /docker/install/install.sh
source: https://raw.githubusercontent.com/docker/docker-install/master/install.sh
-- file: /docker/debian/gpg
+- file: /docker/install/debian/gpg
source: https://download.docker.com/linux/debian/gpg
-- file: /docker/ubuntu/gpg
+- file: /docker/install/ubuntu/gpg
source: https://download.docker.com/linux/ubuntu/gpg
-- file: /docker/raspbian/gpg
+- file: /docker/install/raspbian/gpg
source: https://download.docker.com/linux/raspbian/gpg
-- file: /docker/fedora/docker-ce.repo
+- file: /docker/install/fedora/docker-ce.repo
source: https://download.docker.com/linux/fedora/docker-ce.repo
-- file: /docker/centos/docker-ce.repo
+- file: /docker/install/centos/docker-ce.repo
source: https://download.docker.com/linux/centos/docker-ce.repo
\ No newline at end of file
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..a8772d3
--- /dev/null
+++ b/package.json
@@ -0,0 +1,12 @@
+{
+ "devDependencies": {
+ "vitepress": "^1.6.3",
+ "vue": "^3.5.13"
+ },
+ "packageManager": "pnpm@10.6.4+sha512.da3d715bfd22a9a105e6e8088cfc7826699332ded60c423b14ec613a185f1602206702ff0fe4c438cb15c979081ce4cb02568e364b15174503a63c7a8e2a5f6c",
+ "scripts": {
+ "docs:dev": "vitepress dev docs",
+ "docs:build": "vitepress build docs",
+ "docs:preview": "vitepress preview docs"
+ }
+}
\ No newline at end of file