Skip to content

Commit

Permalink
docs: add title separator
Browse files Browse the repository at this point in the history
  • Loading branch information
wangchucheng committed Jan 24, 2021
1 parent e3b5dfa commit a18edd6
Show file tree
Hide file tree
Showing 2 changed files with 257 additions and 69 deletions.
166 changes: 128 additions & 38 deletions en/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,17 @@ You can define the content of the web page navigation bar simply and quickly. In

It should be noted that the order of the navigation bar is in ascending order of the size of `weight`.

## Homepage
## Math

By default, Eureka's homepage consists of two pictures and a slogan. You can easily customize the content of the picture and the slogan. In `config/_default/params.toml`, you can customize the content of the `hero` module. The parameters in the `hero` module are as follows:
Eureka supports the use of KaTeX to render LaTeX mathematical formulas. If you need to configure KaTeX, you only need to configure the `[math]` in `config/_default/params.toml`.

- **slogan(string)**:Homepage slogan.
- **imgLeft(string)**:For the image on the left side of the homepage, please refer to [Load Picture](../content-management/#image-loading) for the setting method.
- **imgRight(string)**:For the image on the right side of the homepage, please refer to [Load Picture](../content-management/#image-loading) for the setting method.
**math.handler(string)**

## Math
The optional value is katex, leave it blank to disable this feature.

Eureka supports the use of KaTeX to render LaTeX mathematical formulas. If you need to configure KaTeX, you only need to configure the `[math]` in `config/_default/params.toml`.
**math.katex(object)**

- **handler(string)**: The optional value is katex, leave it blank to disable this feature.
- **math.katex(object)**: KaTeX related configuration. For specific optional values, please refer to: [Options · KaTeX](https://katex.org/docs/options.html). Since Eureka uses KaTeX's auto-render extension, the `displayMode` property in the link will be ignored.
KaTeX related configuration. For specific optional values, please refer to: [Options · KaTeX](https://katex.org/docs/options.html). Since Eureka uses KaTeX's auto-render extension, the `displayMode` property in the link will be ignored.

Eureka also supports independent configuration of whether to render math formula for each page or section. For example, you have a project with the following file structure:

Expand Down Expand Up @@ -92,42 +89,135 @@ Currently Eureka supports two types of comment systems, Disqus and Commento. To

Some basic configurations are defined in `config/_default/config.toml` to help you set up some basic functions of the website. This chapter will not cover the content already contained in the previous article.

- **baseURL(string)**: The root domain name of the site.
- **title(string)**: Site title.
- **theme(string)**: The theme used on the site.
- **paginate(int)**: The number of content per page.
- **copyright(string)**: The site copyright statement will appear at the bottom of the page.
- **enableGitInfo(bool)**: Whether to use git information. The default is `false`.
- **enableEmoji(bool)**: Whether to use emoji, the default is `false`.
- **summaryLength(int)**: Summary length, the default is 70.
- **defaultContentLanguage(string)**: The language code of the default language.
- **hasCJKLanguage(bool)**: Whether to include Chinese, Japanese, and Korean content, the default is `false`.
- **defaultContentLanguageInSubdir(bool)**: Whether the default language is under the sub-link when multilingual, for example, when the default language is `en`, `/` will be redirected to `/en/`.
- **googleAnalytics(string)**: Google Analytics code. Starting from `0.2.1`, Google Analytics is only generated in the production environment. If you want to preview in the development environment, you need to set the Hugo environment variable to `production`.
- **markup.tableOfContents(object)**: Table of contents rendering method.
- **startLevel(int)**: Start title level of the table of contents.
- **endLevel(int)**: End title level of the table of contents.
- **ordered(bool)**: Whether to generate an ordered list.
- **taxonomies(object)**: All taxonomies in the website.
- **build(object)**: Build settings.
- **useResourceCacheWhen(string)**: Use cache files for rendering. If there are no special circumstances, please keep `always`.
**baseURL(string)**

The root domain name of the site.

**title(string)**

Site title.

**theme(string)**

The theme used on the site.

**paginate(int)**

The number of content per page.

**copyright(string)**

The site copyright statement will appear at the bottom of the page.

**enableGitInfo(bool)**

Whether to use git information. The default is `false`.

**enableEmoji(bool)**

Whether to use emoji, the default is `false`.

**summaryLength(int)**

Summary length, the default is 70.

**defaultContentLanguage(string)**

The language code of the default language.

**hasCJKLanguage(bool)**

Whether to include Chinese, Japanese, and Korean content, the default is `false`.

**defaultContentLanguageInSubdir(bool)**

Whether the default language is under the sub-link when multilingual, for example, when the default language is `en`, `/` will be redirected to `/en/`.

**googleAnalytics(string)**

Google Analytics code. Starting from `0.2.1`, Google Analytics is only generated in the production environment. If you want to preview in the development environment, you need to set the Hugo environment variable to `production`.

**markup.tableOfContents(object)**

Table of contents rendering method.

**markup.tableOfContents.startLevel(int)**

Start title level of the table of contents.

**markup.tableOfContents.endLevel(int)**

End title level of the table of contents.

**markup.tableOfContents.ordered(bool)**

Whether to generate an ordered list.

**taxonomies(object)**

All taxonomies in the website.

**build(object)**

Build settings.

**build.useResourceCacheWhen(string)**

Use cache files for rendering. If there are no special circumstances, please keep `always`.

In addition, Hugo also has some predefined basic configurations. For details, please refer to [Configure Hugo](https://gohugo.io/getting-started/configuration/).

## Params Config File

In addition to the basic configuration, you can also set some params provided by Eureka. This chapter will not cover the content already contained in the previous article.

- **mainSections(list)**:The types in the list will be displayed on the homepage.
- **description(string)**:The description of the site.
- **repoURL(string)**:Project repository URL.
- **repoEditURL(string)**:Edit the URL of the current page content, if the project repository is on Github, it can be empty.
- **dateFormat(string)**: The format of the date displayed on the website. The config should meet the [corresponding format](https://gohugo.io/functions/format/#gos-layout-string) of Golang.
- **colorScheme(string)**: The default color scheme of the website. Optional values are `auto`, `light` and `dark`. Leave blank as `auto`.
- **siteType(string)**:Site type.
- **icon(string)**:Site icon, please refer to [Image Loading](../content-management/#image-loading)
- **publisherName(string)**:Publisher name.
- **publisherLogo(string)**:Publisher icon, when empty is the site icon.
**mainSections(list)**

The types in the list will be displayed on the homepage.

**description(string)**

The description of the site.

**repoURL(string)**

Project repository URL.

**repoEditURL(string)**

Edit the URL of the current page content, if the project repository is on Github, it can be empty.

**titleSeparator(string/list)**

Set the separator of the page title. The default value is `|`.

If you only need a single-level separator, enter it as a string. For example, enter `titleSeparator = "-"` and the title of the page will be similar to `Eureka - Tech Mansion`.

If multiple levels of separators are required, enter them as a list. For example, enter `titleSeparator = ["|", "-"]` and it will be displayed as `Homepage Configuration - Eureka | Tech Mansion` in titles which requires multiple levels. Others will display as `Eureka | Tech Mansion`.

**dateFormat(string)**

The format of the date displayed on the website. The config should meet the [corresponding format](https://gohugo.io/functions/format/#gos-layout-string) of Golang.

**colorScheme(string)**

The default color scheme of the website. Optional values are `auto`, `light` and `dark`. Leave blank as `auto`.

**siteType(string)**

Site type.

**icon(string)**

Site icon, please refer to [Image Loading](../content-management/#image-loading).

**publisherName(string)**

Publisher name.

**publisherLogo(string)**

Publisher icon, when empty is the site icon.

---

Expand Down
160 changes: 129 additions & 31 deletions zh/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,13 @@ aliases = ["customize-eureka"]

Eureka支持使用KaTeX渲染LaTeX数学公式。如需配置KaTeX,只需对`config/_default/params.toml`中的`[math]`进行相关配置即可。

- **handler(string)**:可选值为katex,留空则不启用该功能。
- **math.katex(object)**:KaTeX相关配置。具体可选值可参考:[Options · KaTeX](https://katex.org/docs/options.html)。由于Eureka使用了KaTeX的自动渲染拓展,因此链接中的`displayMode`属性将会被忽略。
**math.handler(string)**

可选值为katex,留空则不启用该功能。

**math.katex(object)**

KaTeX相关配置。具体可选值可参考:[Options · KaTeX](https://katex.org/docs/options.html)。由于Eureka使用了KaTeX的自动渲染拓展,因此链接中的`displayMode`属性将会被忽略。

Eureka也支持对每个界面是否启动数学公式渲染进行单独配置。例如你有以下文件结构的项目:

Expand Down Expand Up @@ -84,42 +89,135 @@ content/

`config/_default/config.toml`中定义了部分基本配置,帮助你设置网站的一些基础功能。本章节将不涉及前文已包含的内容。

- **baseURL(string)**:网站根域名。
- **title(string)**:网站标题。
- **theme(string)**:网站使用的主题。
- **paginate(int)**:每页内容数量。
- **copyright(string)**:网站版权声明,会出现在网页最下方。
- **enableGitInfo(bool)**:是否使用git信息。默认为`false`
- **enableEmoji(bool)**:是否使用emoji,默认为`false`
- **summaryLength(int)**:概要长度,默认为70。
- **defaultContentLanguage(string)**:默认语言的语言代码。
- **hasCJKLanguage(bool)**:是否包含中文、日语、韩语内容,默认为`false`
- **defaultContentLanguageInSubdir(bool)**:多语言时默认语言是否处在子链接下,例如默认语言为`zh`时,`/`将会被重定向至`/zh/`
- **googleAnalytics(string)**:Google Analytics代码。从`0.2.1`开始,Google Analytics只在生产环境中生成。如果你想在开发环境中预览,你需要设置Hugo环境变量为`production`
- **markup.tableOfContents(object)**:内容目录渲染方式。
- **startLevel(int)**:开始渲染目录的标题层级。
- **endLevel(int)**:结束渲染目录的标题层级。
- **ordered(bool)**:是否生成有序列表。
- **taxonomies(object)**:网站中的所有Taxonomies。
- **build(object)**:构建设置。
- **useResourceCacheWhen(string)**:使用缓存文件进行渲染,如无特殊情况请保持`always`
**baseURL(string)**

网站根域名。

**title(string)**

网站标题。

**theme(string)**

网站使用的主题。

**paginate(int)**

每页内容数量。

**copyright(string)**

网站版权声明,会出现在网页最下方。

**enableGitInfo(bool)**

是否使用git信息。默认为`false`

**enableEmoji(bool)**

是否使用emoji,默认为`false`

**summaryLength(int)**

概要长度,默认为70。

**defaultContentLanguage(string)**

默认语言的语言代码。

**hasCJKLanguage(bool)**

是否包含中文、日语、韩语内容,默认为`false`

**defaultContentLanguageInSubdir(bool)**

多语言时默认语言是否处在子链接下,例如默认语言为`zh`时,`/`将会被重定向至`/zh/`

**googleAnalytics(string)**

Google Analytics代码。从`0.2.1`开始,Google Analytics只在生产环境中生成。如果你想在开发环境中预览,你需要设置Hugo环境变量为`production`

**markup.tableOfContents(object)**

内容目录渲染方式。

**markup.tableOfContents.startLevel(int)**

开始渲染目录的标题层级。

**markup.tableOfContents.endLevel(int)**

结束渲染目录的标题层级。

**markup.tableOfContents.ordered(bool)**

是否生成有序列表。

**taxonomies(object)**

网站中的所有Taxonomies。

**build(object)**

构建设置。

**build.useResourceCacheWhen(string)**

使用缓存文件进行渲染,如无特殊情况请保持`always`

除此之外,Hugo还有一些预定义的基本配置,具体可参考[Configure Hugo](https://gohugo.io/getting-started/configuration/)

## 参数配置文件

除了基本配置外,你还可以设置一些Eureka提供的属性。本章节将不涉及前文已包含的内容。

- **mainSections(list)**:列表中的类型将会显示在首页上。
- **description(string)**:网站的描述。
- **repoURL(string)**:项目仓库网址。
- **repoEditURL(string)**:编辑当页内容的网址,如果项目仓库在Github上可为空。
- **dateFormat(string)**:网站中显示日期的格式,配置应满足Go语言的[相应格式](https://gohugo.io/functions/format/#gos-layout-string)
- **colorScheme(string)**:网站默认颜色模式。可选值为`auto``light``dark`。留空为`auto`
- **siteType(string)**:网站类型。
- **icon(string)**:网站图标,设置方式可参考[加载图片](../content-management/#加载图片)
- **publisherName(string)**:发布者姓名。
- **publisherLogo(string)**:发布者图标,为空则为网站图标。
**mainSections(list)**

列表中的类型将会显示在首页上。

**description(string)**

网站的描述。

**repoURL(string)**

项目仓库网址。

**repoEditURL(string)**

编辑当页内容的网址,如果项目仓库在Github上可为空。

**titleSeparator(string/list)**

设置网页标题的分隔符。默认值为`|`

如只需单层次的分隔符则以字符串形式输入。例如输入`titleSeparator = "-"`则网页标题将类似于`Eureka - 技术公馆`

如需多层次的分隔符则以列表形式输入,例如输入`titleSeparator = ["|", "-"]`则在需要多层次的标题中将显示为`主页配置 - Eureka | 技术公馆`。其他位置将显示为`Eureka | 技术公馆`

**dateFormat(string)**

网站中显示日期的格式,配置应满足Go语言的[相应格式](https://gohugo.io/functions/format/#gos-layout-string)

**colorScheme(string)**

网站默认颜色模式。可选值为`auto``light``dark`。留空为`auto`

**siteType(string)**

网站类型。

**icon(string)**

网站图标,设置方式可参考[加载图片](../content-management/#加载图片)

**publisherName(string)**

发布者姓名。

**publisherLogo(string)**

发布者图标,为空则为网站图标。

---

Expand Down

0 comments on commit a18edd6

Please sign in to comment.