Compare commits

...
Sign in to create a new pull request.

5 commits

Author SHA1 Message Date
CDN
09af441751
Update deployment ci
All checks were successful
Deploy to remote / build (push) Successful in 1m8s
2025-04-21 08:55:51 +08:00
CDN
0f5cd5b458
Merge branch 'main' into release
Some checks failed
Deploy to remote / build (push) Failing after 8s
2025-04-21 08:42:12 +08:00
CDN
db2958f46e
Add deployment ci 2025-04-21 08:42:07 +08:00
CDN
47beab59c7
Enable analytics 2025-04-21 08:41:58 +08:00
CDN
028406ba18
Update zh-cn deploy config 2025-04-21 08:09:45 +08:00
3 changed files with 53 additions and 9 deletions

41
.github/workflows/deploy-zh.yml vendored Normal file
View file

@ -0,0 +1,41 @@
name: Deploy to remote
on:
push:
branches:
- release
workflow_dispatch:
jobs:
build:
runs-on: docker
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Hugo
uses: https://github.com/peaceiris/actions-hugo@v3
with:
hugo-version: 'latest'
extended: true
- name: Build
run: hugo --minify
- name: Upload artifact
uses: forgejo/upload-artifact@v4
with:
path: ./public
- name: Deploy to Remote
run: |
if [ ! -d ~/.ssh ]; then
mkdir -p ~/.ssh
fi
chmod 700 ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
echo "${{ secrets.SSH_KNOWN_HOSTS }}" >> ~/.ssh/known_hosts
chmod 644 ~/.ssh/known_hosts
dnf install rsync -y
rsync -av --delete -e "ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=yes -p ${{ secrets.SSH_PORT }}" public/ ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:${{ secrets.WEB_ROOT }}/mastodon-docs
- name: Clean up
run: |
rm -rf ~/.ssh
rm -rf public

View file

@ -1,7 +1,9 @@
baseURL = "https://docs.joinmastodon.org/"
languageCode = "en-us"
defaultContentLanguage = "en"
title = "Mastodon documentation"
baseURL = "https://mastodon.d10n.wholetrans.org/"
languageCode = "zh-cn"
defaultContentLanguage = "zh-cn"
# To avoid alias conflict
defaultContentLanguageInSubdir = true
title = "Mastodon 文档"
pygmentsCodeFences = true
pygmentsStyle = "github-dark"
metaDataFormat = "yaml"
@ -106,22 +108,22 @@ disablePathToLower = true
[languages.zh-cn.menu]
[[languages.zh-cn.menu.docs]]
name = "使用Mastodon"
name = "使用 Mastodon"
weight = 10
identifier = "user"
url = "/user/"
[[languages.zh-cn.menu.docs]]
name = "运营Mastodon"
name = "运营 Mastodon"
weight = 20
identifier = "admin"
url = "/admin/"
[[languages.zh-cn.menu.docs]]
name = "开发Mastodon应用"
name = "开发 Mastodon 应用"
weight = 30
identifier = "client"
url = "/client/"
[[languages.zh-cn.menu.docs]]
name = "向Mastodon项目做贡献"
name = "向 Mastodon 项目做贡献"
weight = 40
identifier = "dev"
url = "/dev/"
@ -203,7 +205,7 @@ disablePathToLower = true
[languages.zh-cn]
contentDir = "content/zh-cn"
languageName = "简体中文"
weight = 1
weight = -100
[languages.ja]
contentDir = "content/ja"

View file

@ -19,6 +19,7 @@
<meta name="twitter:site" content="@joinmastodon">
<link rel="canonical" href="{{ .Permalink }}">
<script defer src="https://analytics.owu.one/script.js" data-website-id="4e29a638-07ed-4eb2-b1bd-f78fde617b35"></script>
</head>
<body>