Skip to content
This repository was archived by the owner on Nov 2, 2024. It is now read-only.

Commit d1a44d6

Browse files
committed
update
Signed-off-by: Innei <[email protected]>
1 parent 80a529d commit d1a44d6

File tree

14 files changed

+113
-42
lines changed

14 files changed

+113
-42
lines changed

components/Tag/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './tag'

components/Tag/tag.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import clsx from 'clsx'
2+
import type { FC, PropsWithChildren } from 'react'
3+
4+
export const TitleTag: FC<
5+
PropsWithChildren & {
6+
className?: string
7+
}
8+
> = ({ children, className }) => {
9+
return (
10+
<div
11+
className={clsx(
12+
'inline-block text-xs text-white p-1 rounded-md bg-cyan-600 dark:bg-cyan-500',
13+
className,
14+
)}
15+
>
16+
{children}
17+
</div>
18+
)
19+
}
20+
21+
export const ProTag = () => {
22+
return (
23+
<TitleTag className="absolute translate-y-2 translate-x-2 z-[10]">
24+
<span title="此功能仅闭源版本提供">闭源版本</span>
25+
</TitleTag>
26+
)
27+
}

pages/themes/shiro/extra.mdx

Lines changed: 83 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
# 额外功能
22

3+
## 扩展的 Markdown 语法
4+
5+
参考 https://shiro.innei.in/#/markdown
6+
7+
**对于 LinkCard 的解析,某些需要你填写 API Key,以下的键值都是填写在 .env 环境变量中**
8+
9+
- GitHub,默认直接用浏览器访问,可能受到 rate limit,可以填写 `GH_TOKEN` 以保证 API 可达性。
10+
- TMDB,必须填写 `TMDB_API_KEY` 才可以正确解析 tmdb 的链接。参考 https://post.smzdm.com/p/a5op4w33/ 这里获取 TOKEN
11+
312
## 我的动态
413

514
Shiro 主题中,有一个可以在顶部显示博主当前正在做的事情的功能,这个功能是通过云函数和 ProcessReporter 软件实现的。
615

7-
import { ToGitHub } from '@components/ToGitHub';
16+
import { ToGitHub } from '@components/ToGitHub'
817

918
<ToGitHub repo="mx-space/ProcessReporterMac" />
1019
<ToGitHub repo="TNXG/ProcessReporterWinpy" />
@@ -13,7 +22,7 @@ import { ToGitHub } from '@components/ToGitHub';
1322
import { Callout, Steps } from 'nextra/components'
1423

1524
<Callout type="info">
16-
非常感谢 Innei, timochan, TNXG 的贡献,目前 ProcessReporter 已支持全平台!
25+
非常感谢 Innei, timochan, TNXG 的贡献,目前 ProcessReporter 已支持全平台!
1726
</Callout>
1827

1928
<Steps>
@@ -32,6 +41,7 @@ import { Callout, Steps } from 'nextra/components'
3241
这个密钥将用于验证你的软件是否有权限更新博主的动态,所以请务必设置一个复杂的密钥。
3342

3443
**密钥在后面的步骤中还需要用到,所以请务必记住。**
44+
3545
</Callout>
3646

3747
上方没有提到的选项都不需要填写,然后在右侧的代码编辑器中填入下面链接中的代码:
@@ -41,7 +51,7 @@ import { Callout, Steps } from 'nextra/components'
4151
点击保存按钮,云函数就配置完成了。
4252

4353
<Callout type="info">
44-
请关注此代码的更新,它可能会随时变化,你需要及时更新它们
54+
请关注此代码的更新,它可能会随时变化,你需要及时更新它们
4555
</Callout>
4656

