Skip to content

Commit

Permalink
doc: fix docs typos & dark theme button style (#1102)
Browse files Browse the repository at this point in the history
* chore: add check version

* fix: dark theme button style

* fix: docs typos

* feat: remove semver
  • Loading branch information
hai-x authored May 6, 2023
1 parent 2318887 commit f108bc7
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 14 deletions.
6 changes: 5 additions & 1 deletion docs/.vitepress/theme/custom.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
:root {
--vp-c-brand: #646cff;
--vp-c-brand-light: #747bff;
--vp-c-brand-dark: #323cf7
--vp-c-brand-dark: #323cf7;
}

.inline img {
Expand All @@ -28,3 +28,7 @@
border: 1px solid var(--vp-c-brand);
background-color: #f6f6f7;
}

.dark .search button {
background-color: var(--vp-c-bg);
}
4 changes: 2 additions & 2 deletions docs/guide/function/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ title: 云函数入门

## 编辑云函数

Laf 自带 `Web IDE`,可直接在浏览器在线编辑、运行(调试)、发布云函数
Laf 自带 `Web IDE`,可直接在浏览器在线编辑、运行(调试)、发布云函数

![edit-cloudfunction](/doc-images/edit-cloudfunction.png)

## 运行云函数

云函数编写后可直接运行调试,未发布的云函数也可以在此进行运行调试
云函数编写后可直接运行调试,未发布的云函数也可以在此进行运行调试

![run-cloudfunction](/doc-images/run-cloudfunction.png)

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/oss/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: 云存储简介

# {{ $frontmatter.title }}

`laf` 云存储是基于 [MinIO](https://min.io/) 提供的对象存储服务,提供了完全的 MinIO 的对象存储服务,同时也是标准的 s3 接口,我们可以通过 s3 api 来控制云存储中文件的增删改查
`laf` 云存储是基于 [MinIO](https://min.io/) 提供的对象存储服务,提供了完全的 MinIO 的对象存储服务,同时也是标准的 s3 接口,我们可以通过 s3 api 来控制云存储中文件的增删改查

## 创建 bucket

Expand Down
16 changes: 8 additions & 8 deletions docs/guide/website-hosting/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Laf 静态网站托管支持绑定自己的域名,并自动生成 `SSL` 证书

### 上传文件,开启网站托管

上传前端项目编译后的文件到刚刚新建的云存储中
上传前端项目编译后的文件到刚刚新建的云存储中

::: tip
大部分前端项目编译完的代码都在 `dist` 文件夹中,需要将 `dist` 文件夹中的文件全部上传到云存储中
Expand Down Expand Up @@ -71,15 +71,15 @@ name: Build
on:
push:
branches:
- '*'
- "*"

env:
BUCKET_NAME: ${{ secrets.DOC_BUCKET_NAME }}
LAF_APPID: ${{ secrets.LAF_APPID }}
LAF_PAT: ${{ secrets.LAF_PAT }}
API_URL: 'https://api.laf.dev'
API_URL: "https://api.laf.dev"
WEB_PATH: .
DIST_PATH: 'dist'
DIST_PATH: "dist"
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -88,21 +88,21 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16.x'
node-version: "16.x"
# 安装项目依赖
- name: Install Dependencies
working-directory: ${{ env.WEB_PATH }}
run: npm install
# 编译项目
- name: Build
- name: Build
working-directory: ${{ env.WEB_PATH }}
run: npm run build
# 安装 laf-cli
- name: Install Laf-CLI
run: npm i laf-cli -g
# 登录 laf api
- name: Login laf-cli
working-directory: ${{ env.WEB_PATH }}
working-directory: ${{ env.WEB_PATH }}
run: laf login -r ${{ env.API_URL }} $LAF_PAT
# 初始化 Laf 应用然后将编译好的代码推送到云存储
- name: Init appid and push
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ features:
- title: 在线编程 IDE
details: 支持 AI 生成云函数,码中生花。支持全类型智能提示,在线编写、调试、日志,代码即内容。随时随地,发布上线。
- title: 触发器
details: 云函数可配置定时器和事件触发器,其中可监听数据库变更事件,数据变更可触发云函数的执行(事件触发器稍晚更新)
details: 云函数可配置定时器和事件触发器,其中可监听数据库变更事件,数据变更可触发云函数的执行(事件触发器稍晚更新)
- title: 云存储
details: 提供专业兼容 S3 标准的对象存储服务(MinIO),支持 Service Account 开放能力。
- title: 静态网站托管
Expand Down
1 change: 1 addition & 0 deletions docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"scripts": {
"start": "npm run dev",
"dev": "vitepress dev",
"preinstall": "node ./scripts/check-version.js",
"build": "vitepress build && npm run after-build",
"serve": "vitepress serve",
"after-build": "sed -i -e \"s@</body>@<div style='font-size: 14px; padding-bottom: 30px; color: darkblue;text-align: center;'><a href='https://beian.miit.gov.cn/' target='_blank'>浙ICP备2022023216号</a></div></body>@g\" ./.vitepress/dist/index.html",
Expand All @@ -19,4 +20,4 @@
"flexsearch": "^0.7.31",
"vitepress-plugin-search": "^1.0.4-alpha.20"
}
}
}
7 changes: 7 additions & 0 deletions docs/scripts/check-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Lock lockFileVersion to version 2 And resolve import error when import xxx from 'node:xxx'
if (process.version && +process.version.slice(1).split(".")[0] < 16) {
console.log(
`Required node version >= 16 not satisfied with current version ${process.version}.`
);
process.exit(1);
}

0 comments on commit f108bc7

Please sign in to comment.