mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-31 10:42:38 +00:00
Squashed 'docs/' changes from 896bad9f4..e161ea09d
e161ea09dAdd one more Chinese file to workaround reflect: Zero(nil)b595b3a21Add more Chinese translation56e4e95d9Use lang.Merge to "fill in the gaps" for untranslated pagesef079406cMerge commit '650fac3a4e7d256f4505402ab44cfc3c804b8dea'650fac3a4Squashed 'themes/gohugoioTheme/' changes from a1768ebb..f31a3dc8322eff899Add Chinese language for menusd90b886e0Fix Markdown table syntax in previous commit737f3dfcaUpdate the leaf bundle vs branch bundle table09fa1bc4eClarify that `.Now` is obsolete879ea3f6aMake release notes somewhat more consistent0113e2051Move 0.40.2-relnotes into content/en/news77578f5bfMove content/ into new contentDir content/en/4dcf7c709Fix "reflect: Zero(nil)" error in showcase63dd25505Release 0.40.22076c0d56releaser: Prepare repository for 0.41-DEV070fe565ereleaser: Add release notes to /docs for release of 0.40.24ce52e913releaser: Bump versions for release of 0.40.241907c487Fix typos in syntax-highlighting.md91753ef3dAdd missing backtickb77274301Remove duplicate release notes (0.27, 0.27.1, 0.35)6e00da316Remove obsolete content/release-notes/ directory00a6d8c02Change en dash back to `--` in 0.38.2-relnotes51b32dc00Update archetypes.mdd0e5c2307Release 0.40.14538a6d5breleaser: Prepare repository for 0.41-DEV91b391d70releaser: Add release notes to /docs for release of 0.40.1e0979d143releaser: Bump versions for release of 0.40.17983967c2Clean imagesfe3fdd77dPolish showcase for Flesland Flise6dde3989Showcase - Flesland Flis AS by Absoluttweb73aa62290Revive @spf13's special Hugo fontadd67b335Release Hugo 0.40c0a26e5a6Merge branch 'temp40'beeabaaaereleaser: Prepare repository for 0.41-DEVe67d5e985releaser: Add release notes to /docs for release of 0.406cdd95273releaser: Bump versions for release of 0.40bee21fb9bRevive the other Hugo logos too4f45e8fe1Fix the link type attribute for RSS in examples8c67dc89aFix example in delimit doce7f6c00d5Revive the logo used on the forum82b0cd26eMerge commit 'a215abf70e018f4bf40d6c09d8bd148d8684b33d'119c8ca58Merge commit 'd2ec1a06df8ab6b17ad05cb008d5701b40327d47'db4683bd2Improve .Get docs05260b886.Get function: fix syntax signature git-subtree-dir: docs git-subtree-split:e161ea09d3
This commit is contained in:
+137
-1
@@ -70,7 +70,7 @@ twitter = "GoHugoIO"
|
||||
[params]
|
||||
description = "The world’s fastest framework for building websites"
|
||||
## Used for views in rendered HTML (i.e., rather than using the .Hugo variable)
|
||||
release = "0.39"
|
||||
release = "0.40.2"
|
||||
## Setting this to true will add a "noindex" to *EVERY* page on the site
|
||||
removefromexternalsearch = false
|
||||
## Gh repo for site footer (include trailing slash)
|
||||
@@ -271,3 +271,139 @@ anchor = "smart"
|
||||
identifier = "github"
|
||||
post = "external"
|
||||
url = "https://github.com/gohugoio/hugo"
|
||||
|
||||
### LANGUAGES ###
|
||||
|
||||
[languages]
|
||||
[languages.en]
|
||||
contentDir = "content/en"
|
||||
languageName = "English"
|
||||
weight = 1
|
||||
[languages.zh]
|
||||
contentDir = "content/zh"
|
||||
languageName = "中文"
|
||||
weight = 2
|
||||
|
||||
|
||||
### LANGUAGE-SPECIFIC MENUS ###
|
||||
|
||||
# Chinese menus
|
||||
|
||||
[[languages.zh.menu.docs]]
|
||||
name = "关于 Hugo"
|
||||
weight = 1
|
||||
identifier = "about"
|
||||
url = "/zh/about/"
|
||||
|
||||
[[languages.zh.menu.docs]]
|
||||
name = "入门"
|
||||
weight = 5
|
||||
identifier = "getting-started"
|
||||
url = "/zh/getting-started/"
|
||||
|
||||
[[languages.zh.menu.docs]]
|
||||
name = "主题"
|
||||
weight = 15
|
||||
identifier = "themes"
|
||||
post = "break"
|
||||
url = "/zh/themes/"
|
||||
|
||||
# Core languages.zh.menus
|
||||
|
||||
[[languages.zh.menu.docs]]
|
||||
name = "内容管理"
|
||||
weight = 20
|
||||
identifier = "content-management"
|
||||
post = "expanded"
|
||||
url = "/zh/content-management/"
|
||||
|
||||
[[languages.zh.menu.docs]]
|
||||
name = "模板"
|
||||
weight = 25
|
||||
identifier = "templates"
|
||||
url = "/zh/templates/"
|
||||
|
||||
[[languages.zh.menu.docs]]
|
||||
name = "函数"
|
||||
weight = 30
|
||||
identifier = "functions"
|
||||
url = "/zh/functions/"
|
||||
|
||||
[[languages.zh.menu.docs]]
|
||||
name = "变量"
|
||||
weight = 35
|
||||
identifier = "variables"
|
||||
url = "/zh/variables/"
|
||||
|
||||
[[languages.zh.menu.docs]]
|
||||
name = "CLI"
|
||||
weight = 40
|
||||
post = "break"
|
||||
identifier = "commands"
|
||||
url = "/commands/"
|
||||
|
||||
# LOW LEVEL ITEMS
|
||||
[[languages.zh.menu.docs]]
|
||||
name = "故障排除"
|
||||
weight = 60
|
||||
identifier = "troubleshooting"
|
||||
url = "/zh/troubleshooting/"
|
||||
|
||||
[[languages.zh.menu.docs]]
|
||||
name = "工具"
|
||||
weight = 70
|
||||
identifier = "tools"
|
||||
url = "/zh/tools/"
|
||||
|
||||
[[languages.zh.menu.docs]]
|
||||
name = "托管与部署"
|
||||
weight = 80
|
||||
identifier = "hosting-and-deployment"
|
||||
url = "/zh/hosting-and-deployment/"
|
||||
|
||||
[[languages.zh.menu.docs]]
|
||||
name = "贡献"
|
||||
weight = 100
|
||||
post = "break"
|
||||
identifier = "contribute"
|
||||
url = "/zh/contribute/"
|
||||
|
||||
[[languages.zh.menu.global]]
|
||||
name = "新闻"
|
||||
weight = 1
|
||||
identifier = "news"
|
||||
url = "/zh/news/"
|
||||
|
||||
[[languages.zh.menu.global]]
|
||||
name = "文档"
|
||||
weight = 5
|
||||
identifier = "docs"
|
||||
url = "/zh/documentation/"
|
||||
|
||||
[[languages.zh.menu.global]]
|
||||
name = "主题"
|
||||
weight = 10
|
||||
identifier = "themes"
|
||||
url = "https://themes.gohugo.io/"
|
||||
|
||||
[[languages.zh.menu.global]]
|
||||
name = "作品展示"
|
||||
weight = 20
|
||||
identifier = "showcase"
|
||||
url = "/zh/showcase/"
|
||||
|
||||
# Anything with a weight > 100 gets an external icon
|
||||
[[languages.zh.menu.global]]
|
||||
name = "社区"
|
||||
weight = 150
|
||||
icon = true
|
||||
identifier = "community"
|
||||
post = "external"
|
||||
url = "https://discourse.gohugo.io/"
|
||||
|
||||
[[languages.zh.menu.global]]
|
||||
name = "GitHub"
|
||||
weight = 200
|
||||
identifier = "github"
|
||||
post = "external"
|
||||
url = "https://github.com/gohugoio/hugo"
|
||||
|
||||
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 88 KiB |
+2
-2
@@ -32,8 +32,8 @@ The above will create a new content file in `content/posts/my-first-post.md` usi
|
||||
|
||||
1. `archetypes/posts.md`
|
||||
2. `archetypes/default.md`
|
||||
3. `themes/my-theme/posts.md`
|
||||
4. `themes/my-theme/default.md`
|
||||
3. `themes/my-theme/archetypes/posts.md`
|
||||
4. `themes/my-theme/archetypes/default.md`
|
||||
|
||||
The last two list items is only applicable if you use a theme and it uses the `my-theme` theme name as an example.
|
||||
|
||||
@@ -29,7 +29,7 @@ Before you begin writing your content in markdown, Blackfriday has a known issue
|
||||
|
||||
You can configure multiple aspects of Blackfriday as show in the following list. See the docs on [Configuration][config] for the full list of explicit directions you can give to Hugo when rendering your site.
|
||||
|
||||
{{< readfile file="/content/readfiles/bfconfig.md" markdown="true" >}}
|
||||
{{< readfile file="/content/en/readfiles/bfconfig.md" markdown="true" >}}
|
||||
|
||||
## Extend Markdown
|
||||
|
||||
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 88 KiB |
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
+10
-7
@@ -21,13 +21,16 @@ A Page Bundle can be one of:
|
||||
- Leaf Bundle (leaf means it has no children)
|
||||
- Branch Bundle (home page, section, taxonomy terms, taxonomy list)
|
||||
|
||||
| | Leaf Bundle | Branch Bundle |
|
||||
|-----------------|--------------------------------------------------------|---------------------------------------------------------|
|
||||
| Usage | Collection of resources (pages, images etc.) for single pages | Collection of non-page resources (images etc.)for list pages |
|
||||
| Index file name | `index.md` [^fn:1] | `_index.md` [^fn:1] |
|
||||
| Layout type | `single` | `list` |
|
||||
| Nesting | Doesn't allow nesting of more bundles under it | Allows nesting of leaf/branch bundles under it |
|
||||
| Example | `content/posts/my-post/index.md` | `content/posts/_index.md` |
|
||||
| | Leaf Bundle | Branch Bundle |
|
||||
|-------------------------------------|----------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Usage | Collection of content and attachments for single pages | Collection of attachments for section pages (home page, section, taxonomy terms, taxonomy list) |
|
||||
| Index file name | `index.md` [^fn:1] | `_index.md` [^fn:1] |
|
||||
| Allowed Resources | Page and non-page (like images, pdf, etc.) types | Only non-page (like images, pdf, etc.) types |
|
||||
| Where can the Resources live? | At any directory level within the leaf bundle directory. | Only in the directory level **of** the branch bundle directory i.e. the directory containing the `_index.md` ([ref](https://discourse.gohugo.io/t/question-about-content-folder-structure/11822/4?u=kaushalmodi)). |
|
||||
| Layout type | `single` | `list` |
|
||||
| Nesting | Does not allow nesting of more bundles under it | Allows nesting of leaf or branch bundles under it |
|
||||
| Example | `content/posts/my-post/index.md` | `content/posts/_index.md` |
|
||||
| Content from non-index page files .. | Accessed only as page resources | Accessed only as regular pages |
|
||||
|
||||
|
||||
## Leaf Bundles {#leaf-bundles}
|
||||
@@ -81,7 +81,7 @@ With the available [section variables and methods](#section-page-variables-and-m
|
||||
|
||||
Also see [Page Variables](/variables/page/).
|
||||
|
||||
{{< readfile file="/content/readfiles/sectionvars.md" markdown="true" >}}
|
||||
{{< readfile file="/content/en/readfiles/sectionvars.md" markdown="true" >}}
|
||||
|
||||
## Content Section Lists
|
||||
|
||||
+1
-1
@@ -235,7 +235,7 @@ By adding the preceding `hidecaption` example, the following HTML will be added
|
||||
|
||||
#### Example `instagram` Display
|
||||
|
||||
Using the preceding `instagram` with hidecaption` example above, the following simulates the displayed experience for visitors to your website. Naturally, the final display will be contingent on your stylesheets and surrounding markup.
|
||||
Using the preceding `instagram` with `hidecaption` example above, the following simulates the displayed experience for visitors to your website. Naturally, the final display will be contingent on your stylesheets and surrounding markup.
|
||||
|
||||
{{< instagram BWNjjyYFxVx hidecaption >}}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Syntax Highlighting
|
||||
description: Hugo comes with reallly fast syntax highlighting from Chroma.
|
||||
description: Hugo comes with really fast syntax highlighting from Chroma.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
keywords: [highlighting,pygments,chroma,code blocks,syntax]
|
||||
@@ -18,7 +18,7 @@ toc: true
|
||||
|
||||
From Hugo 0.28, the default syntax hightlighter in Hugo is [Chroma](https://github.com/alecthomas/chroma); it is built in Go and is really, really fast -- and for the most important parts compatible with Pygments.
|
||||
|
||||
If you want to continue to use Pygments (see below), set `pygmentsUseClassic=true` in your site config.
|
||||
If you want to continue to use Pygments (see below), set `pygmentsUseClasses=true` in your site config.
|
||||
|
||||
The example below shows a simple code snippet from the Hugo source highlighted with the `highlight` shortcode. Note that the gohugo.io site is generated with `pygmentsUseClasses=true` (see [Generate Syntax Highlighter CSS](#generate-syntax-highlighter-css)).
|
||||
|
||||
@@ -36,7 +36,7 @@ The examples of `delimit` that follow all use the same front matter:
|
||||
{{< code file="delimit-example-front-matter.toml" nocopy="true" >}}
|
||||
+++
|
||||
title: I love Delimit
|
||||
keywords: [ "tag1", "tag2", "tag3" ]
|
||||
tags: [ "tag1", "tag2", "tag3" ]
|
||||
+++
|
||||
{{< /code >}}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
---
|
||||
title: .Get
|
||||
description: Accesses positional and ordered parameters in shortcode declaration.
|
||||
godocref:
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [functions]
|
||||
menu:
|
||||
docs:
|
||||
parent: "functions"
|
||||
keywords: [shortcodes]
|
||||
signature: [".Get INDEX", ".Get KEY"]
|
||||
workson: []
|
||||
hugoversion:
|
||||
relatedfuncs: []
|
||||
deprecated: false
|
||||
aliases: []
|
||||
needsexample: true
|
||||
---
|
||||
|
||||
|
||||
`.Get` is specifically used when creating your own [shortcode template][sc], to access the [positional and named](/templates/shortcode-templates/#positional-vs-named-parameters) parameters passed to it. When used with a numeric INDEX, it queries positional parameters (starting with 0). With a string KEY, it queries named parameters.
|
||||
|
||||
When accessing a named parameter that does not exist, `.Get` returns an empty string instead of interrupting the build. The same goes with positional parameters in hugo version 0.40 and after. This allows you to chain `.Get` with `if`, `with`, `default` or `cond` to check for parameter existence. For example, you may now use:
|
||||
|
||||
```
|
||||
{{ $quality := default "100" (.Get 1) }}
|
||||
```
|
||||
|
||||
[sc]: /templates/shortcode-templates/
|
||||
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user