-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
418 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
--- | ||
title: 自定义您的网站 | ||
--- | ||
|
||
PageForge 提供了一些可选的自定义选项,以满足不同的需求。 | ||
|
||
## 自定义 CSS | ||
|
||
--- | ||
|
||
您可以在 `pageforge.yaml` 文件中指定自定义的 CSS 文件,以便覆盖默认的 CSS 样式。 | ||
|
||
```yaml | ||
theme: | ||
extra_css: | ||
- /assets/extra.css | ||
``` | ||
## 自定义 JavaScript | ||
--- | ||
您可以在 `pageforge.yaml` 文件中指定自定义的 JavaScript 文件,以便覆盖默认的 JavaScript 脚本。 | ||
|
||
```yaml | ||
theme: | ||
extra_js: | ||
- /assets/extra.js | ||
``` | ||
|
||
## 自定义模板 | ||
|
||
--- | ||
|
||
您可以在项目根目录创建 `templates` 文件夹,并在其中创建自定义的模板文件,以便覆盖默认的模板文件。 | ||
|
||
```bash | ||
templates | ||
├── components | ||
│ ├── a.js | ||
│ ├── block-code.js | ||
│ ├── checkbox.js | ||
│ ├── h1.js | ||
│ ├── h2.js | ||
│ ├── h3.js | ||
│ ├── h4.js | ||
│ ├── h5.js | ||
│ ├── h6.js | ||
│ ├── hr.js | ||
│ ├── image.js | ||
│ ├── inline-code.js | ||
│ ├── list.js | ||
│ ├── p.js | ||
│ └── space.js | ||
├── includes | ||
│ ├── footer.ejs | ||
│ ├── header.ejs | ||
│ ├── nav.ejs | ||
│ ├── sidebar.ejs | ||
│ └── toc.ejs | ||
└── layouts | ||
├── base.ejs | ||
├── content.ejs | ||
└── page.ejs | ||
``` | ||
|
||
按照文件的路径,您可以覆盖默认的模板文件。 | ||
|
||
如果自定义模版,可以直接在 `templates/layouts` 文件夹中创建自定义的布局文件,文件名便是模版名称。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
--- | ||
title: 发布您的网站 | ||
--- | ||
|
||
在 git 存储库中托管项目文档的好处是能够在推送新更改时自动部署它。PageForge 将帮助您让这一切变得非常简单。 | ||
|
||
## GitHub Pages | ||
|
||
--- | ||
|
||
如果您已经在 GitHub 上托管了您的代码,GitHub Pages 无疑是发布项目文档的最便捷方式。它是免费的,而且很容易设置。 | ||
|
||
### 使用 GitHub Actions | ||
|
||
使用 GitHub Actions,您可以自动部署项目文档。在仓库的根目录中,创建一个新的 GitHub Actions 工作流程,例如 `.github/workflows/ci.yml`,然后复制并粘贴以下内容: | ||
|
||
```yaml | ||
name: ci | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
permissions: | ||
contents: write | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js 18.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Build site | ||
run: | | ||
pageforge build | ||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./dist | ||
``` | ||
### 使用 PageForge | ||
--- | ||
您也可以使用 PageForge 的命令行工具来自动部署项目文档。PageForge 会在项目根目录中 `pageforge.yaml` 文件,读取配置信息: | ||
|
||
```yaml | ||
deploy: | ||
github: | ||
repository: devlive-community/pageforge | ||
branch: gh-pages | ||
cname: pageforge.devlive.community | ||
buildDir: dist | ||
username: devlive-community | ||
email: support@devlive.org | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
title: 设置 | ||
--- | ||
|
||
PageForge 材料提供了多种自定义文档的选项。在本节中,我们将解释如何为您的网站创建有意义的结构、更改外观和感觉、添加博客和评论系统以及构建高度优化的网站。 | ||
|
||
## 网站结构 | ||
|
||
--- | ||
|
||
通过根据您的喜好配置页眉和页脚、在多种导航模式中进行选择、设置站点搜索等来设置和自定义文档的结构。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.