Merge commit '74309fe5699a595080fdb3a14711e0869babce99'

This commit is contained in:
Bjørn Erik Pedersen
2018-10-29 09:23:25 +01:00
59 changed files with 306 additions and 127 deletions

View File

@@ -42,7 +42,7 @@ You will get an error if you document could not be uniquely resolved. The error
Link to another language version of a document, you need to use this syntax:
```go-html-template
{{</* relref path="document.md" lang="jp" */>}}
{{</* relref path="document.md" lang="ja" */>}}
```
### Get another Output Format

View File

@@ -1,7 +1,7 @@
---
title: Supported Content Formats
linktitle: Supported Content Formats
description: Markdown and Emacs Org-Mode have native support, and additional formats (e.g. Asciidoc) come via external helpers.
description: Both HTML and Markdown are supported content formats.
date: 2017-01-10
publishdate: 2017-01-10
lastmod: 2017-04-06
@@ -19,7 +19,19 @@ toc: true
**Markdown is the main content format** and comes in two flavours: The excellent [Blackfriday project][blackfriday] (name your files `*.md` or set `markup = "markdown"` in front matter) or its fork [Mmark][mmark] (name your files `*.mmark` or set `markup = "mmark"` in front matter), both very fast markdown engines written in Go.
For Emacs users, [goorgeous](https://github.com/chaseadamsio/goorgeous) provides built-in native support for Org-mode (name your files `*.org` or set `markup = "org"` in front matter)
For Emacs users, [goorgeous](https://github.com/chaseadamsio/goorgeous) provides built-in native support for Org-mode (name your files `*.org` or set `markup = "org"` in front matter)
But in many situations, plain HTML is what you want. Just name your files with `.html` or `.htm` extension inside your content folder. Note that if you want your HTML files to have a layout, they need front matter. It can be empty, but it has to be there:
```html
---
title: "This is a content file in HTML"
---
<div>
<h1>Hello, Hugo!</h1>
</div>
```
{{% note "Deeply Nested Lists" %}}
Before you begin writing your content in markdown, Blackfriday has a known issue [(#329)](https://github.com/russross/blackfriday/issues/329) with handling deeply nested lists. Luckily, there is an easy workaround. Use 4-spaces (i.e., <kbd>tab</kbd>) rather than 2-space indentations.

View File

@@ -59,6 +59,9 @@ There are a few predefined variables that Hugo is aware of. See [Page Variables]
aliases
: an array of one or more aliases (e.g., old published paths of renamed content) that will be created in the output directory structure . See [Aliases][aliases] for details.
audio
: an array of paths to audio files related to the page; used by the `opengraph` [internal template](/templates/internal) to populate `og:audio`.
date
: the datetime at which the content was created; note this value is auto-populated according to Hugo's built-in [archetype][].
@@ -74,6 +77,9 @@ expiryDate
headless
: if `true`, sets a leaf bundle to be [headless][headless-bundle].
images
: an array of paths to images related to the page; used by [internal templates](/templates/internal) such as `_internal/twitter_cards.html`.
isCJKLanguage
: if `true`, Hugo will explicitly treat the content as a CJK language; both `.Summary` and `.WordCount` work properly in CJK languages.
@@ -101,6 +107,9 @@ publishDate
resources
: used for configuring page bundle resources. See [Page Resources][page-resources].
series
: an array of series this page belongs to, as a subset of the `series` [taxonomy](/content-management/taxonomies/); used by the `opengraph` [internal template](/templates/internal) to populate `og:see_also`.
slug
: appears as the tail of the output URL. A value specified in front matter will override the segment of the URL based on the filename.
@@ -114,6 +123,9 @@ url
: the full path to the content from the web root. It makes no assumptions about the path of the content file. It also ignores any language prefixes of
the multilingual feature.
videos
: an array of paths to videos related to the page; used by the `opengraph` [internal template](/templates/internal) to populate `og:video`.
weight
: used for [ordering your content in lists][ordering]. Lower weight gets higher precedence. So content with lower weight will come first.

View File

@@ -151,7 +151,7 @@ You can configure an `imaging` section in `config.toml` with default image proce
# See https://github.com/disintegration/imaging
resampleFilter = "box"
# Defatult JPEG quality setting. Default is 75.
# Default JPEG quality setting. Default is 75.
quality = 75
# Anchor used when cropping pictures.

View File

@@ -29,6 +29,7 @@ The following is an example of a site configuration for a multilingual Hugo proj
DefaultContentLanguage = "en"
copyright = "Everything is mine"
[params]
[params.navigation]
help = "Help"
@@ -48,8 +49,7 @@ linkedin = "https://linkedin.com/fr/whoever"
help = "Aide"
{{< /code-toggle >}}
Anything not defined in a `[languages]` block will fall back to the global
value for that key (e.g., `copyright` for the English [`en`] language).
Anything not defined in a `[languages]` block will fall back to the global value for that key (e.g., `copyright` for the English [`en`] language). This also works for `params`, as demonstrated witgh `help` above: You will get the value `Aide` in French and `Help` in all the languages without this parameter set.
With the configuration above, all content, sitemap, RSS feeds, paginations,
and taxonomy pages will be rendered below `/` in English (your default content language) and then below `/fr` in French.
@@ -67,7 +67,7 @@ Only the obvious non-global options can be overridden per language. Examples of
You can disable one or more languages. This can be useful when working on a new translation.
```toml
disableLanguages = ["fr", "jp"]
disableLanguages = ["fr", "ja"]
```
Note that you cannot disable the default content language.
@@ -75,7 +75,7 @@ Note that you cannot disable the default content language.
We kept this as a standalone setting to make it easier to set via [OS environment](/getting-started/configuration/#configure-with-environment-variables):
```bash
HUGO_DISABLELANGUAGES="fr jp" hugo
HUGO_DISABLELANGUAGES="fr ja" hugo
```
If you have already a list of disabled languages in `config.toml`, you can enable them in development like this:

View File

@@ -17,7 +17,7 @@ menu:
## Properties
ResourceType
: The main type of the resource. For example, a file of MIME type `image/jpg` has for ResourceType `image`.
: The main type of the resource. For example, a file of MIME type `image/jpg` has the ResourceType `image`.
Name
: Default value is the filename (relative to the owning page). Can be set in front matter.
@@ -31,6 +31,21 @@ Permalink
RelPermalink
: The relative URL to the resource. Resources of type `page` will have no value.
Content
: The content of the resource itself. For most resources, this returns a string with the contents of the file. This can be used to inline some resources, such as `<script>{{ (.Resources.GetMatch "myscript.js").Content | safeJS }}</script>` or `<img src="{{ (.Resources.GetMatch "mylogo.png").Content | base64Encode }}">`.
MediaType
: The MIME type of the resource, such as `image/jpg`.
MediaType.MainType
: The main type of the resource's MIME type. For example, a file of MIME type `application/pdf` has for MainType `application`.
MediaType.SubType
: The subtype of the resource's MIME type. For example, a file of MIME type `application/pdf` has for SubType `pdf`. Note that this is not the same as the file extension - PowerPoint files have a subtype of `vnd.mspowerpoint`.
MediaType.Suffixes
: A slice of possible suffixes for the resource's MIME type.
## Methods
ByType
: Returns the page resources of the given type.

View File

@@ -42,14 +42,14 @@ Here is the list of "Related" methods available on a page collection such `.Regu
Returns a collection of pages related the given one.
```
{{ $related := .RegularPages.Related . }}
{{ $related := .Site.RegularPages.Related . }}
```
#### .RelatedIndices PAGE INDICE1 [INDICE2 ...]
Returns a collection of pages related to a given one restricted to a list of indices.
```
{{ $related := .RegularPages.RelatedIndices . "tags" "date" }}
{{ $related := .Site.RegularPages.RelatedIndices . "tags" "date" }}
```
#### .RelatedTo KEYVALS [KEYVALS2 ...]
@@ -58,7 +58,7 @@ Returns a collection of pages related together by a set of indices and their mat
In order to build those set and pass them as argument, one must use the `keyVals` function where the first agrument would be the `indice` and the consective ones its potential `matches`.
```
{{ $related := .RegularPages.RelatedTo ( keyVals "tags" "hugo" "rocks") ( keyVals "date" .Date ) }}
{{ $related := .Site.RegularPages.RelatedTo ( keyVals "tags" "hugo" "rocks") ( keyVals "date" .Date ) }}
```
{{% note %}}