Skip to content

docs: Update default-theme-config.md #2645

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/docs/docs/theme/default-theme-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,9 @@ Note that it’s `off` by default. If given a `string`, it will be displayed as
Since `lastUpdated` is based on `git`, you can only use it in a `git` repository. Also, since the timestamp used comes from the git commit, it will display only after a first commit for a given page, and update only on ensuing commits of that page.
:::

::: warning
If you are using a CI system for auto build & deploy, make sure it is fetching the whole history of your repository. For example, using `fetch-depth: 0` in GitHub Actions `actions/checkout@v2`, which is `1` by default and will cause wrong update times.
:::

**Also see:**

Expand Down
4 changes: 4 additions & 0 deletions packages/docs/docs/zh/theme/default-theme-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,10 @@ module.exports = {
由于 `lastUpdated` 是基于 `git` 的, 所以你只能在一个基于 `git` 的项目中启用它。此外,由于使用的时间戳来自 git commit,因此它将仅在给定页的第一次提交之后显示,并且仅在该页面后续提交更改时更新。
:::

::: warning 使用须知
如果你使用了自动构建及部署的 CI 系统,请确保它拉取了 Git 仓库的所有历史记录。比如,在 GitHub Actions `actions/checkout@v2` 中使用 `fetch-depth: 0` 参数(默认为 `1`,会导致生成的更新时间有误)。
:::

**拓展阅读:**

- [@vuepress/plugin-last-updated](../plugin/official/plugin-last-updated.md)
Expand Down