Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n(zh-tw): Update guides/deploy/github.mdx #11011

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

510208
Copy link

@510208 510208 commented Feb 20, 2025

Description (required)

Update github.mdx (The file which help users deploy there's Astro website to GitHub Pages)

Note

This PR adds a Traditional Chinese guide for deploying an Astro website to GitHub Pages.

Related issues & labels (optional)

  • Closes #
  • Suggested label: i18n

First-time contributor to Astro Docs?

Yes, I love this project very much. But since I am not familiar with Javascript, I cannot provide any useful code.

My Discord username: @samhacker

@github-actions github-actions bot added the i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help! label Feb 20, 2025
Copy link

netlify bot commented Feb 20, 2025

Deploy Preview for astro-docs-2 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 60b16ea
🔍 Latest deploy log https://app.netlify.com/sites/astro-docs-2/deploys/67b93c9c37484c0008e2c969
😎 Deploy Preview https://deploy-preview-11011--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@astrobot-houston
Copy link
Contributor

astrobot-houston commented Feb 20, 2025

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
zh-tw/guides/deploy/github.mdx Localization added, will be marked as complete.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@astrobot-houston
Copy link
Contributor

Hello! Thank you for opening your first PR to Astro’s Docs! 🎉

Here’s what will happen next:

  1. Our GitHub bots will run to check your changes.
    If they spot any broken links you will see some error messages on this PR.
    Don’t hesitate to ask any questions if you’re not sure what these mean!

  2. In a few minutes, you’ll be able to see a preview of your changes on Netlify 🥳.

  3. One or more of our maintainers will take a look and may ask you to make changes.
    We try to be responsive, but don’t worry if this takes a few days.

@vrabe
Copy link
Contributor

vrabe commented Feb 20, 2025

@510208 你好,感謝你的翻譯,我試著檢查看看。

@510208
Copy link
Author

510208 commented Feb 21, 2025

@510208你好,感謝你的翻譯,我試著檢查看看。

OK,等囉~~

@510208 510208 closed this Feb 21, 2025
@510208 510208 reopened this Feb 21, 2025
Copy link
Member

@liruifengv liruifengv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感谢你的翻译,不知道我说中文简体你有没有障碍。

对于一些新增的部分,我认为不应该在翻译中添加,如果你认为添加这部分有必要的话,请单独提交一个英文原文修改的PR


你可以透過 [GitHub Actions](https://github.com/features/actions) 將你的 Astro 網站自動搭建並部署到 GitHub Pages 網站上。為了這麼做,你應該將你的網站原始碼託管至 GitHub。

Astro 維護了一個官方的 `withastro/action` 幫助你部署你的專案。按照下方的說明即可讓你快速將 Astro 網站部署進 GitHub pages,並請在需要更多資訊時,可以檢視[這個讀我檔案](https://github.com/withastro/action)。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的 ‘README’ 在我看来是不需要翻译的,但我不清楚在zh-tw 的语境中如何。

另外这里似乎缺少了 with very little configuration 的翻译


## 為 GitHub Pages 配置 Astro 專案

為了將 Astro 網站部署至 GitHub Pages,我們需要先對原本的 Astro 配置文件做些許變更。按照下方的說明即可,如果你不知道自己該怎麼做的話。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这一部分是所说的新加的部分?
我认为这里是不需要的。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以看一下这里的写作指南部分,https://contribute.docs.astro.build/guides/writing-style/


請確保你的 `site` 值應為以下的其中之一:

- 以你的使用者名稱產生的 GitHub.io 網址,如:`https://<username>.github.io`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个 Github.io 我认为也是多余的

import { defineConfig } from 'astro/config'

export default defineConfig({
site: 'https://astronaut.github.io', // 你的 GitHub Pages 網址
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里注释也是多余的,因为下面有具体的说明

sub.mydomain.com
```

這會將你的網站部署在你所指定的自訂網域名稱下,而非 `<YOUR_USERNAME>.github.io`。另外,絕對不要忘記在你的網域名稱供應商(如:GoDaddy、Namecheap 等)中設定一個 CNAME 記錄,如果需要詳細的資訊可以檢視 [為你的域名提供商設定 GitHub Pages](https://docs.github.com/cn/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site#configuring-a-subdomain)。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里我认为也是不需要的,不要在翻译上为原文增加补充说明,如果你认为是有必要的话,可以再单独提交一个 PR 对英文原文进行修改

import { defineConfig } from 'astro/config'

export default defineConfig({
site: 'https://example.com', // 你的自訂網域名稱
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里也不需要注释

:::

:::caution
官方提供的 Astro [GitHub Action](https://github.com/withastro/action) 會透過掃描根目錄下的 lockfile 來檢查你所使用的 Package Manager(如`npm`, `yarn`, `pnpm`, or `bun`)。正因如此,你應該將包管理器自動產生的 `package-lock.json`、`yarn.lock`、`pnpm-lock.yaml` 或是 `bun.lockb` 檔案一起提交至你的儲存庫中,不要加入 `.gitignore` 或用其他方式遺漏這些檔案。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里下面的一句提示也是多余的

官方提供的 Astro [GitHub Action](https://github.com/withastro/action) 會透過掃描根目錄下的 lockfile 來檢查你所使用的 Package Manager(如`npm`, `yarn`, `pnpm`, or `bun`)。正因如此,你應該將包管理器自動產生的 `package-lock.json`、`yarn.lock`、`pnpm-lock.yaml` 或是 `bun.lockb` 檔案一起提交至你的儲存庫中,不要加入 `.gitignore` 或用其他方式遺漏這些檔案。
:::

2. 在 GitHub 網站上,請切換到儲存庫中的 **Settings** 分頁,並切換進左邊的 **Code and automation** 分類中的 **Pages** 部分。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1,如认为有必要,请提交英文PR


2. 在 GitHub 網站上,請切換到儲存庫中的 **Settings** 分頁,並切換進左邊的 **Code and automation** 分類中的 **Pages** 部分。

3. 選擇 **GitHub Actions** 作為設定中的 **Source** ,並單按 **Save**儲存設定。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

4. 將先前設定好的 workflow file 提交(Commit)並推送(Push)到 GitHub。
</Steps>

恭喜你!如此一來,你的 Astro 網站就會自動部署到 GitHub Pages 上了。並且如果你更改了你的網站原始碼並推送到前述的儲存庫,GitHub Actions 會自動重新構建並部署你的網站,你不需要手動構建和部署。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
恭喜你!如此一來,你的 Astro 網站就會自動部署到 GitHub Pages 上了。並且如果你更改了你的網站原始碼並推送到前述的儲存庫,GitHub Actions 會自動重新構建並部署你的網站,你不需要手動構建和部署
恭喜你!如此一來,你的 Astro 網站就會自動部署到 GitHub Pages 上了。並且如果你更改了你的網站原始碼並推送到前述的儲存庫,GitHub Action 會自動重新構建並部署你的網站。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants