mirror of
https://github.com/m1ngsama/FUJI.git
synced 2025-12-24 10:51:27 +00:00
Merge branch 'main' of https://github.com/nbtca/Home
This commit is contained in:
commit
06b8f5cf79
5 changed files with 19015 additions and 19 deletions
18926
package-lock.json
generated
Normal file
18926
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
BIN
src/pages/posts/_assets/github_markdown.png
Normal file
BIN
src/pages/posts/_assets/github_markdown.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 58 KiB |
13
src/pages/posts/_assets/github_markdown.svg
Normal file
13
src/pages/posts/_assets/github_markdown.svg
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<svg width="400" height="394" viewBox="0 0 400 394" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="400" height="393.469" fill="white"/>
|
||||
<g clip-path="url(#clip0_1_2)">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M199.523 40C111.311 40 40 111.837 40 200.709C40 271.749 85.6914 331.882 149.078 353.166C157.002 354.766 159.905 349.708 159.905 345.453C159.905 341.727 159.644 328.957 159.644 315.651C115.269 325.231 106.028 296.493 106.028 296.493C98.8963 277.868 88.3298 273.081 88.3298 273.081C73.8057 263.236 89.3878 263.236 89.3878 263.236C105.499 264.3 113.953 279.732 113.953 279.732C128.212 304.209 151.19 297.293 160.434 293.035C161.753 282.658 165.982 275.474 170.472 271.484C135.079 267.758 97.8416 253.923 97.8416 192.193C97.8416 174.632 104.176 160.264 114.214 149.091C112.63 145.1 107.082 128.601 115.801 106.518C115.801 106.518 129.27 102.26 159.641 123.014C172.644 119.496 186.053 117.706 199.523 117.691C212.993 117.691 226.723 119.556 239.402 123.014C269.776 102.26 283.246 106.518 283.246 106.518C291.964 128.601 286.413 145.1 284.829 149.091C295.131 160.264 301.205 174.632 301.205 192.193C301.205 253.923 263.967 267.491 228.31 271.484C234.122 276.539 239.138 286.116 239.138 301.283C239.138 322.834 238.877 340.131 238.877 345.45C238.877 349.708 241.783 354.766 249.704 353.169C313.091 331.879 358.782 271.749 358.782 200.709C359.043 111.837 287.471 40 199.523 40Z" fill="#24292F"/>
|
||||
</g>
|
||||
<path d="M147.618 156.47C141.782 156.47 137 161.337 137 167.151V225.093C137 230.907 141.782 235.774 147.617 235.774H251.719C257.554 235.774 262.336 230.907 262.336 225.093V167.152C262.336 161.338 257.553 156.471 251.719 156.471H150.566L150.564 156.469L147.618 156.47ZM147.611 166.013H251.719C252.344 166.013 252.795 166.436 252.795 167.153V225.093C252.795 225.81 252.342 226.233 251.719 226.233H147.617C146.994 226.233 146.541 225.81 146.541 225.093V167.151C146.541 166.436 146.992 166.016 147.611 166.013Z" fill="#24292F"/>
|
||||
<path d="M156.389 216.222V176.022H168.088L179.785 190.802L191.478 176.022H203.174V216.222H191.478V193.166L179.784 207.946L168.086 193.166V216.222H156.389ZM229.493 216.222L211.948 196.713H223.645V176.022H235.343V196.712H247.041L229.493 216.222Z" fill="#24292F"/>
|
||||
<defs>
|
||||
<clipPath id="clip0_1_2">
|
||||
<rect width="320" height="313.469" fill="white" transform="translate(40 40)"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.3 KiB |
|
|
@ -3,21 +3,22 @@ layout: "../../layouts/MarkdownPost.astro"
|
|||
title: "NBTCA主页投稿指南1.0"
|
||||
pubDate: 2025-10-10
|
||||
description: "在开源项目中发布你的第一篇博客"
|
||||
author: "小明"
|
||||
author:
|
||||
name: "小明"
|
||||
url: "https://blog.m1ng.space/"
|
||||
cover:
|
||||
url: "https://oss.nbtca.space/CA-logo.svg"
|
||||
url: ./_assets/github_markdown.png
|
||||
alt: "cover"
|
||||
tags: ["指南", "git", "markdown"]
|
||||
tags: ["指南", "Git", "Markdown"]
|
||||
---
|
||||
|
||||
<!-- markdownlint-disable-next-line MD022 -->
|
||||
##
|
||||
|
||||
> 学会使用 Git + Markdown 撰写与提交技术博客
|
||||
|
||||
## 一、前言
|
||||
|
||||
欢迎加入计算机协会 🎉!
|
||||
本指南将教你如何用最主流的开源协作方式——**Git + Markdown + Pull Request**,来撰写并发布你的第一篇博客。
|
||||
本指南将指导你如何使用最主流的开源协作方式——**Git + Markdown + Pull Request**,来撰写并发布你的第一篇NBTCA博客。
|
||||
|
||||
目标是:
|
||||
|
||||
|
|
@ -35,12 +36,17 @@ tags: ["指南", "git", "markdown"]
|
|||
|
||||
#### macOS
|
||||
|
||||
安装命令行工具集,使用brew安装git
|
||||
|
||||
```bash
|
||||
xcode-select --install
|
||||
brew install git
|
||||
```
|
||||
|
||||
#### Linux(例如 Ubuntu / Arch)
|
||||
|
||||
使用对应发行版的包管理器安装git
|
||||
|
||||
```bash
|
||||
sudo apt install git
|
||||
# 或
|
||||
|
|
@ -51,7 +57,7 @@ sudo pacman -S git
|
|||
|
||||
### 2. 注册 GitHub 账号
|
||||
|
||||
访问 [https://github.com](https://github.com),注册并登录,设置一个好记的用户名(建议用英文名或学号)。
|
||||
访问 [https://github.com](https://github.com),注册并登录,设置一个好记的用户名。
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -62,21 +68,24 @@ git config --global user.name "你的名字"
|
|||
git config --global user.email "你的邮箱"
|
||||
```
|
||||
|
||||
> 当然,你也可以使用[github-cli](https://github.com/cli/cli)来完成github的认证过程,但是[git的工作流程](https://nbtca.space/posts/blogs/Tech/Git/git-book-1)还是必要掌握的
|
||||
|
||||
---
|
||||
|
||||
## 三、Fork 与 Clone 协会博客仓库
|
||||
## 三、Fork 与 Clone 以及目前协会博客仓库的贡献方法
|
||||
|
||||
### 1. Fork
|
||||
一般的工作流程是将源代码仓库[Fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo)一份到自己名下创建一个新的下游仓库,在自己的下游仓库编写代码并通过[创建pr](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests)的方式提交更新到上游仓库。
|
||||
|
||||
1. 打开协会博客仓库(例如):
|
||||
👉 [https://github.com/nbtca/home](https://github.com/nbtca/home)
|
||||
2. 点击右上角的 **Fork** 按钮。
|
||||
目前NBTCA的[Home项目](https://github.com/nbtca/home)集成了[CI/CD](https://github.com/resources/articles/ci-cd)
|
||||
|
||||
为了保证交付安全,默认只有项目源代码仓库的分支提交的pr会触发[github action](https://github.com/features/actions),从下游仓库提交的pr在合并后并不会触发构建,这一点需要注意,所以推荐在源代码的基础上创建分支并pr
|
||||
|
||||
### 2. Clone
|
||||
|
||||
```bash
|
||||
git clone https://github.com/你的用户名/blog.git
|
||||
git clone https://github.com/nbtca/home.git
|
||||
cd blog
|
||||
# 如果是gh-cli则是gh repo clone nbtca/home
|
||||
```
|
||||
|
||||
---
|
||||
|
|
@ -85,6 +94,9 @@ cd blog
|
|||
|
||||
```bash
|
||||
git checkout -b add-my-first-blog
|
||||
# -b 参数代表创建一个新的分支
|
||||
# 此处add-my-first-blog作为分支名可以自行替换,
|
||||
# 我个人的习惯是提交类型+具体事务类型,例如post/blog-post、feature/homepage等。
|
||||
```
|
||||
|
||||
---
|
||||
|
|
@ -96,7 +108,8 @@ git checkout -b add-my-first-blog
|
|||
在 `src/pages/posts/` 文件夹中新建:
|
||||
|
||||
```
|
||||
posts/my-first-blog.md
|
||||
my-first-blog.md
|
||||
# 换成你喜欢的名字,最好是英文的方便管理
|
||||
```
|
||||
|
||||
### 2. 文件模板
|
||||
|
|
@ -107,9 +120,9 @@ layout: "../../layouts/MarkdownPost.astro"
|
|||
title: "题目"
|
||||
pubDate: 2025-10-10
|
||||
description: "描述"
|
||||
author: "张三"
|
||||
author: "张三
|
||||
cover:
|
||||
url: "封面地址"
|
||||
url: "封面地址url,也可以引用本地图片"
|
||||
alt: "cover"
|
||||
tags: ["标签", "可多个"]
|
||||
---
|
||||
|
|
@ -130,21 +143,28 @@ Markdown 是一种轻量级标记语言,用简单的符号来排版文字。
|
|||
|
||||
- **加粗**:`**加粗**`
|
||||
- _斜体_:`*斜体*`
|
||||
- 链接:[协会官网](https://example.com)
|
||||
- 链接:`[协会官网](https://example.com)`
|
||||
|
||||
## 三、总结
|
||||
|
||||
学会使用 Git + Markdown,你就能参与到开源协作中了!
|
||||
```
|
||||
|
||||
> 以上为行文推荐格式,关于[markdown](https://www.markdownguide.org/)的写法可自行查阅手册。
|
||||
|
||||
---
|
||||
|
||||
## 六、提交与推送
|
||||
|
||||
```bash
|
||||
git add posts/2025-10-09-my-first-blog.md
|
||||
git add my-first-blog.md
|
||||
# 将更新的文件添加到暂存区
|
||||
|
||||
git commit -m "Add my first blog: Git 与 Markdown 入门"
|
||||
# 将暂存区的文件集合为一次提交,并对本次提交做出说明
|
||||
|
||||
git push origin add-my-first-blog
|
||||
# 将提交从本地同步到远程Github仓库,提交到远程仓库的对应新分支
|
||||
```
|
||||
|
||||
---
|
||||
|
|
@ -179,6 +199,8 @@ git push origin add-my-first-blog
|
|||
|
||||
## 十、结语
|
||||
|
||||
当仓库管理员[Review](https://github.com/features/code-review)代码后,代码就可以[Merge](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/merging-a-pull-request)了
|
||||
|
||||
当你第一次成功合并 PR 时:
|
||||
|
||||
> 🎉 你正式成为开源协作的一员!
|
||||
> 恭喜你,🎉 你正式成为了开源协作的一员!
|
||||
|
|
|
|||
|
|
@ -53,6 +53,41 @@ body.theme-dark .astro-code span {
|
|||
background-color: var(--gray-primary) !important;
|
||||
}
|
||||
|
||||
/* Improve markdown hyperlink visibility */
|
||||
.prose a {
|
||||
color: #0071e3 !important;
|
||||
text-decoration: underline;
|
||||
text-decoration-color: rgba(0, 113, 227, 0.4);
|
||||
text-underline-offset: 2px;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.prose a:hover {
|
||||
color: #0077ed !important;
|
||||
text-decoration-color: #0077ed;
|
||||
}
|
||||
|
||||
.prose a:visited {
|
||||
color: #551A8B !important;
|
||||
text-decoration-color: rgba(85, 26, 139, 0.4);
|
||||
}
|
||||
|
||||
/* Dark mode link styles */
|
||||
body.theme-dark .prose a {
|
||||
color: #2997ff !important;
|
||||
text-decoration-color: rgba(41, 151, 255, 0.4);
|
||||
}
|
||||
|
||||
body.theme-dark .prose a:hover {
|
||||
color: #409cff !important;
|
||||
text-decoration-color: #409cff;
|
||||
}
|
||||
|
||||
body.theme-dark .prose a:visited {
|
||||
color: #bf5af2 !important;
|
||||
text-decoration-color: rgba(191, 90, 242, 0.4);
|
||||
}
|
||||
|
||||
ul,
|
||||
ol,
|
||||
li,
|
||||
|
|
|
|||
Loading…
Reference in a new issue