diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2021-03-21 15:31:17 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2021-03-21 15:31:17 +0300 |
commit | c94aa5cf46f91d777a61595b37835c40f1bddff1 (patch) | |
tree | 61006006ed306e05a7f2a280fc675478f2216676 /docs/content/en | |
parent | df8bb8812f466bce563cdba297db3cd3f954a799 (diff) | |
parent | 81689af79901f0cdaff765cda6322dd4a9a7ccb3 (diff) |
Merge commit '81689af79901f0cdaff765cda6322dd4a9a7ccb3'
Diffstat (limited to 'docs/content/en')
-rw-r--r-- | docs/content/en/content-management/image-processing/index.md | 8 | ||||
-rw-r--r-- | docs/content/en/content-management/multilingual.md | 3 | ||||
-rw-r--r-- | docs/content/en/content-management/taxonomies.md | 2 | ||||
-rw-r--r-- | docs/content/en/functions/intersect.md | 2 | ||||
-rw-r--r-- | docs/content/en/functions/sort.md | 28 | ||||
-rw-r--r-- | docs/content/en/getting-started/configuration.md | 2 | ||||
-rw-r--r-- | docs/content/en/getting-started/quick-start.md | 2 | ||||
-rw-r--r-- | docs/content/en/hosting-and-deployment/hosting-on-github.md | 2 | ||||
-rw-r--r-- | docs/content/en/templates/404.md | 2 | ||||
-rw-r--r-- | docs/content/en/variables/menus.md | 7 |
10 files changed, 33 insertions, 25 deletions
diff --git a/docs/content/en/content-management/image-processing/index.md b/docs/content/en/content-management/image-processing/index.md index ebd3362dc..a432b9851 100644 --- a/docs/content/en/content-management/image-processing/index.md +++ b/docs/content/en/content-management/image-processing/index.md @@ -33,11 +33,17 @@ To print all images paths in a [Page Bundle]({{< relref "/content-management/org The `image` resource can also be retrieved from a [global resource]({{< relref "/hugo-pipes/introduction#from-file-to-resource" >}}) +```go-html-template {{- $image := resources.Get "images/logo.jpg" -}} +``` ## Image Processing Methods -The `image` resource implements the methods `Resize`, `Fit` and `Fill`, each returning the transformed image using the specified dimensions and processing options. The `image` resource also, since Hugo 0.58, implements the method `Exif` and `Filter`. +The `image` resource implements the `Resize`, `Fit`, `Fill`, and `Filter` methods, each returning a transformed image using the specified dimensions and processing options. + +{{% note %}} +Metadata (EXIF, IPTC, XMP, etc.) is not preserved during image transformation. Use the [`Exif`](#exif) method with the _original_ image to extract EXIF metadata from JPEG or TIFF images. +{{% /note %}} ### Resize diff --git a/docs/content/en/content-management/multilingual.md b/docs/content/en/content-management/multilingual.md index e24c573c2..28bf6ab06 100644 --- a/docs/content/en/content-management/multilingual.md +++ b/docs/content/en/content-management/multilingual.md @@ -421,13 +421,14 @@ At the time of this writing, Go does not yet have support for internationalized ...then index the non-English date names in your templates like so: ~~~html -<time class="post-date" datetime="{{ .Date.Format '2006-01-02T15:04:05Z07:00' | safeHTML }}"> +<time class="post-date" datetime="{{ .Date.Format `2006-01-02T15:04:05Z07:00` | safeHTML }}"> Article publié le {{ .Date.Day }} {{ index $.Site.Data.mois (printf "%d" .Date.Month) }} {{ .Date.Year }} (dernière modification le {{ .Lastmod.Day }} {{ index $.Site.Data.mois (printf "%d" .Lastmod.Month) }} {{ .Lastmod.Year }}) </time> ~~~ This technique extracts the day, month and year by specifying ``.Date.Day``, ``.Date.Month``, and ``.Date.Year``, and uses the month number as a key, when indexing the month name data file. + ## Menus You can define your menus for each language independently. Creating multilingual menus works just like [creating regular menus][menus], except they're defined in language-specific blocks in the configuration file: diff --git a/docs/content/en/content-management/taxonomies.md b/docs/content/en/content-management/taxonomies.md index e7aa67ea6..da29fa7be 100644 --- a/docs/content/en/content-management/taxonomies.md +++ b/docs/content/en/content-management/taxonomies.md @@ -109,7 +109,7 @@ When taxonomies are used---and [taxonomy templates][] are provided---Hugo will a * A single page at `example.com/categories/` that lists all the [terms within the taxonomy][] * [Individual taxonomy list pages][taxonomy templates] (e.g., `/categories/development/`) for each of the terms that shows a listing of all pages marked as part of that taxonomy within any content file's [front matter][] -## Configure Taxonomies {#configuring-taxonomies} +## Configure Taxonomies Custom taxonomies other than the [defaults](#default-taxonomies) must be defined in your [site config][config] before they can be used throughout the site. You need to provide both the plural and singular labels for each taxonomy. For example, `singular key = "plural value"` for TOML and `singular key: "plural value"` for YAML. diff --git a/docs/content/en/functions/intersect.md b/docs/content/en/functions/intersect.md index 9ab7f3c3a..004479531 100644 --- a/docs/content/en/functions/intersect.md +++ b/docs/content/en/functions/intersect.md @@ -1,7 +1,7 @@ --- title: intersect linktitle: intersect -description: Returns the common elements of two arrays or slices. +description: Returns the common elements of two arrays or slices, in the same order as the first array. godocref: date: 2017-02-01 publishdate: 2017-02-01 diff --git a/docs/content/en/functions/sort.md b/docs/content/en/functions/sort.md index b83e6b0bd..ca28f3ee3 100644 --- a/docs/content/en/functions/sort.md +++ b/docs/content/en/functions/sort.md @@ -22,42 +22,42 @@ aliases: [] A sorted array of map values will be returned with the keys eliminated. There are two optional arguments: `sortByField` and `sortAsc`. If left blank, sort will sort by keys (for maps) in ascending order as its default behavior. ``` -+++ -keywords: [ "tag3", "tag1", "tag2" ] -+++ +--- +tags: ["tag3", "tag1", "tag2"] +--- // Site config +++ [params.authors] - [params.authors.Derek] - "firstName" = "Derek" - "lastName" = "Perkins" [params.authors.Joe] - "firstName" = "Joe" - "lastName" = "Bergevin" + firstName = "Joe" + lastName = "Bergevin" + [params.authors.Derek] + firstName = "Derek" + lastName = "Perkins" [params.authors.Tanner] - "firstName" = "Tanner" - "lastName" = "Linsley" + firstName = "Tanner" + lastName = "Linsley" +++ ``` ``` -// Use default sort options - sort by key / ascending +// Sort by value, ascending (default for lists) Tags: {{ range sort .Params.tags }}{{ . }} {{ end }} → Outputs Tags: tag1 tag2 tag3 -// Sort by value / descending +// Sort by value, descending Tags: {{ range sort .Params.tags "value" "desc" }}{{ . }} {{ end }} → Outputs Tags: tag3 tag2 tag1 -// Use default sort options - sort by value / descending +// Sort by key, ascending (default for maps) Authors: {{ range sort .Site.Params.authors }}{{ .firstName }} {{ end }} → Outputs Authors: Derek Joe Tanner -// Use default sort options - sort by value / descending +// Sort by field, descending Authors: {{ range sort .Site.Params.authors "lastName" "desc" }}{{ .lastName }} {{ end }} → Outputs Authors: Perkins Linsley Bergevin diff --git a/docs/content/en/getting-started/configuration.md b/docs/content/en/getting-started/configuration.md index 97763c002..1f8ad40c5 100644 --- a/docs/content/en/getting-started/configuration.md +++ b/docs/content/en/getting-started/configuration.md @@ -253,7 +253,7 @@ sectionPagesMenu ("") : See ["Section Menu for Lazy Bloggers"](/templates/menu-templates/#section-menu-for-lazy-bloggers). sitemap -: Default [sitemap configuration](/templates/sitemap-template/#configure-sitemap-xml). +: Default [sitemap configuration](/templates/sitemap-template/#configure-sitemapxml). staticDir ("static") : A directory or a list of directories from where Hugo reads [static files][static-files]. {{% module-mounts-note %}} diff --git a/docs/content/en/getting-started/quick-start.md b/docs/content/en/getting-started/quick-start.md index 28b6b039b..f2378f4a7 100644 --- a/docs/content/en/getting-started/quick-start.md +++ b/docs/content/en/getting-started/quick-start.md @@ -78,7 +78,7 @@ git submodule add https://github.com/budparr/gohugo-theme-ananke.git themes/anan Then, add the theme to the site configuration: ```bash -echo 'theme = "ananke"' >> config.toml +echo theme = \"ananke\" >> config.toml ``` {{< asciicast 7naKerRYUGVPj8kiDmdh5k5h9 >}} diff --git a/docs/content/en/hosting-and-deployment/hosting-on-github.md b/docs/content/en/hosting-and-deployment/hosting-on-github.md index 9cabdd938..9b318f45d 100644 --- a/docs/content/en/hosting-and-deployment/hosting-on-github.md +++ b/docs/content/en/hosting-and-deployment/hosting-on-github.md @@ -82,7 +82,7 @@ jobs: publish_dir: ./public ``` -For more advance settings https://github.com/marketplace/actions/hugo-setup +For more advanced settings https://github.com/marketplace/actions/hugo-setup ## Use a Custom Domain diff --git a/docs/content/en/templates/404.md b/docs/content/en/templates/404.md index 0916e2299..b7d62ec8f 100644 --- a/docs/content/en/templates/404.md +++ b/docs/content/en/templates/404.md @@ -50,7 +50,7 @@ Your 404.html file can be set to load automatically when a visitor enters a mist * Apache. You can specify `ErrorDocument 404 /404.html` in an `.htaccess` file in the root of your site. * Nginx. You might specify `error_page 404 /404.html;` in your `nginx.conf` file. * Amazon AWS S3. When setting a bucket up for static web serving, you can specify the error file from within the S3 GUI. -* Amazon CloudFont. You can specify the page in the Error Pages section in the CloudFont Console. [Details here](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html) +* Amazon CloudFront. You can specify the page in the Error Pages section in the CloudFront Console. [Details here](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html) * Caddy Server. Using `errors { 404 /404.html }`. [Details here](https://caddyserver.com/docs/errors) * Netlify. Add `/* /404.html 404` to `content/_redirects`. [Details Here](https://www.netlify.com/docs/redirects/#custom-404) * Azure Static website. You can specify the `Error document path` in the Static website configuration page of the Azure portal. [More details are available in the Static website documentation](https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-static-website). diff --git a/docs/content/en/variables/menus.md b/docs/content/en/variables/menus.md index 6717fecbb..d84837a43 100644 --- a/docs/content/en/variables/menus.md +++ b/docs/content/en/variables/menus.md @@ -64,9 +64,10 @@ a string representing HTML. .Weight : _int_ <br /> -Value of the `weight` key if set for the menu entry. If that key is not set, -and if the menu entry is set in a page front-matter, this value defaults to the -page's `.Weight`. +Value of the `weight` key if set for the menu entry. By default the entries in +a menu are sorted ascending by their `weight`. If that key is not set, and if +the menu entry is set in a page front-matter, this value defaults to the page's +`.Weight`. .Parent : _string_ <br /> |