Skip to content

Commit

Permalink
✨ feat(Contributors): 优化贡献者模块
Browse files Browse the repository at this point in the history
  • Loading branch information
HRxiaohu committed Aug 6, 2023
1 parent dcd775c commit d1719c0
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 25 deletions.
8 changes: 4 additions & 4 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ export default withPwa(
},

sidebar: [
{
text: "工具",
items: [{ text: "崩溃分析工具", link: "/analyzer" }],
},
{
text: "文档",
items: [
Expand Down Expand Up @@ -138,10 +142,6 @@ export default withPwa(
{ text: "Mixin", link: "/mixin" },
],
},
{
text: "工具",
items: [{ text: "崩溃分析工具", link: "/analyzer" }],
},
{
text: "贡献",
items: [
Expand Down
26 changes: 18 additions & 8 deletions docs/.vitepress/theme/components/Contributors.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ function getAvatarUrl(name: string) {
}
function getGithubLink(name: string) {
return `https://github.com/${name}`
return members.find((member) => {
return member.name === name
})?.links[0].link
}
function isNotEmpty(arr: string | string[]) {
Expand All @@ -35,17 +37,25 @@ function isNotEmpty(arr: string | string[]) {
v-for="contributor of contributors"
:key="contributor"
class="flex gap-2 items-center vp-main-color">
<a :href="getGithubLink(contributor)" rel="noreferrer" target="_blank">
<a
:href="getGithubLink(contributor)"
rel="noreferrer"
target="_blank"
class="flex items-center gap-2">
<img :src="getAvatarUrl(contributor)" class="w-8 h-8 rounded-full" />
<p class="vp-main-color">{{ contributor }}</p>
</a>
<p class="vp-main-color">{{ contributor }}</p>
</div>
</div>
<div v-else class="flex gap-2 items-center">
<a :href="getGithubLink(defaultAuthor)" rel="noreferrer" target="_blank">
<img :src="getAvatarUrl(defaultAuthor)" class="w-8 h-8 rounded-full" />
<a
:href="getGithubLink(defaultAuthor)"
rel="noreferrer"
target="_blank"
class="flex items-center gap-2">
<img src="../../../public/logo-brand.png" class="w-8 h-8 rounded-full" />
<p class="vp-main-clolr">{{ "GlobeMC" }}</p>
</a>
<p class="vp-main-clolr">{{ "GlobeMC" }}</p>
</div>
</template>

Expand All @@ -54,7 +64,7 @@ function isNotEmpty(arr: string | string[]) {
display: flex;
}
.flex-warp {
.flex-wrap {
flex-wrap: wrap;
}
Expand Down Expand Up @@ -97,6 +107,6 @@ p {
}
.con {
margin-bottom: 6px;
margin-bottom: 5px;
}
</style>
2 changes: 1 addition & 1 deletion docs/analyzer.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
author: HRxiaohu
contributors: [HRxiaohu]
---

<script setup>
Expand Down
8 changes: 4 additions & 4 deletions docs/client/system.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
| 错误码 | 可能原因 | 解决方法 |
| ------ | -------------------------------------- | ------------------------------------------------------------------------------------ |
| 1280 | OptiFine / Mods 冲突 / OpenGL 版本错误 | 更换 OptiFine 版本、检查 Mods 冲突或尝试更新显卡驱动 |
| 1281 | Mods / 图像设置 / 显卡驱动 / 光影 | 尝试更新显卡驱动或检查 Mods 问题(如检查后无问题,则暂时无解) |
| 1281 | Mods / 图像设置 / 显卡驱动 / 光影 | 尝试更新显卡驱动或检查 Mods 问题(如检查后无问题则暂时无解) |
| 1282 | 显卡驱动 / Mods 冲突 / 着色器出错 | 更换游戏版本,更换 OptiFine 版本,检查 Mods 问题,检查材质包和光影包,或更换显卡驱动 |
| 1283 | Mods | 更换光影或检查 Mods 问题 |
| 1284 | 显卡驱动 / Mods 冲突 / 着色器出错 | 更换光影或检查 Mods 问题 |
Expand Down Expand Up @@ -160,13 +160,13 @@ net.minecraft.util.ResourceLocationException: Non [a-z0-9_.-] character in names
解决方法:删除 `.DS_Store` 文件

:::details 解决步骤
由于 `.DS_Store` 文件是 MacOS 的隐藏文件, 只能通过执行指令进行删除
由于 `.DS_Store` 文件是 MacOS 的隐藏文件 只能通过执行指令进行删除

1. 进入搜索栏, 搜索 `终端``Terminal`, 并打开该软件
1. 进入搜索栏搜索 `终端``Terminal` 并打开该软件
2. (可选) 使用 `cd <游戏路径>` 指令进入游戏目录
- 注 1: 官启的 `<游戏路径>``"~/Library/Application Support/minecraft/"`
- 注 2: 其他第三方启动器的 `<游戏路径>` 一般是与启动器文件同级的 `.minecraft` 文件夹
- **注 3: `.DS_Store` 用于保存文件移动记录 _(可见并不是非常重要)_ 。但若不在游戏目录下执行本操作, 将无法撤回任何文件移动操作, 并且 `find` 指令耗时也会很长**
- **注 3: `.DS_Store` 用于保存文件移动记录 _(可见并不是非常重要)_ 。但若不在游戏目录下执行本操作 将无法撤回任何文件移动操作 并且 `find` 指令耗时也会很长**
3. 执行如下指令:
```sh
rm $(find . -name .DS_Store 2>/dev/null)
Expand Down
28 changes: 21 additions & 7 deletions docs/contribute/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ contributors: [HRxiaohu]

### 修改渲染器 <LauncherBadge type="hmcl" text="仅 HMCL" />

```md
```MarkDown
### 修改渲染器 <LauncherBadge type="hmcl" text="仅 HMCL" />
```

Expand All @@ -38,7 +38,7 @@ contributors: [HRxiaohu]

### 重置核心 <LauncherBadge type="bakaxl" text="仅 BakaXL" />

```md
```MarkDown
### 重置核心 <LauncherBadge type="bakaxl" text="仅 BakaXL" />
```

Expand All @@ -48,20 +48,34 @@ contributors: [HRxiaohu]

### 修改验证服务器 <LauncherBadge type="pcl" text="仅 PCL2" />

```md
```MarkDown
### 修改验证服务器 <LauncherBadge type="pcl" text="仅 PCL2" />
```

:::

在您完成文档修改后,请在 MarkDown 文档的最上方修改 contributors FrontMatter,将您的 Github 用户名添加到贡献者列表,格式如下。
在您完成文档修改后,请进行以下操作,将你的名称添加到贡献者列表:

```md
1. 请在 MarkDown 文档的最上方修改 contributors FrontMatter,以将您的名称添加到贡献者列表,格式如下。

```MarkDown
---
contributors: [用户名, 用户名, 用户名]
contributors: [名称, 名称, 名称]
---
```

2. 请修改 [members.ts](https://github.com/GlobeMC/crashmc.com/blob/main/docs/.vitepress/data/members.ts) 文件,并按照如下格式添加您的信息。

```TypeScript
{
avatar: "头像链接 (请使用稳定的图床)",
name: "名称",
title: "文档贡献者",
links: [{ icon: "github", link: "您的 Github 个人资料链接" }],
},

```

:::warning 警告
请一定要使用您的 Github 用户名,否则我们的组件无法获取您的头像。
上述代码中所使用的均为英文半角逗号!
:::
2 changes: 1 addition & 1 deletion docs/mixin.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
## 如何判断我的 Minecraft 中是否有 Mixin 的参与?

在日志中查找 `SpongePowered MIXIN Subsystem` 这段文字, 如果找到说明您的 Mod 加载器中使用了 Mixin
在日志中查找 `SpongePowered MIXIN Subsystem` 这段文字如果找到说明您的 Mod 加载器中使用了 Mixin

## 在此之前...

Expand Down

0 comments on commit d1719c0

Please sign in to comment.