Compare commits

...

9 Commits

Author SHA1 Message Date
Fin
5651c0f329 推送弹框减少显示 markdown 空行 2025-11-26 11:25:22 +08:00
Fin
a5fd46251e 更新导航栏 2025-11-25 16:46:40 +08:00
Fin
e0224ff95e 创建缺失的 navbar 2025-11-25 16:42:08 +08:00
Fin
bb52ee25f6 添加 _redirects 2025-11-25 16:36:49 +08:00
Fin
3d8ce36e89 更新部署命令 2025-11-25 16:32:43 +08:00
Fin
20776ce231 update docs 2025-11-25 16:22:07 +08:00
Fin
aefdd5e985 update docs 2025-11-25 16:12:36 +08:00
Fin
479b313c47 Add Cloudflare Pages deployment workflow 2025-11-25 16:11:10 +08:00
Fin
7896a82f0b 修改测试例子 2025-11-25 10:16:55 +08:00
5 changed files with 43 additions and 8 deletions

27
.github/workflows/deploy-docs.yaml vendored Normal file
View File

@ -0,0 +1,27 @@
name: Deploy Docs to Cloudflare Pages
on:
push:
branches:
- master
paths:
- 'docs/**'
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Deploy to Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy docs --branch=main --project-name=bark-docs

View File

@ -23,7 +23,12 @@ class MarkdownProcessor: NotificationContentProcessor {
codeBlockTextColor: UIColor.black,
quoteColor: UIColor.systemGray
)
bestAttemptContent.body = MarkdownParser(configuration: config).parse(markdown).string
let body = MarkdownParser(configuration: config)
.parse(markdown)
.string
// body \n\n
.replacingOccurrences(of: "\n\n+", with: "\n", options: .regularExpression)
bestAttemptContent.body = body
return bestAttemptContent
}
}

3
docs/en-us/_navbar.md Normal file
View File

@ -0,0 +1,3 @@
* Translations
- [:uk: English](/en-us/)
- [:cn: 简体中文](/)

View File

@ -46,8 +46,8 @@ curl -X "POST" "https://api.day.app/your_key" \
```sh
curl -X "POST" "https://api.day.app/push" \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"markdown": "Hello **Markdown**",
-d '{
"markdown": "Hello! \n**Markdown**",
"title": "Test Title",
"device_key": "your_key"
}'
@ -61,7 +61,7 @@ List of supported parameters, specific effects can be previewed in the APP.
| title | Push title |
| subtitle | Push subtitle |
| body | Push content |
| markdown | Push content in Markdown format. When this is provided, the body field is ignored. |
| markdown | Push content with basic Markdown. When this is provided, the body field is ignored. |
| device_key | Device key |
| device_keys | Key array, used for batch push |
| level | Push interruption level.<br>critical: Important alert, will ring even in silent mode <br>activeDefault value, the system will immediately light up the screen to display the notification<br>timeSensitiveTime-sensitive notification, can display the notification in focus mode.<br>passiveOnly adds the notification to the notification list, will not light up the screen. |

View File

@ -38,7 +38,7 @@ curl -X "POST" "https://api.day.app/your_key" \
"sound": "minuet",
"icon": "https://day.app/assets/images/avatar.jpg",
"group": "test",
"url": "https://mritd.com"
"url": "https://bark.day.app"
}'
```
@ -46,8 +46,8 @@ curl -X "POST" "https://api.day.app/your_key" \
```sh
curl -X "POST" "https://api.day.app/push" \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"markdown": "Hello **Markdown**",
-d '{
"markdown": "Hello! \n**Markdown**",
"title": "Test Title",
"device_key": "your_key"
}'
@ -61,7 +61,7 @@ curl -X "POST" "https://api.day.app/push" \
| title | 推送标题 |
| subtitle | 推送副标题 |
| body | 推送内容 |
| markdown | 推送内容,markdown格式。传递了此参数将忽略 body 字段, 发送时请注意处理特殊字符。|
| markdown | 推送内容,支持基础 Markdown 格式。传递了此参数将忽略 body 字段, 发送时请注意处理特殊字符。|
| device_key | 设备key |
| device_keys | key 数组,用于批量推送 |
| level | 推送中断级别。<br>critical: 重要警告, 在静音模式下也会响铃 <br>active默认值系统会立即亮屏显示通知<br>timeSensitive时效性通知可在专注状态下显示通知。<br>passive仅将通知添加到通知列表不会亮屏提醒。 |