mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
Merge commit 'd3927310d5b2404c3238f9b899db3329ea516490'
This commit is contained in:
@@ -31,12 +31,12 @@ Hugo ships with internal templates supporting Google Analytics, both [Google Ana
|
||||
Provide your tracking ID in your configuration file:
|
||||
|
||||
**Google Analytics 4 (gtag.js)**
|
||||
{{< code-toggle file="config" >}}
|
||||
{{< code-toggle file="hugo" >}}
|
||||
googleAnalytics = "G-MEASUREMENT_ID"
|
||||
{{</ code-toggle >}}
|
||||
|
||||
**Google Universal Analytics (analytics.js)**
|
||||
{{< code-toggle file="config" >}}
|
||||
{{< code-toggle file="hugo" >}}
|
||||
googleAnalytics = "UA-PROPERTY_ID"
|
||||
{{</ code-toggle >}}
|
||||
|
||||
@@ -64,7 +64,7 @@ Hugo also ships with an internal template for [Disqus comments][disqus], a popul
|
||||
|
||||
To use Hugo's Disqus template, you first need to set a single configuration value:
|
||||
|
||||
{{< code-toggle file="config" >}}
|
||||
{{< code-toggle file="hugo" >}}
|
||||
disqusShortname = "your-disqus-shortname"
|
||||
{{</ code-toggle >}}
|
||||
|
||||
@@ -127,7 +127,7 @@ This format is used for Facebook and some other sites.
|
||||
|
||||
Hugo's Open Graph template is configured using a mix of configuration variables and [front-matter](/content-management/front-matter/) on individual pages.
|
||||
|
||||
{{< code-toggle file="config" >}}
|
||||
{{< code-toggle file="hugo" >}}
|
||||
[params]
|
||||
title = "My cool site"
|
||||
images = ["site-feature-image.jpg"]
|
||||
@@ -177,7 +177,7 @@ metadata used to attach rich media to Tweets linking to your site.
|
||||
|
||||
Hugo's Twitter Card template is configured using a mix of configuration variables and [front-matter](/content-management/front-matter/) on individual pages.
|
||||
|
||||
{{< code-toggle file="config" >}}
|
||||
{{< code-toggle file="hugo" >}}
|
||||
[params]
|
||||
images = ["site-feature-image.jpg"]
|
||||
description = "Text about my cool site"
|
||||
@@ -197,7 +197,7 @@ Hugo uses the page title and description for the card's title and description fi
|
||||
|
||||
The `.Site.Social.twitter` variable is exposed from the config as the value for `twitter:site`.
|
||||
|
||||
{{< code-toggle file="config" >}}
|
||||
{{< code-toggle file="hugo" >}}
|
||||
[social]
|
||||
twitter = "GoHugoIO"
|
||||
{{</ code-toggle >}}
|
||||
|
@@ -562,7 +562,7 @@ You can arbitrarily define as many site-level parameters as you want in your [si
|
||||
|
||||
For instance, you might declare the following:
|
||||
|
||||
{{< code-toggle file="config" >}}
|
||||
{{< code-toggle file="hugo" >}}
|
||||
params:
|
||||
copyrighthtml: "Copyright © 2017 John Doe. All Rights Reserved."
|
||||
twitteruser: "spf13"
|
||||
|
@@ -31,7 +31,7 @@ This is the full set of built-in media types in Hugo:
|
||||
|
||||
To add or modify a media type, define it in a `mediaTypes` section in your [site configuration][config], either for all sites or for a given language.
|
||||
|
||||
{{< code-toggle file="config" >}}
|
||||
{{< code-toggle file="hugo" >}}
|
||||
[mediaTypes]
|
||||
[mediaTypes."text/enriched"]
|
||||
suffixes = ["enr"]
|
||||
@@ -43,7 +43,7 @@ The above example adds one new media type, `text/enriched`, and changes the suff
|
||||
|
||||
**Note:** these media types are configured for **your output formats**. If you want to redefine one of Hugo's default output formats (e.g. `HTML`), you also need to redefine the media type. So, if you want to change the suffix of the `HTML` output format from `html` (default) to `htm`:
|
||||
|
||||
{{< code-toggle file="config" >}}
|
||||
{{< code-toggle file="hugo" >}}
|
||||
[mediaTypes]
|
||||
[mediaTypes."text/html"]
|
||||
suffixes = ["htm"]
|
||||
@@ -70,7 +70,7 @@ This is the full set of Hugo's built-in output formats:
|
||||
|
||||
To add or modify an output format, define it in an `outputFormats` section in your site's [configuration file](/getting-started/configuration/), either for all sites or for a given language.
|
||||
|
||||
{{< code-toggle file="config" >}}
|
||||
{{< code-toggle file="hugo" >}}
|
||||
[outputFormats.MyEnrichedFormat]
|
||||
mediaType = "text/enriched"
|
||||
baseName = "myindex"
|
||||
@@ -146,7 +146,7 @@ per language).
|
||||
|
||||
Example from site config file:
|
||||
|
||||
{{< code-toggle file="config" >}}
|
||||
{{< code-toggle file="hugo" >}}
|
||||
[outputs]
|
||||
home = ["HTML", "AMP", "RSS"]
|
||||
page = ["HTML"]
|
||||
|
@@ -14,7 +14,7 @@ aliases: [/extras/robots-txt/]
|
||||
|
||||
To generate a robots.txt file from a template, change the [site configuration][config]:
|
||||
|
||||
{{< code-toggle file="config">}}
|
||||
{{< code-toggle file="hugo" >}}
|
||||
enableRobotsTXT = true
|
||||
{{< /code-toggle >}}
|
||||
|
||||
|
@@ -35,11 +35,11 @@ The table below shows the RSS template lookup order for the different page kinds
|
||||
|
||||
## Configure RSS
|
||||
|
||||
By default, Hugo will create an unlimited number of RSS entries. You can limit the number of articles included in the built-in RSS templates by assigning a numeric value to `rssLimit:` field in your project's [`config` file][config].
|
||||
By default, Hugo will create an unlimited number of RSS entries. You can limit the number of articles included in the built-in RSS templates by assigning a numeric value to `rssLimit:` field in your project's configuration file.
|
||||
|
||||
The following values will also be included in the RSS output if specified:
|
||||
|
||||
{{< code-toggle file="config" >}}
|
||||
{{< code-toggle file="hugo" >}}
|
||||
languageCode = "en-us"
|
||||
copyright = "This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License."
|
||||
|
||||
|
@@ -368,7 +368,7 @@ You can also implement your shortcodes inline -- e.g. where you use them in the
|
||||
|
||||
This feature is disabled by default, but can be enabled in your site config:
|
||||
|
||||
{{< code-toggle file="config">}}
|
||||
{{< code-toggle file="hugo" >}}
|
||||
enableInlineShortcodes = true
|
||||
{{< /code-toggle >}}
|
||||
|
||||
|
@@ -27,7 +27,7 @@ With a multilingual project, Hugo generates:
|
||||
|
||||
Set the default values for [change frequency] and [priority], and the name of the generated file, in your site configuration.
|
||||
|
||||
{{< code-toggle file="config" >}}
|
||||
{{< code-toggle file="hugo" >}}
|
||||
[sitemap]
|
||||
changefreq = 'monthly'
|
||||
filename = 'sitemap.xml'
|
||||
@@ -72,7 +72,7 @@ To override the built-in sitemapindex.xml template, create a new file in either
|
||||
|
||||
You may disable sitemap generation in your site configuration:
|
||||
|
||||
{{< code-toggle file="config" >}}
|
||||
{{< code-toggle file="hugo" >}}
|
||||
disableKinds = ['sitemap']
|
||||
{{</ code-toggle >}}
|
||||
|
||||
|
Reference in New Issue
Block a user