Squashed 'docs/' changes from bb15e9804..9cece6640

9cece6640 Function sort: fix example labels (#1344)
84444120f Revert "Fix sample data for sort function (#1363)" (#1364)
05c8619f4 Fix sample data for sort function (#1363)
2beb1c0ed Fix "Configure taxonomies" title (#1361)
cd777b9fb Fix sitemap configuration link (#1360)
52251fb42 Update the 'Customize Dates' example to not error (#1357)
1a14cc08a Update quick-start.md
17bb98a94 Add note about image metadata removal
ec4f7bfff Update 404.md
cebfb7a90 explaination that `weight` key is used for sorting
83190ff12 fix typo: "advance settings" → "advanced settings"
75743968c Update quick-start.md
f1c64cd5a Improved documentation.
8af3b236c Update theme

git-subtree-dir: docs
git-subtree-split: 9cece6640095a21673a730201466ea636d2f8ded
This commit is contained in:
Bjørn Erik Pedersen 2021-03-21 13:31:17 +01:00
parent 9d31f650da
commit 81689af799
22 changed files with 121 additions and 67 deletions

View file

@ -1,9 +1,3 @@
[[banners]]
name = "Forestry.io"
link = "https://forestry.io/"
logo = "/images/sponsors/forestry-logotype.svg"
copy = ""
[[banners]] [[banners]]
name = "Linode" name = "Linode"
link = "https://www.linode.com/" link = "https://www.linode.com/"
@ -15,3 +9,11 @@ name = "eSolia"
link = "https://esolia.com/post/why-did-esolia-choose-hugo/" link = "https://esolia.com/post/why-did-esolia-choose-hugo/"
logo = "/images/sponsors/esolia-logo.svg" logo = "/images/sponsors/esolia-logo.svg"
copy = "" copy = ""
[[banners]]
name = "Brave"
link = "https://brave.com/"
logo = "/images/sponsors/brave-logo.svg"
bgcolor = "#5A2FA1"
copy = ""

View file

@ -39,6 +39,8 @@
{{ $.Scratch.Set "stylesheet" . }} {{ $.Scratch.Set "stylesheet" . }}
{{end}} {{end}}
<meta name="description"
content="{{ with .Description }}{{ . }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}">
{{ block "scripts" . }} {{ block "scripts" . }}
{{- partial "site-scripts.html" . -}} {{- partial "site-scripts.html" . -}}
@ -53,9 +55,6 @@
{{ partial "gtag" . }} {{ partial "gtag" . }}
{{ end }} {{ end }}
</head> </head>
<body class="ma0 sans-serif bg-primary-color-light{{ with getenv "HUGO_ENV" }} {{ . }}{{ end }}"> <body class="ma0 sans-serif bg-primary-color-light{{ with getenv "HUGO_ENV" }} {{ . }}{{ end }}">

View file

@ -6,7 +6,7 @@
gtag('js', new Date()); gtag('js', new Date());
{{ $site := $.Site.BaseURL | replaceRE "^https?://(www\\.)?([^/]+).*" "$2" }} {{ $site := $.Site.BaseURL | replaceRE "^https?://(www\\.)?([^/]+).*" "$2" }}
gtag('config', '{{ . }}', {'dimension1': '{{ $site }}', 'dimension2': '{{ getenv "BRANCH" }}'}); gtag('config', '{{ . }}', {'anonymize_ip': true, 'dimension1': '{{ $site }}', 'dimension2': '{{ getenv "BRANCH" }}'});
/** /**
* Function that tracks a click on an outbound link in Analytics. * Function that tracks a click on an outbound link in Analytics.

View file

@ -14,7 +14,7 @@
<div class="h4"> <div class="h4">
<img src="/images/gopher-hero.svg" alt="Hugo Gopher" class="h4"> <img src="/images/gopher-hero.svg" alt="Hugo Gopher" class="h4">
</div> </div>
<p class="f6 mid-gray m0 p0 pt3">Mac OS</p> <p class="f6 mid-gray m0 p0 pt3">macOS</p>
<div class="code f6 bg-black light-green lh-copy pv3 ph3 br2 w-100 w-50-ns center mb2 tl"> <div class="code f6 bg-black light-green lh-copy pv3 ph3 br2 w-100 w-50-ns center mb2 tl">
$ brew install hugo <br /> $ brew install hugo <br />
</div> </div>
@ -35,5 +35,4 @@
<!-- TODO: Animate the gopher https://github.com/rdwatters/hugo-docs-concept/issues/3#issuecomment-287194777 --> <!-- TODO: Animate the gopher https://github.com/rdwatters/hugo-docs-concept/issues/3#issuecomment-287194777 -->
</div> </div>

View file

@ -1,4 +1,4 @@
{{$classes_box := "ba b--light-gray bg-light-gray br3 flex flex-column flex-wrap items-center justify-center ph3 pv4 mb4 w-100 w-30-l "}} {{$classes_box := "ba b--dark-gray bg-light-gray br3 flex flex-column flex-wrap items-center justify-center ph3 pv4 mb4 w-100 w-30-l "}}
{{$gtag := .gtag | default "unknown" }} {{$gtag := .gtag | default "unknown" }}
{{ with .cx.Site.Data.sponsors }} {{ with .cx.Site.Data.sponsors }}
<section class="{{ $.classes_section | default "bg-primary-color-dark b--dark-gray bb bt ph5 pv4 w-100"}}"> <section class="{{ $.classes_section | default "bg-primary-color-dark b--dark-gray bb bt ph5 pv4 w-100"}}">
@ -8,7 +8,7 @@
{{ range .banners }} {{ range .banners }}
{{ $banner := . }} {{ $banner := . }}
{{if .logo}} {{if .logo}}
<div class="{{$classes_box}} o-100"> <div class="{{$classes_box}} o-100"{{ with .bgcolor }} style="background-color: {{ . }};"{{ end}}>
{{with .link -}} {{with .link -}}
{{ $url := printf "%s?%s" . (querify "utm_source" "homepage" "utm_medium" "banner" "utm_campaign" "hugosponsor") | safeURL }} {{ $url := printf "%s?%s" . (querify "utm_source" "homepage" "utm_medium" "banner" "utm_campaign" "hugosponsor") | safeURL }}
{{ if eq (getenv "HUGO_ENV") "production" | or (eq $.cx.Site.Params.env "production") }} {{ if eq (getenv "HUGO_ENV") "production" | or (eq $.cx.Site.Params.env "production") }}

View file

@ -17,7 +17,7 @@
{{/* pagination.html: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/template_embedded.go#L117 */}} {{/* pagination.html: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/template_embedded.go#L117 */}}
{{ template "_internal/pagination.html" . }} {{ template "_internal/pagination.html" . }}
</div> </div>
<div class="dib f3 mt4">The Showcase articles are copyright the content authors. Any open source license will be attached.</div> <div class="dib f3 mt4">The Showcase articles are copyrighted by their respective content authors. Any open source license will be attached.</div>
</div> </div>
{{ end }} {{ end }}

View file

@ -0,0 +1,43 @@
{
"name": "gohugo-default-styles",
"version": "1.1.0",
"description": "Default Theme for Hugo Sites",
"main": "index.js",
"homepage": "https://gohugo.io/",
"bugs": {
"url": "https://github.com/gohugoio/gohugoioTheme/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/gohugoio/gohugoioTheme.git"
},
"author": "budparr",
"license": "MIT",
"scripts": {
"build": "NODE_ENV=production webpack",
"build-dev": "NODE_ENV=development webpack --progress --watch",
"start": "npm run build-dev"
},
"devDependencies": {
"clean-webpack-plugin": "^1.0.0",
"clipboard": "^2.0.4",
"css-loader": "^4.3.0",
"docsearch.js": "^2.6.1",
"file-loader": "^2.0.0",
"glob-all": "^3.1.0",
"highlight.js": "^9.13.1",
"lazysizes": "^5.2.1",
"mini-css-extract-plugin": "^0.4.4",
"postcss": "^7.0.32",
"postcss-cssnext": "^3.1.0",
"postcss-import": "^12.0.1",
"postcss-loader": "^3.0.0",
"purgecss-webpack-plugin": "^1.3.1",
"scrolldir": "^1.4.0",
"tachyons": "^4.7.0",
"typeface-muli": "0.0.54",
"webpack": "^4.44.1",
"webpack-command": "^0.4.2"
},
"dependencies": {}
}

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.6 KiB

View file

@ -1 +1 @@
# github.com/gohugoio/gohugoioTheme v0.0.0-20200711112515-b0dfe471654f # github.com/gohugoio/gohugoioTheme v0.0.0-20210301124928-2c15837dfec3

View file

@ -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" >}}) 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 := resources.Get "images/logo.jpg" -}}
```
## Image Processing Methods ## 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 ### Resize

View file

@ -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: ...then index the non-English date names in your templates like so:
~~~html ~~~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 }}) 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> </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. 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 ## 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: 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:

View file

@ -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][] * 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][] * [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. 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.

View file

@ -1,7 +1,7 @@
--- ---
title: intersect title: intersect
linktitle: 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: godocref:
date: 2017-02-01 date: 2017-02-01
publishdate: 2017-02-01 publishdate: 2017-02-01

View file

@ -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. 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 // Site config
+++ +++
[params.authors] [params.authors]
[params.authors.Derek]
"firstName" = "Derek"
"lastName" = "Perkins"
[params.authors.Joe] [params.authors.Joe]
"firstName" = "Joe" firstName = "Joe"
"lastName" = "Bergevin" lastName = "Bergevin"
[params.authors.Derek]
firstName = "Derek"
lastName = "Perkins"
[params.authors.Tanner] [params.authors.Tanner]
"firstName" = "Tanner" firstName = "Tanner"
"lastName" = "Linsley" lastName = "Linsley"
+++ +++
``` ```
``` ```
// Use default sort options - sort by key / ascending // Sort by value, ascending (default for lists)
Tags: {{ range sort .Params.tags }}{{ . }} {{ end }} Tags: {{ range sort .Params.tags }}{{ . }} {{ end }}
→ Outputs Tags: tag1 tag2 tag3 → Outputs Tags: tag1 tag2 tag3
// Sort by value / descending // Sort by value, descending
Tags: {{ range sort .Params.tags "value" "desc" }}{{ . }} {{ end }} Tags: {{ range sort .Params.tags "value" "desc" }}{{ . }} {{ end }}
→ Outputs Tags: tag3 tag2 tag1 → 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 }} Authors: {{ range sort .Site.Params.authors }}{{ .firstName }} {{ end }}
→ Outputs Authors: Derek Joe Tanner → 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 }} Authors: {{ range sort .Site.Params.authors "lastName" "desc" }}{{ .lastName }} {{ end }}
→ Outputs Authors: Perkins Linsley Bergevin → Outputs Authors: Perkins Linsley Bergevin

View file

@ -253,7 +253,7 @@ sectionPagesMenu ("")
: See ["Section Menu for Lazy Bloggers"](/templates/menu-templates/#section-menu-for-lazy-bloggers). : See ["Section Menu for Lazy Bloggers"](/templates/menu-templates/#section-menu-for-lazy-bloggers).
sitemap sitemap
: Default [sitemap configuration](/templates/sitemap-template/#configure-sitemap-xml). : Default [sitemap configuration](/templates/sitemap-template/#configure-sitemapxml).
staticDir ("static") staticDir ("static")
: A directory or a list of directories from where Hugo reads [static files][static-files]. {{% module-mounts-note %}} : A directory or a list of directories from where Hugo reads [static files][static-files]. {{% module-mounts-note %}}

View file

@ -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: Then, add the theme to the site configuration:
```bash ```bash
echo 'theme = "ananke"' >> config.toml echo theme = \"ananke\" >> config.toml
``` ```
{{< asciicast 7naKerRYUGVPj8kiDmdh5k5h9 >}} {{< asciicast 7naKerRYUGVPj8kiDmdh5k5h9 >}}

View file

@ -82,7 +82,7 @@ jobs:
publish_dir: ./public 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 ## Use a Custom Domain

View file

@ -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. * 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. * 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 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) * 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) * 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). * 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).

View file

@ -64,9 +64,10 @@ a string representing HTML.
.Weight .Weight
: _int_ <br /> : _int_ <br />
Value of the `weight` key if set for the menu entry. If that key is not set, Value of the `weight` key if set for the menu entry. By default the entries in
and if the menu entry is set in a page front-matter, this value defaults to the a menu are sorted ascending by their `weight`. If that key is not set, and if
page's `.Weight`. the menu entry is set in a page front-matter, this value defaults to the page's
`.Weight`.
.Parent .Parent
: _string_ <br /> : _string_ <br />

2
go.mod
View file

@ -2,4 +2,4 @@ module github.com/gohugoio/hugoDocs
go 1.12 go 1.12
require github.com/gohugoio/gohugoioTheme v0.0.0-20200711112515-b0dfe471654f // indirect require github.com/gohugoio/gohugoioTheme v0.0.0-20210301124928-2c15837dfec3 // indirect

2
go.sum
View file

@ -23,3 +23,5 @@ github.com/gohugoio/gohugoioTheme v0.0.0-20200518165806-0095b7b902a7 h1:Sy0hlWyZ
github.com/gohugoio/gohugoioTheme v0.0.0-20200518165806-0095b7b902a7/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs= github.com/gohugoio/gohugoioTheme v0.0.0-20200518165806-0095b7b902a7/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
github.com/gohugoio/gohugoioTheme v0.0.0-20200711112515-b0dfe471654f h1:BWJyycs4HD7tUbaU8RIGeMay84bIBWRVVLE3yajPas4= github.com/gohugoio/gohugoioTheme v0.0.0-20200711112515-b0dfe471654f h1:BWJyycs4HD7tUbaU8RIGeMay84bIBWRVVLE3yajPas4=
github.com/gohugoio/gohugoioTheme v0.0.0-20200711112515-b0dfe471654f/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs= github.com/gohugoio/gohugoioTheme v0.0.0-20200711112515-b0dfe471654f/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
github.com/gohugoio/gohugoioTheme v0.0.0-20210301124928-2c15837dfec3 h1:ShqzOFeeg54FPSuS6q8HSeTVgj2xNZRe/YS0jNbi21g=
github.com/gohugoio/gohugoioTheme v0.0.0-20210301124928-2c15837dfec3/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=