mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-24 15:28:54 +00:00
Remove translations
The english content remains in content/en.
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
b3b900f3fc
commit
3a22ee7d6e
@@ -1,10 +1,4 @@
|
||||
|
||||
[en]
|
||||
contentDir = "content/en"
|
||||
languageName = "English"
|
||||
weight = 1
|
||||
|
||||
[zh]
|
||||
contentDir = "content/zh"
|
||||
languageName = "中文"
|
||||
weight = 2
|
||||
[en]
|
||||
contentDir = "content/en"
|
||||
languageName = "English"
|
||||
weight = 1
|
||||
|
||||
@@ -1,121 +0,0 @@
|
||||
|
||||
# Chinese menus
|
||||
|
||||
[[docs]]
|
||||
name = "关于 Hugo"
|
||||
weight = 1
|
||||
identifier = "about"
|
||||
url = "/zh/about/"
|
||||
|
||||
[[docs]]
|
||||
name = "入门"
|
||||
weight = 5
|
||||
identifier = "getting-started"
|
||||
url = "/zh/getting-started/"
|
||||
|
||||
[[docs]]
|
||||
name = "主题"
|
||||
weight = 15
|
||||
identifier = "themes"
|
||||
post = "break"
|
||||
url = "/zh/themes/"
|
||||
|
||||
# Core languages.zh.menus
|
||||
|
||||
[[docs]]
|
||||
name = "内容管理"
|
||||
weight = 20
|
||||
identifier = "content-management"
|
||||
post = "expanded"
|
||||
url = "/zh/content-management/"
|
||||
|
||||
[[docs]]
|
||||
name = "模板"
|
||||
weight = 25
|
||||
identifier = "templates"
|
||||
url = "/zh/templates/"
|
||||
|
||||
[[docs]]
|
||||
name = "函数"
|
||||
weight = 30
|
||||
identifier = "functions"
|
||||
url = "/zh/functions/"
|
||||
|
||||
[[docs]]
|
||||
name = "变量"
|
||||
weight = 35
|
||||
identifier = "variables"
|
||||
url = "/zh/variables/"
|
||||
|
||||
[[docs]]
|
||||
name = "CLI"
|
||||
weight = 40
|
||||
post = "break"
|
||||
identifier = "commands"
|
||||
url = "/commands/"
|
||||
|
||||
# LOW LEVEL ITEMS
|
||||
[[docs]]
|
||||
name = "故障排除"
|
||||
weight = 60
|
||||
identifier = "troubleshooting"
|
||||
url = "/zh/troubleshooting/"
|
||||
|
||||
[[docs]]
|
||||
name = "工具"
|
||||
weight = 70
|
||||
identifier = "tools"
|
||||
url = "/zh/tools/"
|
||||
|
||||
[[docs]]
|
||||
name = "托管与部署"
|
||||
weight = 80
|
||||
identifier = "hosting-and-deployment"
|
||||
url = "/zh/hosting-and-deployment/"
|
||||
|
||||
[[docs]]
|
||||
name = "贡献"
|
||||
weight = 100
|
||||
post = "break"
|
||||
identifier = "contribute"
|
||||
url = "/zh/contribute/"
|
||||
|
||||
[[global]]
|
||||
name = "新闻"
|
||||
weight = 1
|
||||
identifier = "news"
|
||||
url = "/zh/news/"
|
||||
|
||||
[[global]]
|
||||
name = "文档"
|
||||
weight = 5
|
||||
identifier = "docs"
|
||||
url = "/zh/documentation/"
|
||||
|
||||
[[global]]
|
||||
name = "主题"
|
||||
weight = 10
|
||||
identifier = "themes"
|
||||
url = "https://themes.gohugo.io/"
|
||||
|
||||
[[global]]
|
||||
name = "作品展示"
|
||||
weight = 20
|
||||
identifier = "showcase"
|
||||
url = "/zh/showcase/"
|
||||
|
||||
# Anything with a weight > 100 gets an external icon
|
||||
[[global]]
|
||||
name = "社区"
|
||||
weight = 150
|
||||
icon = true
|
||||
identifier = "community"
|
||||
post = "external"
|
||||
url = "https://discourse.gohugo.io/"
|
||||
|
||||
[[global]]
|
||||
name = "GitHub"
|
||||
weight = 200
|
||||
identifier = "github"
|
||||
post = "external"
|
||||
url = "https://github.com/gohugoio/hugo"
|
||||
@@ -1,49 +0,0 @@
|
||||
---
|
||||
title: "世界上最快的网站构建框架"
|
||||
date: 2017-03-02T12:00:00-05:00
|
||||
features:
|
||||
- heading: 飞快的速度
|
||||
image_path: /images/icon-fast.svg
|
||||
tagline: 摩登发布
|
||||
copy: Hugo 是同类中最快的工具。生成一页小于 1ms,生成一个站点平均不超过 1s。
|
||||
|
||||
- heading: 强大的内容管理
|
||||
image_path: /images/icon-content-management.svg
|
||||
tagline: 灵活的规则。Hugo 是一个设计师的梦想。
|
||||
copy: Hugo 支持无限的内容类型、分类、菜单、动态 API 驱动的内容,以及更多,都不需要插件。
|
||||
|
||||
- heading: 短代码
|
||||
image_path: /images/icon-shortcodes.svg
|
||||
tagline: Hugo 短代码是 Markdown 隐藏的强大功能。
|
||||
copy: 我们喜欢美丽简洁的 markdown 语法,但是有时候我们也想要更灵活一些。Hugo 短代码允许既美丽又灵活。
|
||||
|
||||
- heading: 内置模板
|
||||
image_path: /images/icon-built-in-templates.svg
|
||||
tagline: Hugo 有通用的模式让你快速的完成工作。
|
||||
copy: Hugo 平台预置的模板会快速实现搜索引擎优化、评论、分析和其他的功能。一行代码,你就完成了。
|
||||
|
||||
- heading: 多语言和国际化
|
||||
image_path: /images/icon-multilingual2.svg
|
||||
tagline: 多语言制作
|
||||
copy: Hugo 为多语言站点提供了完整的国际化支持,并且具有与 Hugo 用户在单语言站点中喜爱的相同的简单开发体验。
|
||||
|
||||
- heading: 自定义输出
|
||||
image_path: /images/icon-custom-outputs.svg
|
||||
tagline: HTML 不够用吗?
|
||||
copy: Hugo 允许您以多种格式输出内容,包括 JSON 或 AMP,并且可以很容易地创建自己的内容。
|
||||
sections:
|
||||
- heading: "100 多个主题"
|
||||
cta: 看看 Hugo 的主题
|
||||
link: https://themes.gohugo.io/
|
||||
color_classes: bg-accent-color white
|
||||
image: /images/homepage-screenshot-hugo-themes.jpg
|
||||
copy: "Hugo 提供了一个强大的主题系统,易于实现,但能够生成即使是最复杂的网站。"
|
||||
- heading: "功能模板"
|
||||
cta: 开始吧。
|
||||
link: templates/
|
||||
color_classes: bg-primary-color-light black
|
||||
image: /images/home-page-templating-example.png
|
||||
copy: "Hugo 基于 Go 的模板提供了恰当的方法来生成从简单到复杂的任何东西。如果你喜欢 Jade/Pug 类似的语法,你也可以使用 Amber、Ace 或三种任意组合。"
|
||||
---
|
||||
|
||||
Hugo 是最受欢迎的开源静态站点生成器之一。凭借惊人的速度和灵活性,Hugo 使建设网站的乐趣再现。
|
||||
@@ -1,20 +0,0 @@
|
||||
---
|
||||
title: 关于 Hugo
|
||||
linktitle: 概览
|
||||
description: Hugo 的特色、规划、许可和动力。
|
||||
date: 2018-04-26
|
||||
publishdate: 2018-04-26
|
||||
lastmod: 2018-04-26
|
||||
categories: []
|
||||
keywords: []
|
||||
menu:
|
||||
docs:
|
||||
parent: "about"
|
||||
weight: 1
|
||||
weight: 1
|
||||
draft: false
|
||||
aliases: [/about-hugo/,/docs/]
|
||||
toc: false
|
||||
---
|
||||
|
||||
Hugo 不是一般的静态网站生成器。
|
||||
@@ -1,20 +0,0 @@
|
||||
---
|
||||
title: 内容管理
|
||||
linkTitle: 内容管理概览
|
||||
description: Hugo 可以管理大型的静态网站,支持骨架、内容类型、菜单、引用、概要等等。
|
||||
date: 2018-04-23
|
||||
publishdate: 2018-04-23
|
||||
lastmod: 2018-04-23
|
||||
menu:
|
||||
docs:
|
||||
parent: content-management
|
||||
weight: 1
|
||||
keywords: [source, organization]
|
||||
categories: [content management]
|
||||
weight: 01 #rem
|
||||
aliases: [/content/,/content/organization]
|
||||
toc: false
|
||||
isCJKLanguage: true
|
||||
---
|
||||
|
||||
一个实用的静态网站生成器,需要超越“文件头” (front matter) 和模板的等基本功能,才能兼备可伸缩性和可管理性,满足用户所需。Hugo 不仅是给开发者设计的,也同样适用于内容管理员和写作人员。
|
||||
@@ -1,21 +0,0 @@
|
||||
---
|
||||
title: Hugo 说明文档
|
||||
linktitle: Hugo
|
||||
description: Hugo 是世界上最快的静态网站引擎。它是用 Go (即 Golang) 编程语言所写成,由 bep、spf13 和朋友们共同开发。
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
menu:
|
||||
main:
|
||||
parent: "section name"
|
||||
weight: 01
|
||||
weight: 01 #rem
|
||||
draft: false
|
||||
slug:
|
||||
aliases: []
|
||||
toc: false
|
||||
layout: documentation-home
|
||||
isCJKLanguage: true
|
||||
---
|
||||
Hugo 是世界上最快的静态网站引擎。它是用 Go (即 Golang) 编程语言所写成,由 [bep](https://github.com/bep)、[spf13](https://github.com/spf13) 和[朋友们](https://github.com/gohugoio/hugo/graphs/contributors)共同开发。
|
||||
|
||||
下面是我们说明文档中最常用和实用的章节:
|
||||
@@ -1,4 +0,0 @@
|
||||
---
|
||||
title: "Hugo 新闻"
|
||||
aliases: [/release-notes/]
|
||||
---
|
||||
@@ -1,19 +0,0 @@
|
||||
---
|
||||
title: 模板 Templates
|
||||
linktitle: 模板概览
|
||||
description: Go templating, template types and lookup order, shortcodes, and data.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
menu:
|
||||
docs:
|
||||
parent: "templates"
|
||||
weight: 01
|
||||
weight: 01 #rem
|
||||
categories: [templates]
|
||||
keywords: []
|
||||
draft: false
|
||||
aliases: [/templates/overview/,/templates/content]
|
||||
toc: false
|
||||
notesforauthors:
|
||||
---
|
||||
@@ -1,131 +0,0 @@
|
||||
---
|
||||
title: Base 模板 and Blocks
|
||||
linktitle:
|
||||
description: The base and block constructs allow you to define the outer shell of your master templates (i.e., the chrome of the page).
|
||||
date: 2017-02-01
|
||||
publishdate: 2018-08-11
|
||||
lastmod: 2017-02-01
|
||||
categories: [templates,fundamentals]
|
||||
keywords: [blocks,base]
|
||||
menu:
|
||||
docs:
|
||||
parent: "templates"
|
||||
weight: 20
|
||||
weight: 20
|
||||
sections_weight: 20
|
||||
draft: false
|
||||
aliases: [/templates/blocks/,/templates/base-templates-and-blocks/]
|
||||
toc: true
|
||||
---
|
||||
|
||||
The `block` keyword allows you to define the outer shell of your pages' one or more master template(s) and then fill in or override portions as necessary.
|
||||
|
||||
{{< youtube QVOMCYitLEc >}}
|
||||
|
||||
## Base Template Lookup Order
|
||||
|
||||
The [lookup order][lookup] for base templates is as follows:
|
||||
|
||||
1. `/layouts/section/<TYPE>-baseof.html`
|
||||
2. `/themes/<THEME>/layouts/section/<TYPE>-baseof.html`
|
||||
3. `/layouts/<TYPE>/baseof.html`
|
||||
4. `/themes/<THEME>/layouts/<TYPE>/baseof.html`
|
||||
5. `/layouts/section/baseof.html`
|
||||
6. `/themes/<THEME>/layouts/section/baseof.html`
|
||||
7. `/layouts/_default/<TYPE>-baseof.html`
|
||||
8. `/themes/<THEME>/layouts/_default/<TYPE>-baseof.html`
|
||||
9. `/layouts/_default/baseof.html`
|
||||
10. `/themes/<THEME>/layouts/_default/baseof.html`
|
||||
|
||||
Variables are denoted by capitalized text set within `<>`. Note that Hugo's default behavior is for `type` to inherit from `section` unless otherwise specified.
|
||||
|
||||
### Example Base Template Lookup Order
|
||||
|
||||
As an example, let's assume your site is using a theme called "mytheme" when rendering the section list for a `posts` section. Hugo picks `layout/section/posts.html` as the template for [rendering the section]. The `{{define}}` block in this template tells Hugo that the template is an extension of a base template.
|
||||
|
||||
Here is the lookup order for the `posts` base template:
|
||||
|
||||
1. `/layouts/section/posts-baseof.html`
|
||||
2. `/themes/mytheme/layouts/section/posts-baseof.html`
|
||||
3. `/layouts/posts/baseof.html`
|
||||
4. `/themes/mytheme/layouts/posts/baseof.html`
|
||||
5. `/layouts/section/baseof.html`
|
||||
6. `/themes/mytheme/layouts/section/baseof.html`
|
||||
7. `/layouts/_default/posts-baseof.html`
|
||||
8. `/themes/mytheme/layouts/_default/posts-baseof.html`
|
||||
9. `/layouts/_default/baseof.html`
|
||||
10. `/themes/mytheme/layouts/_default/baseof.html`
|
||||
|
||||
## Define the Base Template
|
||||
|
||||
The following defines a simple base template at `_default/baseof.html`. As a default template, it is the shell from which all your pages will be rendered unless you specify another `*baseof.html` closer to the beginning of the lookup order.
|
||||
|
||||
{{< code file="layouts/_default/baseof.html" download="baseof.html" >}}
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>{{ block "title" . }}
|
||||
<!-- Blocks may include default content. -->
|
||||
{{ .Site.Title }}
|
||||
{{ end }}</title>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Code that all your templates share, like a header -->
|
||||
{{ block "main" . }}
|
||||
<!-- The part of the page that begins to differ between templates -->
|
||||
{{ end }}
|
||||
{{ block "footer" . }}
|
||||
<!-- More shared code, perhaps a footer but that can be overridden if need be in -->
|
||||
{{ end }}
|
||||
</body>
|
||||
</html>
|
||||
{{< /code >}}
|
||||
|
||||
## Override the Base Template
|
||||
|
||||
From the above base template, you can define a [default list template][hugolists]. The default list template will inherit all of the code defined above and can then implement its own `"main"` block from:
|
||||
|
||||
{{< code file="layouts/_default/list.html" download="list.html" >}}
|
||||
{{ define "main" }}
|
||||
<h1>Posts</h1>
|
||||
{{ range .Pages }}
|
||||
<article>
|
||||
<h2>{{ .Title }}</h2>
|
||||
{{ .Content }}
|
||||
</article>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{< /code >}}
|
||||
|
||||
This replaces the contents of our (basically empty) "main" block with something useful for the list template. In this case, we didn't define a `"title"` block, so the contents from our base template remain unchanged in lists.
|
||||
|
||||
{{% warning %}}
|
||||
Code that you put outside the block definitions *can* break your layout. This even includes HTML comments. For example:
|
||||
|
||||
```
|
||||
<!-- Seemingly harmless HTML comment..that will break your layout at build -->
|
||||
{{ define "main" }}
|
||||
...your code here
|
||||
{{ end }}
|
||||
```
|
||||
[See this thread from the Hugo discussion forums.](https://discourse.gohugo.io/t/baseof-html-block-templates-and-list-types-results-in-empty-pages/5612/6)
|
||||
{{% /warning %}}
|
||||
|
||||
The following shows how you can override both the `"main"` and `"title"` block areas from the base template with code unique to your [default single page template][singletemplate]:
|
||||
|
||||
{{< code file="layouts/_default/single.html" download="single.html" >}}
|
||||
{{ define "title" }}
|
||||
<!-- This will override the default value set in baseof.html; i.e., "{{.Site.Title}}" in the original example-->
|
||||
{{ .Title }} – {{ .Site.Title }}
|
||||
{{ end }}
|
||||
{{ define "main" }}
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ .Content }}
|
||||
{{ end }}
|
||||
{{< /code >}}
|
||||
|
||||
[hugolists]: /templates/lists
|
||||
[lookup]: /templates/lookup-order/
|
||||
[rendering the section]: /templates/section-templates/
|
||||
[singletemplate]: /templates/single-page-templates/
|
||||
@@ -1,25 +0,0 @@
|
||||
---
|
||||
title: 开发者工具
|
||||
linktitle: 开发者工具概览
|
||||
description: 除了 Hugo 强大的命令外,对于 Hugo 开发者还有大量社区开发的工具链。
|
||||
date: 2018-05-29
|
||||
publishdate: 2018-05-29
|
||||
lastmod: 2018-05-29
|
||||
categories: [developer tools]
|
||||
keywords: []
|
||||
menu:
|
||||
docs:
|
||||
parent: "tools"
|
||||
weight: 01
|
||||
weight: 01
|
||||
sections_weight: 01
|
||||
draft: false
|
||||
aliases: [/tools/]
|
||||
---
|
||||
|
||||
Hugo 最强大的在于它是活跃的——并总在发展的——开发者社区。除了在[语法高亮][syntax] 中提到的 `highlight` 简码外,该章节中的这些工具和其它项目特色都是由商业服务和开源项目提供,很多就是由像你一样的 Hugo 开发者开发的。
|
||||
|
||||
[查看 Hugo 的流行程度与其它静态网站生成器的比较。][staticgen]
|
||||
|
||||
[staticgen]: https://staticgen.com
|
||||
[syntax]: /tools/syntax-highlighting/
|
||||
@@ -1,31 +0,0 @@
|
||||
---
|
||||
title: 搜索你的 Hugo 网站
|
||||
linktitle: 搜索
|
||||
description: 为你最新添加的 Hugo 网站看一些开源和商业搜索选择。
|
||||
date: 2018-05-29
|
||||
publishdate: 2018-05-29
|
||||
lastmod: 2018-05-29
|
||||
categories: [developer tools]
|
||||
keywords: [search,tools]
|
||||
menu:
|
||||
docs:
|
||||
parent: "tools"
|
||||
weight: 60
|
||||
weight: 60
|
||||
sections_weight: 60
|
||||
draft: false
|
||||
aliases: []
|
||||
toc: true
|
||||
---
|
||||
|
||||
静态网站还有动态搜索功能?是的。作为可选方案,来自 Google 或者其它搜索引擎的嵌入式脚本,可以给你的访客提供一个自定义的直接基于你的内容文件索引的搜素。
|
||||
|
||||
* [GitHub Gist for Hugo Workflow](https://gist.github.com/sebz/efddfc8fdcb6b480f567). Gist 包含一个为你的网站创建索引的简单流程。它使用简单的 Grunt 脚本索引你所有的内容文件,并且 [lunr.js](http://lunrjs.com/) 会提供搜索结果。
|
||||
* [hugo-lunr](https://www.npmjs.com/package/hugo-lunr). 一个使用 [lunr.js](http://lunrjs.com/) 为你的 Hugo 静态网站添加搜索的简单方法。Hugo-lunr 将会给你的 Hugo 项目中任意 html 和 markdown 文件创建一个索引文件。
|
||||
* [hugo-lunr-zh](https://www.npmjs.com/package/hugo-lunr-zh). 有点像 Hugo-lunr,但是 Hugo-lunr-zh 能帮助你分割中文关键字。
|
||||
* [Github Gist for Fuse.js integration](https://gist.github.com/eddiewebb/735feb48f50f0ddd65ae5606a1cb41ae). 该 gist 显示如何借助 Hugo 已有的构建时间在客户端通过 [Fuse.js](http://fusejs.io/) 生成可搜索的 JSON 索引。尽管 gist 使用 Fuse.js 进行模糊匹配,任何有能力读取 JSON 索引的客户端工具都可以运行。不需要 Hugo 以外, npm、grunt 或者其它构建时工具。
|
||||
* [hugo-search-index](https://www.npmjs.com/package/hugo-search-index). 一个包含实现了搜索的 Gulp 任务和内置浏览器脚本的库。Gulp 从项目中的 markdown 文件生成索引。
|
||||
|
||||
## 商业搜索服务
|
||||
|
||||
* [Algolia](https://www.algolia.com/) 的搜索 API 使得在你的应用和网站中提供一个很好的搜索体验变得简单。Algolia 搜索提供托管的全文本、数字化、分面以及地理定位搜索。
|
||||
Reference in New Issue
Block a user