Skip to content

Commit

Permalink
[skip ci] docs: use dumi
Browse files Browse the repository at this point in the history
  • Loading branch information
sylingd committed Mar 25, 2023
1 parent 3bd856f commit aff7f1e
Show file tree
Hide file tree
Showing 38 changed files with 295 additions and 233 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ jobs:
run: |
cd $GITHUB_WORKSPACE/docs
npm run build
cp $GITHUB_WORKSPACE/scripts/www/* $GITHUB_WORKSPACE/docs/.vuepress/dist/
cp $GITHUB_WORKSPACE/scripts/www/* $GITHUB_WORKSPACE/docs/dist/
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: docs/.vuepress/dist
folder: docs/dist
33 changes: 33 additions & 0 deletions docs/.dumi/theme/locales/zh-TW.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"header.search.placeholder": "输入关键字搜索...",
"header.color.mode.light": "亮色模式",
"header.color.mode.dark": "暗色模式",
"header.color.mode.auto": "跟随系统",
"header.social.github": "GitHub",
"header.social.weibo": "微博",
"header.social.twitter": "Twitter",
"header.social.gitlab": "GitLab",
"header.social.facebook": "Facebook",
"header.social.zhihu": "知乎",
"header.social.yuque": "语雀",
"header.social.linkedin": "Linkedin",
"previewer.actions.code.expand": "展开代码",
"previewer.actions.code.shrink": "收起代码",
"previewer.actions.codesandbox": "在 CodeSandbox 中打开",
"previewer.actions.codepen": "在 CodePen 中打开(未实现)",
"previewer.actions.stackblitz": "在 StackBlitz 中打开",
"previewer.actions.separate": "在独立页面中打开",
"404.title": "页面未找到",
"404.back": "返回首页",
"api.component.name": "属性名",
"api.component.description": "描述",
"api.component.type": "类型",
"api.component.default": "默认值",
"api.component.required": "(必选)",
"api.component.unavailable": "必须启用 apiParser 才能使用自动 API 特性",
"api.component.loading": "属性定义正在解析中,稍等片刻...",
"api.component.not.found": "未找到 {id} 组件的属性定义",
"content.tabs.default": "文档",
"search.not.found": "未找到相关内容",
"layout.sidebar.btn": "侧边菜单"
}
20 changes: 20 additions & 0 deletions docs/.dumirc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { defineConfig } from 'dumi';

export default defineConfig({
themeConfig: {
name: 'Header Editor',
logo: false,
footer: false,
socialLinks: {
github: 'https://github.com/FirefoxBar/HeaderEditor',
},
},
locales: [
{ id: 'zh-CN', name: '简体中文' },
{ id: 'en-US', name: 'English' },
{ id: 'zh-TW', name: '繁體中文' },
],
analytics: {
baidu: 'eddab75c23e1853a476011bb95a585c9',
}
});
5 changes: 4 additions & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
pnpm-lock.yaml
pnpm-lock.yaml
.dumi/tmp
.dumi/tmp-production
dist
47 changes: 0 additions & 47 deletions docs/.vuepress/config.js

This file was deleted.

22 changes: 0 additions & 22 deletions docs/.vuepress/locales/en.js

This file was deleted.

22 changes: 0 additions & 22 deletions docs/.vuepress/locales/zh-CN.js

This file was deleted.

21 changes: 0 additions & 21 deletions docs/.vuepress/locales/zh-TW.js

This file was deleted.

20 changes: 0 additions & 20 deletions docs/.vuepress/styles/index.styl

This file was deleted.

36 changes: 20 additions & 16 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
---
title: Header Editor
home: true
heroText: Header Editor
tagline: 一款修改请求的扩展
actionText: 开始使用
actionLink: /zh-CN/guide/
features:
- title: 修改请求
details: 基于规则,修改请求头、响应头,进行重定向。
- title: 自定义函数
details: 通过自定义函数,更精确的控制请求。
- title: 导出和同步
details: 规则可以自由导入和导出,并可使用云同步(需要浏览器支持)。
footer: Copyright © 2019 - 2023 FirefoxBar
---
# Header Editor Docs

A static site base on [dumi](https://d.umijs.org).

## Development

```bash
# install dependencies
$ pnpm install

# start dev server
$ pnpm start

# build docs
$ pnpm run build
```

## LICENSE

MIT
4 changes: 3 additions & 1 deletion docs/en/FAQ.md → docs/docs/guide/FAQ.en-US.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
group:
title: Introduction
title: FAQ
lang: en
order: 2
---

## Why is "header name" reduced to lowercase?
Expand Down
4 changes: 3 additions & 1 deletion docs/zh-CN/FAQ.md → docs/docs/guide/FAQ.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
nav: 指南
group: 介绍
title: FAQ
lang: zh-CN
order: 2
---

## 为什么“头名称”变成小写了?
Expand Down
4 changes: 3 additions & 1 deletion docs/zh-TW/FAQ.md → docs/docs/guide/FAQ.zh-TW.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
group:
title: 介紹
title: FAQ
lang: zh-TW
order: 2
---

## 为什么“头名称”变成小写了?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
group:
title: Basic features
title: Cloud backup
lang: en
order: 2
---

## Summary
Expand Down Expand Up @@ -32,4 +34,4 @@ As I know, Chrome has limits on the number of operations per unit of time. It me
* It seems that Firefox Sync is executed regularly, however if you want to force the cloud export you've to launch Firefox Sync manually.
![](https://user-images.githubusercontent.com/886325/41821498-e081fe7e-77e1-11e8-81de-03a09d826cb9.png)
* A new installation may cause cloud storage data to be blanked.
* See [browser.storage API](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage) for more technical details.
* See [browser.storage API](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage) for more technical details.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: 云备份
lang: zh-CN
nav: 指南
group: 常用功能
title: 云同步
order: 2
---

## 综述
Expand Down Expand Up @@ -32,4 +34,4 @@ Firefox和Chrome都有各自的空间限制,大约100KB。如果您的规则
* 据推测,Firefox会定期进行同步。但您可以通过手动运行,强行进行一次同步。
![](https://user-images.githubusercontent.com/886325/41821498-e081fe7e-77e1-11e8-81de-03a09d826cb9.png)
* 重新安装扩展可能导致同步内容丢失。
* 请查看[browser.storage API](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage)获取更多技术细节。
* 请查看[browser.storage API](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage)获取更多技术细节。
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: 云备份
lang: zh-TW
group:
title: 常用功能
title: 雲同步
order: 2
---

## 综述
Expand Down Expand Up @@ -32,4 +34,4 @@ Firefox和Chrome都有各自的空间限制,大约100KB。如果您的规则
* 据推测,Firefox会定期进行同步。但您可以通过手动运行,强行进行一次同步。
![](https://user-images.githubusercontent.com/886325/41821498-e081fe7e-77e1-11e8-81de-03a09d826cb9.png)
* 重新安装扩展可能导致同步内容丢失。
* 请查看[browser.storage API](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage)获取更多技术细节。
* 请查看[browser.storage API](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage)获取更多技术细节。
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
group:
title: Advanced
order: 3
title: Custom function
lang: en
order: 1
---

## Summary
Expand Down Expand Up @@ -130,4 +133,4 @@ All custom functions are run in the background page, so to debug custom function

Chrome: Enable developer mode in `chrome://extensions/`, then click the "Inspect views" - "background page" at the bottom of Header Editor

Firefox: Open `about:debugging`, enable add-on debugging, click the "Debug" at the bottom of Header Editor
Firefox: Open `about:debugging`, enable add-on debugging, click the "Debug" at the bottom of Header Editor
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
---
nav: 指南
group:
title: 高级
order: 3
title: 自定义函数
lang: zh-CN
order: 1
---

## 综述
Expand Down Expand Up @@ -128,4 +132,4 @@ if (detail.type === "media") {

Chrome:在`chrome://extensions/`中,启用“开发者模式”,点击Header Editor下方的“检查视图”-“背景页”

Firefox:打开`about:debugging`,启用附加组件调试,点击Header Editor下方的“调试”
Firefox:打开`about:debugging`,启用附加组件调试,点击Header Editor下方的“调试”
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
group:
title: 高級
order: 3
title: 自訂函數
lang: zh-TW
order: 1
---

## 綜述
Expand Down
Loading

0 comments on commit aff7f1e

Please sign in to comment.