Skip to content

Commit

Permalink
docs: add note for head attrs and base config (close #1412) (#1419)
Browse files Browse the repository at this point in the history
Co-authored-by: Xinyu Liu <meteor.lxy@foxmail.com>
  • Loading branch information
Mister-Hope and meteorlxy committed Oct 11, 2023
1 parent f342a86 commit 1254c79
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion docs/reference/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

You will need to set this if you plan to deploy your site under a sub path. It should always start and end with a slash. For example, if you plan to deploy your site to GitHub pages at `https://foo.github.io/bar/`, then you should set `base` to `"/bar/"`.

The `base` is automatically prepended to all the URLs that start with `/` in other options, so you only need to specify it once.
The `base` is automatically prepended to the URLs that start with `/` in other options, so you only need to specify it once. (Except for attrs of [head](#head))

Notice that `base` should be an absolute URL pathname starting and ending with `/` .

Expand Down Expand Up @@ -92,6 +92,8 @@

This can be specified in different locales.

Notice that if the `attrValue` is a pathname, it will be kept as-is without prepending [base](#base) automatically, so remember to prepend it manually if needed.

- Example:

To add a custom favicon:
Expand Down
4 changes: 3 additions & 1 deletion docs/zh/reference/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

如果你想让你的网站部署到一个子路径下,你将需要设置它。它的值应当总是以斜杠开始,并以斜杠结束。举例来说,如果你想将你的网站部署到 `https://foo.github.io/bar/`,那么 `base` 应该被设置成 `"/bar/"`

`base` 将会作为前缀自动地插入到所有以 `/` 开始的其他选项的链接中,所以你只需要指定一次。
`base` 将会作为前缀自动地插入到以 `/` 开始的其他选项的链接中,所以你只需要指定一次。[head](#head) 中的属性除外)

需要注意的是, `base` 应该是一个以 `/` 开始和结束的绝对路径名。

Expand Down Expand Up @@ -91,6 +91,8 @@

它可以设置在不同语言的 locales 中。

需要注意的是,如果 `attrValue` 是一个 pathname ,它不会被自动添加 [base](#base) 前缀,所以如果需要的话请记得手动添加前缀。

- 示例:

增加一个自定义的 favicon :
Expand Down

0 comments on commit 1254c79

Please sign in to comment.