> ## Documentation Index
> Fetch the complete documentation index at: https://ayakaleaf-pro.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 品牌定制

### 页眉

本节将介绍如何个性化本地部署实例的关键元素。你可以根据自己的偏好自定义站点标题、导航链接、页眉、页脚和 Logo。

### 站点标题

导航栏标题可通过 `OVERLEAF_NAV_TITLE` 环境变量自定义。如果未设置 Logo，该文本将显示在导航栏左上角。

```bash theme={null}
# add to config/variables.env
OVERLEAF_NAV_TITLE=Our Overleaf Instance
```

## Logo

你可以通过设置环境变量 `OVERLEAF_HEADER_IMAGE_URL` 使用自定义 Logo 代替文本。该值应指向一个外部托管的图片文件。

```bash title="config/variables.env" theme={null}
# add to config/variables.env
OVERLEAF_HEADER_IMAGE_URL=https://mysite.somewhere.com/img/logo.png
```

#### 浅色和深色主题 Logo

从 6.3.0 版本开始，你可以通过 `OVERLEAF_HEADER_IMAGE_URL_LIGHT` 和 `OVERLEAF_HEADER_IMAGE_URL_DARK` 环境变量分别为浅色和深色主题设置不同的 Logo。两个值都应指向外部托管的图片文件。

```text theme={null}
# add to config/variables.env
OVERLEAF_HEADER_IMAGE_URL_LIGHT=https://mysite.somewhere.com/img/logo-light.png
OVERLEAF_HEADER_IMAGE_URL_DARK=https://mysite.somewhere.com/img/logo-dark.png
```

<Info>
  如果其中任一变量未设置，对应主题将回退使用 `OVERLEAF_HEADER_IMAGE_URL` 中设置的 Logo。
</Info>

## 页眉导航链接

可以通过将 `OVERLEAF_HEADER_EXTRAS` 环境变量设置为 JSON 对象数组，在导航页眉中添加额外的导航项。例如：

```json wrap theme={null}
[\
  {\
    "text": "Some link",\
    "url": "http://example.com/somelink",\
    "class": "subdued",\
    "only_when_logged_out": true\
  },\
  {\
    "text": "Help",\
    "class": "subdued",\
    "dropdown": [\
      {\
        "text": "Documentation",\
        "url": "/learn"\
      },\
      {\
        "text": "Contact Admin",\
        "url": "http://example.com/contact"\
      }\
    ]\
  }\
]
```

将转义后的 JSON 添加到 toolkit/variables.env：

```bash title="toolkit/variables.env" wrap theme={null}
# add to toolkit/variables.env
OVERLEAF_HEADER_EXTRAS=[{"text":"Some link","url":"http://example.com/somelink","class":"subdued","only_when_logged_out":true},{"text":"Help","class":"subdued","dropdown":[{"text":"Documentation","url":"/learn"},{"text":"Contact Admin","url":"http://example.com/contact"}]}]
```

## 页脚

你可以使用环境变量 `OVERLEAF_LEFT_FOOTER` 和 `OVERLEAF_RIGHT_FOOTER` 自定义左侧页脚和较小的右侧页脚（出现在 `/project` 等页面上）。两者都需要一个将被插入的 JSON 对象数组。

两者都需要一个将被插入的 JSON 数组。

```json theme={null}
[\
  {\
    "text": "This is an example text footer entry!"\
  },\
  {\
    "text": "This is an example URL footer link!", "url" : "/my-first-link.htm"\
  }\
]
```

<Info>
  仅使用 `text` 时，其中不得包含 HTML，因为该值将以原始文本形式渲染。
</Info>

这些数据必须是有效的 JSON 才能生效，并且作为环境变量传递时需要对引号进行转义。

```bash title="config/variables.env" wrap theme={null}
# add to config/variables.env
OVERLEAF_LEFT_FOOTER=[{"text": "This is an example text footer entry!"}]
OVERLEAF_RIGHT_FOOTER=["text": "This is an example URL footer link!", "url" : "/my-first-link.htm"]
```

<Info>
  除 `text` 和 `url` 外，JSON 对象还支持 `class` 和 `label` 属性，用于进一步自定义。
</Info>

### 维护页面

你可以通过 `OVERLEAF_MAINTENANCE_MESSAGE` 环境变量自定义维护页面上显示的消息，该文本会替换页面标题下方的默认消息。

```text wrap theme={null}
# add to config/variables.env
OVERLEAF_MAINTENANCE_MESSAGE=Our Overleaf Instance is down for maintenance and will be back shortly.
```

如需包含链接或其他格式，请改用 `OVERLEAF_MAINTENANCE_MESSAGE_HTML`。如果两者都已设置，`OVERLEAF_MAINTENANCE_MESSAGE_HTML` 优先。

```text wrap theme={null}
# add to config/variables.env
OVERLEAF_MAINTENANCE_MESSAGE_HTML=Our Overleaf Instance is down for maintenance. For urgent requests, contact <a href="mailto:admin@example.com">admin@example.com</a>.
```

<Info>
  `OVERLEAF_MAINTENANCE_MESSAGE` 以纯文本形式渲染，因此**不得**包含 HTML。`OVERLEAF_MAINTENANCE_MESSAGE_HTML` 则以 HTML 形式渲染且不进行转义。
</Info>

如果两者都未设置，当设置了 `OVERLEAF_STATUS_PAGE_URL` 时，默认消息会链接到你的状态页面；否则会显示管理员邮箱地址。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.