mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-12-18 05:41:31 +00:00
Improve code style
- js/css - markdown - shell
This commit is contained in:
@@ -53,8 +53,8 @@ Language: [English](https://github.com/cotes2020/jekyll-theme-chirpy#readme) |
|
||||
|
||||
有二法可得此主题:
|
||||
|
||||
- 从 [RubyGems](https://rubygems.org/gems/jekyll-theme-chirpy) 安装
|
||||
- 从 GitHub 上 Fork
|
||||
- 从 [RubyGems](https://rubygems.org/gems/jekyll-theme-chirpy) 安装
|
||||
- 从 GitHub 上 Fork
|
||||
|
||||
### Rubygems 安装
|
||||
|
||||
@@ -86,9 +86,6 @@ $ bundle info --path jekyll-theme-chirpy
|
||||
|
||||
或者你可以 [使用 starter template][use-starter] 来快速创建 Jekyll 站点,以省去复制主题 gem 文件的时间。
|
||||
|
||||
[starter]: https://github.com/cotes2020/chirpy-starter
|
||||
[use-starter]: https://github.com/cotes2020/chirpy-starter/generate
|
||||
|
||||
### 在 GitHub 上 Fork
|
||||
|
||||
[Fork **Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/fork) 然后克隆到本地。
|
||||
@@ -109,15 +106,15 @@ $ bash tools/init.sh
|
||||
|
||||
上述脚本完成了以下工作:
|
||||
|
||||
1. 从你的仓库中删除了:
|
||||
1. 从你的仓库中删除了:
|
||||
|
||||
- `.travis.yml`
|
||||
- `_posts` 下的文件
|
||||
- `docs` 目录
|
||||
|
||||
2. 如果使用了参数 `--no-gh`,则会怒删 `.github`。否则,将会配置 GitHub Actions:把 `.github/workflows/pages-deploy.yml.hook` 的后缀 `.hook` 去除,然后删除 `.github` 里的其他目录和文件。
|
||||
2. 如果使用了参数 `--no-gh`,则会怒删 `.github`。否则,将会配置 GitHub Actions:把 `.github/workflows/pages-deploy.yml.hook` 的后缀 `.hook` 去除,然后删除 `.github` 里的其他目录和文件。
|
||||
|
||||
3. 自动提交一个 Commit 以保存上述文件的更改。
|
||||
3. 自动提交一个 Commit 以保存上述文件的更改。
|
||||
|
||||
## 使用
|
||||
|
||||
@@ -159,19 +156,20 @@ $ docker run -it --rm \
|
||||
|
||||
由于安全原因,GitHub Pages 的构建强制加了 `safe`参数,这导致了我们不能使用插件去创建所需的附加页面。因此,我们可以使用 GitHub Actions 去构建站点,把站点文件存储在一个新分支上,再指定该分支作为 Pages 服务的源。
|
||||
|
||||
确保你的 Jekyll 站点存在文件 `/.github/workflows/pages-deploy.yml`。没有的话,新建并填入[示例工作流][workflow]的内容, 注意参数 `on.push.branches` 的值必须和你的仓库默认分支名相同。
|
||||
快速检查 GitHub Actions 构建需要的文件:
|
||||
|
||||
[workflow]:https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/.github/workflows/pages-deploy.yml.hook
|
||||
1. 确保你的 Jekyll 站点存在文件 `/.github/workflows/pages-deploy.yml`。没有的话,新建并填入[示例工作流][workflow]的内容, 注意参数 `on.push.branches` 的值必须和你的仓库默认分支名相同。
|
||||
2. 检查你的 Jekyll 站点是否有文件 `/tools/test.sh` 和 `/tools/deploy.sh`. 没有的话, 从本仓库拷贝到你的 Jekyll 项目.
|
||||
|
||||
在 GitHub 把你的仓库命名为 `<GH-USERNAME>.github.io`,然后:
|
||||
|
||||
1. 推送任意一个 commit 到 `origin/master` 以触发 GitHub Actions workflow。一旦 build 完毕并且成功,远端将会自动出现一个新分支 `gh-pages` 用来存储构建的站点文件。
|
||||
1. 推送任意一个 commit 到 `origin/master` 以触发 GitHub Actions workflow。一旦 build 完毕并且成功,远端将会自动出现一个新分支 `gh-pages` 用来存储构建的站点文件。
|
||||
|
||||
2. 回到 GitHub 上的仓库, 通过 _Settings_ → _Options_ → _GitHub Pages_ 选择分支 `gh-pages` 作为[_发布源_](https://docs.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site):
|
||||
2. 回到 GitHub 上的仓库, 通过 _Settings_ → _Options_ → _GitHub Pages_ 选择分支 `gh-pages` 作为[_发布源_](https://docs.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site):
|
||||
|
||||

|
||||

|
||||
|
||||
3. 按照 GitHub 指示的地址去访问你的网站。
|
||||
3. 按照 GitHub 指示的地址去访问你的网站。
|
||||
|
||||
#### 部署到其他 Pages 平台
|
||||
|
||||
@@ -209,11 +207,9 @@ $ docker run -it --rm \
|
||||
|
||||
:tada: 感谢所有参与代码贡献的小伙伴, 他们的 GayHub ID 在这个[列表](https://github.com/cotes2020/jekyll-theme-chirpy/graphs/contributors)。 另外, 提交过 issues(或者未被合并 PR) 的高富帅和白富美也不会被遗忘,他/她们帮助报告 bug、分享新点子或者启发了我写出更通俗易懂的文档。
|
||||
|
||||
还有,感谢 [JetBrains][JB] 提供开源 License!
|
||||
还有,感谢 [JetBrains][jb] 提供开源 License!
|
||||
|
||||
[][JB]
|
||||
|
||||
[JB]:https://www.jetbrains.com/?from=jekyll-theme-chirpy
|
||||
[][jb]
|
||||
|
||||
## 赞助
|
||||
|
||||
@@ -222,3 +218,8 @@ $ docker run -it --rm \
|
||||
## 许可证书
|
||||
|
||||
本项目开源,基于 [MIT](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE) 许可。
|
||||
|
||||
[starter]: https://github.com/cotes2020/chirpy-starter
|
||||
[use-starter]: https://github.com/cotes2020/chirpy-starter/generate
|
||||
[workflow]:https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/.github/workflows/pages-deploy.yml.hook
|
||||
[jb]:https://www.jetbrains.com/?from=jekyll-theme-chirpy
|
||||
|
||||
Reference in New Issue
Block a user