4757
### 配置主题配置
@@ -51,21 +61,21 @@ import { Callout, Steps } from 'nextra/components'
5161
```json {14,15,16,17}
5262
{
5363
"module": {
54-
"donate": {
55-
"enable": false,
56-
"link": " https://afdian.net/@Innei ",
57-
"qrcode": [
58-
" https://cdn.jsdelivr.net/gh/Innei/img-bed@master/20191211132347.png ",
59-
" https://cdn.innei.ren/bed/2023/0424213144.png "
60-
]
61-
},
62-
"bilibili": {
63-
"liveId": 1434499
64-
},
65-
"activity": {
66-
"enable": true,
67-
"endpoint": "/fn/ps/update"
68-
}
64+
"donate": {
65+
"enable": false,
66+
"link": "https://afdian.net/@Innei",
67+
"qrcode": [
68+
"https://cdn.jsdelivr.net/gh/Innei/img-bed@master/20191211132347.png",
69+
"https://cdn.innei.ren/bed/2023/0424213144.png"
70+
]
71+
},
72+
"bilibili": {
73+
"liveId": 1434499
74+
},
75+
"activity": {
76+
"enable": true,
77+
"endpoint": "/fn/ps/update"
78+
}
6979
}
7080
}
7181
```
@@ -79,9 +89,10 @@ import { Callout, Steps } from 'nextra/components'
7989
<ToGitHub repo="ttimochan/processforlinux" />
8090

8191
由于不同平台有不同的使用方法,不同的软件我们会在下方具体讲述。
92+
8293
</Steps>
8394

84-
## ProcessReporter `Mac`
95+
### ProcessReporter `Mac`
8596

8697
打开软件后,你会发现你的系统菜单栏中多了一个图标,点击图标,然后点击「设置」,在弹出的窗口中填入你的信息:
8798

@@ -92,18 +103,18 @@ import { Callout, Steps } from 'nextra/components'
92103

93104
接着关闭窗口,再次点击菜单栏中的图标,点击「Enable」即可。如果一切正常,刷新一下你的博客你就可以在博客顶部看到你的动态了。
94105

95-
## ProcessReporter `Windows`
106+
### ProcessReporter `Windows`
96107

97108
Windows 版本的使用问题,请前往 [TNXG/ProcessReporterWinpy](https://github.com/TNXG/ProcessReporterWinpy#readme) 查看。
98109

99-
### 使用 GUI 版本
110+
#### 使用 GUI 版本
100111

101112
[Releases](https://github.com/TNXG/ProcessReporterWinpy/releases) 页面下载 `ProcessReporterWinpy_Launcher.exe`
102113
,配置好 `config.yml` 文件,然后运行 `ProcessReporterWinpy_Launcher.exe` 即可。
103114

104115
`config.yml` 配置具体配置项以及说明请参考 [TNXG/ProcessReporterWinpy](https://github.com/TNXG/ProcessReporterWinpy#readme)
105116

106-
### 使用预编译的二进制文件
117+
#### 使用预编译的二进制文件
107118

108119
[Releases](https://github.com/TNXG/ProcessReporterWinpy/releases) 页面下载 `ProcessReporterWinpy.exe`,配置好 `config.yml` 文件后,在终端运行即可,示例如下
109120

@@ -113,7 +124,7 @@ processforwinpy.exe --path "运行目录的路径"
113124

114125
`config.yml` 配置具体配置项以及说明请参考 [TNXG/ProcessReporterWinpy](https://github.com/TNXG/ProcessReporterWinpy#readme)
115126

116-
### 使用源代码
127+
#### 使用源代码
117128

118129
下载代码后,修改 `config.yml` 文件,填入你的信息:
119130

@@ -123,14 +134,14 @@ processforwinpy.exe --path "运行目录的路径"
123134

124135
接着运行程序即可。如果一切正常,刷新一下你的博客你就可以在博客顶部看到你的动态了。
125136

126-
## ProcessReporter `Linux`
137+
### ProcessReporter `Linux`
127138

128139
<ToGitHub repo="ttimochan/processforlinux#readme" />
129140

130141
在仓库的 [Releases](https://github.com/ttimochan/processforlinux/releases) 页面下载对应的二进制包,解压运行即可,具体请参照项目的 README 进行配置运行。
131142

132143
安装完成后,新建 `.env.process` 文件,填入你的信息:
133-
144+
134145
```env
135146
# 你的 key
136147
API_KEY=your_key
@@ -139,16 +150,59 @@ API_URL={你的API地址}/fn/ps/update
139150
# 上报时间间隔,单位为秒
140151
REPORT_TIME=30
141152
# 是否开启媒体状态上报
142-
MEDIA_ENABLE=true
153+
MEDIA_ENABLE=true
143154
# 是否打印日志
144-
LOG_ENABLE=true
155+
LOG_ENABLE=true
145156
```
157+
146158
然后执行程序即可。如果一切正常,刷新一下你的博客你就可以在博客顶部看到你的动态了。
147159

148160
如果有什么疑问,可以去阅读该项目的 [README](https://github.com/ttimochan/processforlinux#readme)
149161

150162
<style global jsx>{`
151-
.nextra-content pre {
152-
max-height: 55vh;
163+
.nextra-content pre {
164+
max-height: 55vh;
153165
}
154166
`}</style>
167+
168+
import { ProTag } from '@components/Tag'
169+
170+
## 个人状态展示<ProTag />
171+
172+
![](./status.png)
173+
174+
设置当前的状态。
175+
176+
### 配置云函数
177+
178+
进入后台,点击左侧菜单栏的「其他 -> 配置与云函数」,然后点击新建按钮,在选项卡中填入以下信息:
179+
180+
- 名称:`status`
181+
- 引用:`shiro`
182+
- 数据类型:`Function`
183+
- 请求方式:`ALL`
184+
185+
这个地方还需要设置一个密钥,在 Secret 中填入 `key`,在 Value 中填入你自己的密钥。
186+
187+
<Callout type="warning">
188+
这个密钥将用于验证你的软件是否有权限更新当前状态,所以请务必设置一个复杂的密钥。
189+
190+
**密钥在后面的步骤中还需要用到,所以请务必记住。**
191+
192+
</Callout>
193+
194+
上方没有提到的选项都不需要填写,然后在右侧的代码编辑器中填入下面链接中的代码:
195+
196+
<ToGitHub repo="mx-space/snippets/blob/main/shiro/functions/status.ts" />
197+
198+
点击保存按钮,云函数就配置完成了。
199+
200+
<Callout type="info">
201+
请关注此代码的更新,它可能会随时变化,你需要及时更新它们
202+
</Callout>
203+
204+
### 设置状态
205+
206+
在主页登录之后,你可以点击此头像的右下方设置状态。
207+
208+
APP 集成正在开发中..

pages/themes/shiro/index.mdx

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ import Video from '@components/Video'
173173
"#EAAEBA"
174174
]
175175
},
176-
176+
177177
"bg": [
178178
"https://github.com/Innei/static/blob/master/images/F0q8mwwaIAEtird.jpeg?raw=true",
179179
"https://github.com/Innei/static/blob/master/images/IMG_2111.jpeg.webp.jpg?raw=true"
@@ -182,9 +182,7 @@ import Video from '@components/Video'
182182
"css": [],
183183
"styles": [],
184184
"js": [],
185-
"scripts": [
186-
187-
]
185+
"scripts": []
188186
},
189187
"site": {
190188
"favicon": "/innei.svg",
@@ -339,12 +337,3 @@ Refer: https://github.com/Innei/Shiro/issues/137
339337
max-height: 50vh;
340338
}
341339
`}</style>
342-
343-
## 扩展的 Markdown 语法
344-
345-
参考 https://shiro.innei.in/#/markdown
346-
347-
** 对于 LinkCard 的解析,某些需要你填写 API Key**
348-
349-
- GitHub,默认直接用浏览器访问,可能受到 rate limit,可以填写 `GH_TOKEN` 以保证 API 可达性。
350-
- TMDB,必须填写 `TMDB_API_KEY` 才可以正确解析 tmdb 的链接。参考 https://post.smzdm.com/p/a5op4w33/

pages/themes/shiro/status.png

56.6 KB
Loading
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)