Squashed 'docs/' changes from 3e663efb2..fc61378a3

fc61378a3 Add Hugo 0.32 related docs
77edf7fd7 commands: Regenerate
af9d25458 Fix Blackfriday's Markdown extension name
1223dd63a Remove roadmap
b8bcb2fb8 Include note to allow hugo write permissions outside home dir
7dbccb936 Fix typo in roadmap
3a38da6f5 Fix spelling
94ebe50ff Merge branch 'master' of github.com:gohugoio/hugoDocs
89376e21d Clarify Hugo Roadmap
03d191fec Mention Reverse function in taxonomy tpl page.
a4ea3402d Fix ref and relref function pages.
b36632b31 Remove non-existing source variable
a638160dc Update Content Organization to match the world
47eb431ca Correct one link in templates/output-formats.md
8bf933629 Spell fix
ce2d48728 Add docs for .AllTranslations
de94b4942 Move sponsor data to theme data
41fe75254 Merge commit 'f463ef99ed2862e4042557e28aece7ca858e1d0a'
f463ef99e Squashed 'themes/gohugoioTheme/' changes from bc851da9..75da2f6b
532c65f2a Move sponsor logo to theme
899e2defe Add sponsor logos to home page and footer
3ca53db97 Release 0.31.1
bb9876ce2 Merge branch 'temp0311'
c7c3ee7e5 releaser: Prepare repository for 0.32-DEV
4ac554792 releaser: Add release notes to /docs for release of 0.31.1
52bfb5c15 releaser: Bump versions for release of 0.31.1
cfdc2e4ea Fix output formats example
5746c10c2 More on output format
de2ee0fe0 Improve suffix redefinition example
c9997839e Update gitlab CI submodule management
82d74e306 Add Bootstrap styling to breadcrumb example
c8c9601a8 Use the code shortcode for the breadcrumb example
16be43e7d Clean up formatting in variable definition lists
149c2c157 Add nested section docs
783c3d636 Sync theme
60a220bbd Squashed 'themes/gohugoioTheme/' changes from 6b632895..bc851da9
4b33a04d0 Fix typo
94cffc43c Fix little typo
a5d4f762f Fix typo
36c5a0b43 Add a note about the 2 in staticDir2
087bd9a9f Add KeyCDN to menu
4ac8aae38 Hugo 0.31 Released
8fdd995e7 releaser: Prepare repository for 0.32-DEV
eb0f38fbb releaser: Add release notes to /docs for release of 0.31
60efdfff7 releaser: Bump versions for release of 0.31
44dafb10b Merge commit '30c0d485eaff6d70df1be0353911ddca485d52bf'
e6b847b95 Merge commit '05e42bc643f1840ed2ad9c2eff82a269d1381683'
15d86a525 Handle Taxonomy permalinks
5c3c18d7f Add support for height argument to figure shortcode

git-subtree-dir: docs
git-subtree-split: fc61378a3227c14883a2942d67c806014e7bb6cb
This commit is contained in:
Bjørn Erik Pedersen 2017-12-30 09:15:31 +01:00
parent 30c0d485ea
commit f3cd083961
73 changed files with 771 additions and 470 deletions

View file

@ -71,7 +71,7 @@ twitter = "GoHugoIO"
[params]
description = "The worlds fastest framework for building websites"
## Used for views in rendered HTML (i.e., rather than using the .Hugo variable)
release = "0.30.2"
release = "0.31.1"
## Setting this to true will add a "noindex" to *EVERY* page on the site
removefromexternalsearch = false
## Gh repo for site footer (include trailing slash)

178
content/about/new-in-032.md Normal file
View file

@ -0,0 +1,178 @@
---
title: Hugo 0.32 HOWTO
description: About page bundles, image processing and more.
date: 2017-12-28
keywords: [ssg,static,performance,security]
menu:
docs:
parent: "about"
weight: 10
weight: 10
sections_weight: 10
draft: false
aliases: []
toc: true
---
{{% note %}}
This documentation belongs in other places in this documentation site, but is put here first ... to get something up and running fast.
{{% /note %}}
Also see this demo project from [bep](https://github.com/bep/), the clever Norwegian behind these new features:
* http://hugotest.bep.is/
* https://github.com/bep/hugotest (source)
## Page Resources
### Organize Your Content
{{< figure src="/images/hugo-content-bundles.png" title="Pages with image resources" >}}
The content folder above shows a mix of content pages (`md` (i.e. markdown) files) and image resources.
{{% note %}}
You can use any file type as a content resource as long as it is a MIME type recognized by Hugo (`json` files will, as one example, work fine). If you want to get exotic, you can define your [own media type](/templates/output-formats/#media-types).
{{% /note %}}
The 3 page bundles marked in red explained from top to bottom:
1. The home page with one image resource (`1-logo.png`)
2. The blog section with two images resources and two pages resources (`content1.md`, `content2.md`). Note that the `_index.md` represents the URL for this section.
3. An article (`hugo-is-cool`) with a folder with some images and one content resource (`cats-info.md`). Note that the `index.md` represents the URL for this article.
The content files below `blog/posts` are just regular standalone pages.
{{% note %}}
Note that changes to any resource inside the `content` folder will trigger a reload when running in watch (aka server or live reload mode), it will even work with `--navigateToChanged`.
{{% /note %}}
#### Sort Order
* Pages are sorted according to standard Hugo page sorting rules.
* Images and other resources are sorted in lexicographical order.
### Handle Page Resources in Templates
#### List all Resources
```html
{{ range .Resources }}
<li><a href="{{ .RelPermalink }}">{{ .ResourceType | title }}</a></li>
{{ end }}
```
For an absolute URL, use `.Permalink`.
**Note:** The permalink will be relative to the content page, respecting permalink settings. Also, included page resources will not have a value for `RelPermalink`.
#### List All Resources by Type
```html
{{ with .Resources.ByType "image" }}
{{ end }}
```
Type here is `page` for pages, else the main type in the MIME type, so `image`, `json` etc.
#### Get a Specific Resource
```html
{{ $logo := .Resources.GetByPrefix "logo" }}
{{ with $logo }}
{{ end }}
```
#### Include Page Resource Content
```html
{{ with .Resources.ByType "page" }}
{{ range . }}
<h3>{{ .Title }}</h3>
{{ .Content }}
{{ end }}
{{ end }}
```
## Image Processing
The `image` resource implements the methods `Resize`, `Fit` and `Fill`:
Resize
: Resize to the given dimension, `{{ $logo.Resize "200x" }}` will resize to 200 pixels wide and preserve the aspect ratio. Use `{{ $logo.Resize "200x100" }}` to control both height and width.
Fit
: Scale down the image to fit the given dimensions, e.g. `{{ $logo.Fit "200x100" }}` will fit the image inside a box that is 200 pixels wide and 100 pixels high.
Fill
: Resize and crop the image given dimensions, e.g. `{{ $logo.Fill "200x100" }}` will resize and crop to width 200 and height 100
{{% note %}}
Image operations in Hugo currently **do not preserve EXIF data** as this is not supported by Go's [image package](https://github.com/golang/go/search?q=exif&type=Issues&utf8=%E2%9C%93). This will be improved on in the future.
{{% /note %}}
### Image Processing Options
In addition to the dimensions (e.g. `200x100`) where either height or width can be omitted, Hugo supports a set of additional image options:
Anchor
: Only relevant for `Fill`. This is useful for thumbnail generation where the main motive is located in, say, the left corner. Valid are `Center`, `TopLeft`, `Top`, `TopRight`, `Left`, `Right`, `BottomLeft`, `Bottom`, `BottomRight`. Example: `{{ $logo.Fill "200x100 BottomLeft" }}`
JPEG Quality
: Only relevant for JPEG images, values 1 to 100 inclusive, higher is better. Default is 75. `{{ $logo.Resize "200x q50" }}`
Rotate
: Rotates an image by the given angle counter-clockwise. The rotation will be performed first to get the dimensions correct. `{{ $logo.Resize "200x r90" }}`. The main use of this is to be able to manually correct for [EXIF orientation](https://github.com/golang/go/issues/4341) of JPEG images.
Resample Filter
: Filter used in resizing. Default is `Box`, a simple and fast resampling filter appropriate for downscaling. See https://github.com/disintegration/imaging for more. If you want to trade quality for faster processing, this may be a option to test.
### Performance
Processed images are stored below `<project-dir>/resources` (can be set with `resourceDir` config setting). This folder is deliberately placed in the project, as it is recommended to check these into source control as part of the project. These images are not "Hugo fast" to generate, but once generated they can be reused.
If you change your image settings (e.g. size), remove or rename images etc., you will end up with unused images taking up space and cluttering your project.
To clean up, run:
```bash
hugo --gc
```
{{% note %}}
**GC** is short for **Garbage Collection**.
{{% /note %}}
## Configuration
### Default Image Processing Config
You can configure an `imaging` section in `config.toml` with default image processing options:
```toml
[imaging]
# Default resample filter used for resizing. Default is Box,
# a simple and fast averaging filter appropriate for downscaling.
# See https://github.com/disintegration/imaging
resampleFilter = "box"
# Defatult JPEG quality setting. Default is 75.
quality = 68
```

View file

@ -1,51 +0,0 @@
---
title: Roadmap
linktitle: Roadmap
description: Take a look at what's in the pipeline for future versions of the Hugo project.
date: 2017-02-01
publishdate: 2017-02-01
lastmod: 2017-02-01
categories: [about hugo]
keywords: [about,contribute,roadmap]
menu:
docs:
parent: "about"
weight: 50
weight: 50
sections_weight: 50
draft: false
aliases: [/meta/roadmap]
toc: false
---
To track Hugo's progress, see our [GitHub Milestones][milestones].
In no particular order, here are some other features currently being worked on:
* Even easier deployment to S3, SSH, GitHub, rsync. Give the [hosting and deployment][] section a shot.
* Import from other website systems. There are already [existing migration tools][migrate], but they dont cover all major platforms.
* An interactive web-based editor (See the [related forum thread][])
* Additional [themes][], which are always ongoing and [contributions are welcome][themescontrib]!
* Dynamic image resizing via shortcodes ({{< gh 1014 >}})
* Native support for additional content formats (AsciiDoc {{< gh 1435>}}, reST {{< gh 1436 >}})
* And, last but not least, [***your*** best ideas!][]
## Contributions Welcome
Feel free to [contribute to Hugo's development][devcontribute], [improve Hugo's documentation][doccontribute], or [open a new issue][newissue] if you have an idea for a new feature.
[#98]: https://github.com/gohugoio/hugo/issues/98
[#1014]: https://github.com/gohugoio/hugo/issues/1014
[#1435]: https://github.com/gohugoio/hugo/issues/1435
[#1436]: https://github.com/gohugoio/hugo/issues/1436
[devcontribute]: /contribute/development/
[doccontribute]: /contribute/documentation/
[hosting and deployment]: /hosting-and-deployment/
[migrate]: /tools/migrations/
[milestones]: https://github.com/gohugoio/hugo/milestones/
[newissue]: https://github.com/gohugoio/hugo/issues/
[related forum thread]: https://discourse.gohugo.io/t/web-based-editor/155
[themes]: /themes/
[themescontrib]: /contribute/themes/
[tutorials]: /tutorials
[***your*** best ideas!]: /contribute/

View file

@ -1,5 +1,5 @@
---
date: 2017-11-18T10:28:35+01:00
date: 2017-12-28T18:49:29+01:00
title: "hugo"
slug: hugo
url: /commands/hugo/
@ -42,6 +42,7 @@ hugo [flags]
--disableSitemap do not build Sitemap file
--enableGitInfo add Git revision, date and author info to the pages
--forceSyncStatic copy all files when static is changed.
--gc enable to run some cleanup tasks (remove unused cache files) after the build
-h, --help help for hugo
--i18n-warnings print missing translations
--ignoreCache ignores the cache directory
@ -80,4 +81,4 @@ hugo [flags]
* [hugo undraft](/commands/hugo_undraft/) - Undraft resets the content's draft status
* [hugo version](/commands/hugo_version/) - Print the version number of Hugo
###### Auto generated by spf13/cobra on 18-Nov-2017
###### Auto generated by spf13/cobra on 28-Dec-2017

View file

@ -1,5 +1,5 @@
---
date: 2017-11-18T10:28:35+01:00
date: 2017-12-28T18:49:29+01:00
title: "hugo benchmark"
slug: hugo_benchmark
url: /commands/hugo_benchmark/
@ -38,6 +38,7 @@ hugo benchmark [flags]
--disableSitemap do not build Sitemap file
--enableGitInfo add Git revision, date and author info to the pages
--forceSyncStatic copy all files when static is changed.
--gc enable to run some cleanup tasks (remove unused cache files) after the build
-h, --help help for benchmark
--i18n-warnings print missing translations
--ignoreCache ignores the cache directory
@ -72,4 +73,4 @@ hugo benchmark [flags]
### SEE ALSO
* [hugo](/commands/hugo/) - hugo builds your site
###### Auto generated by spf13/cobra on 18-Nov-2017
###### Auto generated by spf13/cobra on 28-Dec-2017

View file

@ -1,5 +1,5 @@
---
date: 2017-11-18T10:28:35+01:00
date: 2017-12-28T18:49:29+01:00
title: "hugo check"
slug: hugo_check
url: /commands/hugo_check/
@ -35,4 +35,4 @@ Contains some verification checks
* [hugo](/commands/hugo/) - hugo builds your site
* [hugo check ulimit](/commands/hugo_check_ulimit/) - Check system ulimit settings
###### Auto generated by spf13/cobra on 18-Nov-2017
###### Auto generated by spf13/cobra on 28-Dec-2017

View file

@ -1,5 +1,5 @@
---
date: 2017-11-18T10:28:35+01:00
date: 2017-12-28T18:49:29+01:00
title: "hugo check ulimit"
slug: hugo_check_ulimit
url: /commands/hugo_check_ulimit/
@ -39,4 +39,4 @@ hugo check ulimit [flags]
### SEE ALSO
* [hugo check](/commands/hugo_check/) - Contains some verification checks
###### Auto generated by spf13/cobra on 18-Nov-2017
###### Auto generated by spf13/cobra on 28-Dec-2017

View file

@ -1,5 +1,5 @@
---
date: 2017-11-18T10:28:35+01:00
date: 2017-12-28T18:49:29+01:00
title: "hugo config"
slug: hugo_config
url: /commands/hugo_config/
@ -38,4 +38,4 @@ hugo config [flags]
### SEE ALSO
* [hugo](/commands/hugo/) - hugo builds your site
###### Auto generated by spf13/cobra on 18-Nov-2017
###### Auto generated by spf13/cobra on 28-Dec-2017

View file

@ -1,5 +1,5 @@
---
date: 2017-11-18T10:28:35+01:00
date: 2017-12-28T18:49:29+01:00
title: "hugo convert"
slug: hugo_convert
url: /commands/hugo_convert/
@ -42,4 +42,4 @@ See convert's subcommands toJSON, toTOML and toYAML for more information.
* [hugo convert toTOML](/commands/hugo_convert_totoml/) - Convert front matter to TOML
* [hugo convert toYAML](/commands/hugo_convert_toyaml/) - Convert front matter to YAML
###### Auto generated by spf13/cobra on 18-Nov-2017
###### Auto generated by spf13/cobra on 28-Dec-2017

View file

@ -1,5 +1,5 @@
---
date: 2017-11-18T10:28:35+01:00
date: 2017-12-28T18:49:29+01:00
title: "hugo convert toJSON"
slug: hugo_convert_toJSON
url: /commands/hugo_convert_tojson/
@ -42,4 +42,4 @@ hugo convert toJSON [flags]
### SEE ALSO
* [hugo convert](/commands/hugo_convert/) - Convert your content to different formats
###### Auto generated by spf13/cobra on 18-Nov-2017
###### Auto generated by spf13/cobra on 28-Dec-2017

View file

@ -1,5 +1,5 @@
---
date: 2017-11-18T10:28:35+01:00
date: 2017-12-28T18:49:29+01:00
title: "hugo convert toTOML"
slug: hugo_convert_toTOML
url: /commands/hugo_convert_totoml/
@ -42,4 +42,4 @@ hugo convert toTOML [flags]
### SEE ALSO
* [hugo convert](/commands/hugo_convert/) - Convert your content to different formats
###### Auto generated by spf13/cobra on 18-Nov-2017
###### Auto generated by spf13/cobra on 28-Dec-2017

View file

@ -1,5 +1,5 @@
---
date: 2017-11-18T10:28:35+01:00
date: 2017-12-28T18:49:29+01:00
title: "hugo convert toYAML"
slug: hugo_convert_toYAML
url: /commands/hugo_convert_toyaml/
@ -42,4 +42,4 @@ hugo convert toYAML [flags]
### SEE ALSO
* [hugo convert](/commands/hugo_convert/) - Convert your content to different formats
###### Auto generated by spf13/cobra on 18-Nov-2017
###### Auto generated by spf13/cobra on 28-Dec-2017

View file

@ -1,5 +1,5 @@
---
date: 2017-11-18T10:28:35+01:00
date: 2017-12-28T18:49:29+01:00
title: "hugo env"
slug: hugo_env
url: /commands/hugo_env/
@ -38,4 +38,4 @@ hugo env [flags]
### SEE ALSO
* [hugo](/commands/hugo/) - hugo builds your site
###### Auto generated by spf13/cobra on 18-Nov-2017
###### Auto generated by spf13/cobra on 28-Dec-2017

View file

@ -1,5 +1,5 @@
---
date: 2017-11-18T10:28:35+01:00
date: 2017-12-28T18:49:29+01:00
title: "hugo gen"
slug: hugo_gen
url: /commands/hugo_gen/
@ -38,4 +38,4 @@ A collection of several useful generators.
* [hugo gen doc](/commands/hugo_gen_doc/) - Generate Markdown documentation for the Hugo CLI.
* [hugo gen man](/commands/hugo_gen_man/) - Generate man pages for the Hugo CLI
###### Auto generated by spf13/cobra on 18-Nov-2017
###### Auto generated by spf13/cobra on 28-Dec-2017

View file

@ -1,5 +1,5 @@
---
date: 2017-11-18T10:28:35+01:00
date: 2017-12-28T18:49:29+01:00
title: "hugo gen autocomplete"
slug: hugo_gen_autocomplete
url: /commands/hugo_gen_autocomplete/
@ -56,4 +56,4 @@ hugo gen autocomplete [flags]
### SEE ALSO
* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
###### Auto generated by spf13/cobra on 18-Nov-2017
###### Auto generated by spf13/cobra on 28-Dec-2017

View file

@ -1,5 +1,5 @@
---
date: 2017-11-18T10:28:35+01:00
date: 2017-12-28T18:49:29+01:00
title: "hugo gen chromastyles"
slug: hugo_gen_chromastyles
url: /commands/hugo_gen_chromastyles/
@ -43,4 +43,4 @@ hugo gen chromastyles [flags]
### SEE ALSO
* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
###### Auto generated by spf13/cobra on 18-Nov-2017
###### Auto generated by spf13/cobra on 28-Dec-2017

View file

@ -1,5 +1,5 @@
---
date: 2017-11-18T10:28:35+01:00
date: 2017-12-28T18:49:29+01:00
title: "hugo gen doc"
slug: hugo_gen_doc
url: /commands/hugo_gen_doc/
@ -45,4 +45,4 @@ hugo gen doc [flags]
### SEE ALSO
* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
###### Auto generated by spf13/cobra on 18-Nov-2017
###### Auto generated by spf13/cobra on 28-Dec-2017

View file

@ -1,5 +1,5 @@
---
date: 2017-11-18T10:28:35+01:00
date: 2017-12-28T18:49:29+01:00
title: "hugo gen man"
slug: hugo_gen_man
url: /commands/hugo_gen_man/
@ -41,4 +41,4 @@ hugo gen man [flags]
### SEE ALSO
* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
###### Auto generated by spf13/cobra on 18-Nov-2017
###### Auto generated by spf13/cobra on 28-Dec-2017

View file

@ -1,5 +1,5 @@
---
date: 2017-11-18T10:28:35+01:00
date: 2017-12-28T18:49:29+01:00
title: "hugo import"
slug: hugo_import
url: /commands/hugo_import/
@ -37,4 +37,4 @@ Import requires a subcommand, e.g. `hugo import jekyll jekyll_root_path target_p
* [hugo](/commands/hugo/) - hugo builds your site
* [hugo import jekyll](/commands/hugo_import_jekyll/) - hugo import from Jekyll
###### Auto generated by spf13/cobra on 18-Nov-2017
###### Auto generated by spf13/cobra on 28-Dec-2017

View file

@ -1,5 +1,5 @@
---
date: 2017-11-18T10:28:35+01:00
date: 2017-12-28T18:49:29+01:00
title: "hugo import jekyll"
slug: hugo_import_jekyll
url: /commands/hugo_import_jekyll/
@ -41,4 +41,4 @@ hugo import jekyll [flags]
### SEE ALSO
* [hugo import](/commands/hugo_import/) - Import your site from others.
###### Auto generated by spf13/cobra on 18-Nov-2017
###### Auto generated by spf13/cobra on 28-Dec-2017

View file

@ -1,5 +1,5 @@
---
date: 2017-11-18T10:28:35+01:00
date: 2017-12-28T18:49:29+01:00
title: "hugo list"
slug: hugo_list
url: /commands/hugo_list/
@ -40,4 +40,4 @@ List requires a subcommand, e.g. `hugo list drafts`.
* [hugo list expired](/commands/hugo_list_expired/) - List all posts already expired
* [hugo list future](/commands/hugo_list_future/) - List all posts dated in the future
###### Auto generated by spf13/cobra on 18-Nov-2017
###### Auto generated by spf13/cobra on 28-Dec-2017

View file

@ -1,5 +1,5 @@
---
date: 2017-11-18T10:28:35+01:00
date: 2017-12-28T18:49:29+01:00
title: "hugo list drafts"
slug: hugo_list_drafts
url: /commands/hugo_list_drafts/
@ -39,4 +39,4 @@ hugo list drafts [flags]
### SEE ALSO
* [hugo list](/commands/hugo_list/) - Listing out various types of content
###### Auto generated by spf13/cobra on 18-Nov-2017
###### Auto generated by spf13/cobra on 28-Dec-2017

View file

@ -1,5 +1,5 @@
---
date: 2017-11-18T10:28:35+01:00
date: 2017-12-28T18:49:29+01:00
title: "hugo list expired"
slug: hugo_list_expired
url: /commands/hugo_list_expired/
@ -40,4 +40,4 @@ hugo list expired [flags]
### SEE ALSO
* [hugo list](/commands/hugo_list/) - Listing out various types of content
###### Auto generated by spf13/cobra on 18-Nov-2017
###### Auto generated by spf13/cobra on 28-Dec-2017

View file

@ -1,5 +1,5 @@
---
date: 2017-11-18T10:28:35+01:00
date: 2017-12-28T18:49:29+01:00
title: "hugo list future"
slug: hugo_list_future
url: /commands/hugo_list_future/
@ -40,4 +40,4 @@ hugo list future [flags]
### SEE ALSO
* [hugo list](/commands/hugo_list/) - Listing out various types of content
###### Auto generated by spf13/cobra on 18-Nov-2017
###### Auto generated by spf13/cobra on 28-Dec-2017

View file

@ -1,5 +1,5 @@
---
date: 2017-11-18T10:28:35+01:00
date: 2017-12-28T18:49:29+01:00
title: "hugo new"
slug: hugo_new
url: /commands/hugo_new/
@ -48,4 +48,4 @@ hugo new [path] [flags]
* [hugo new site](/commands/hugo_new_site/) - Create a new site (skeleton)
* [hugo new theme](/commands/hugo_new_theme/) - Create a new theme
###### Auto generated by spf13/cobra on 18-Nov-2017
###### Auto generated by spf13/cobra on 28-Dec-2017

View file

@ -1,5 +1,5 @@
---
date: 2017-11-18T10:28:35+01:00
date: 2017-12-28T18:49:29+01:00
title: "hugo new site"
slug: hugo_new_site
url: /commands/hugo_new_site/
@ -43,4 +43,4 @@ hugo new site [path] [flags]
### SEE ALSO
* [hugo new](/commands/hugo_new/) - Create new content for your site
###### Auto generated by spf13/cobra on 18-Nov-2017
###### Auto generated by spf13/cobra on 28-Dec-2017

View file

@ -1,5 +1,5 @@
---
date: 2017-11-18T10:28:35+01:00
date: 2017-12-28T18:49:29+01:00
title: "hugo new theme"
slug: hugo_new_theme
url: /commands/hugo_new_theme/
@ -42,4 +42,4 @@ hugo new theme [name] [flags]
### SEE ALSO
* [hugo new](/commands/hugo_new/) - Create new content for your site
###### Auto generated by spf13/cobra on 18-Nov-2017
###### Auto generated by spf13/cobra on 28-Dec-2017

View file

@ -1,5 +1,5 @@
---
date: 2017-11-18T10:28:35+01:00
date: 2017-12-28T18:49:29+01:00
title: "hugo server"
slug: hugo_server
url: /commands/hugo_server/
@ -50,6 +50,7 @@ hugo server [flags]
--disableSitemap do not build Sitemap file
--enableGitInfo add Git revision, date and author info to the pages
--forceSyncStatic copy all files when static is changed.
--gc enable to run some cleanup tasks (remove unused cache files) after the build
-h, --help help for server
--i18n-warnings print missing translations
--ignoreCache ignores the cache directory
@ -90,4 +91,4 @@ hugo server [flags]
### SEE ALSO
* [hugo](/commands/hugo/) - hugo builds your site
###### Auto generated by spf13/cobra on 18-Nov-2017
###### Auto generated by spf13/cobra on 28-Dec-2017

View file

@ -1,5 +1,5 @@
---
date: 2017-11-18T10:28:35+01:00
date: 2017-12-28T18:49:29+01:00
title: "hugo undraft"
slug: hugo_undraft
url: /commands/hugo_undraft/
@ -40,4 +40,4 @@ hugo undraft path/to/content [flags]
### SEE ALSO
* [hugo](/commands/hugo/) - hugo builds your site
###### Auto generated by spf13/cobra on 18-Nov-2017
###### Auto generated by spf13/cobra on 28-Dec-2017

View file

@ -1,5 +1,5 @@
---
date: 2017-11-18T10:28:35+01:00
date: 2017-12-28T18:49:29+01:00
title: "hugo version"
slug: hugo_version
url: /commands/hugo_version/
@ -38,4 +38,4 @@ hugo version [flags]
### SEE ALSO
* [hugo](/commands/hugo/) - hugo builds your site
###### Auto generated by spf13/cobra on 18-Nov-2017
###### Auto generated by spf13/cobra on 28-Dec-2017

View file

@ -63,7 +63,7 @@ Only the obvious non-global options can be overridden per language. Examples of
From **Hugo 0.31** we support multiple languages in a multihost configuration. See [this issue](https://github.com/gohugoio/hugo/issues/4027) for details.
This means that you can now confugre a `baseURL` per `language`:
This means that you can now configure a `baseURL` per `language`:
> If a `baseURL` is set on the `language` level, then all languages must have one and they must all be different.
@ -192,6 +192,19 @@ The above can be put in a `partial` (i.e., inside `layouts/partials/`) and inclu
The above also uses the [`i18n` function][i18func] described in the next section.
## List All Available Languages
`.AllTranslations` on a `Page` can be used to list all translations, including itself. Called on the home page it can be used to build a language navigator:
{{< code file="layouts/partials/allLanguages.html" >}}
<ul>
{{ range $.Site.Home.AllTranslations }}
<li><a href="{{ .}}">{{ .Language.LanguageName }}</a></li>
{{ end }}
</ul>
{{< /code >}}
## Translation of Strings
Hugo uses [go-i18n][] to support string translations. [See the project's source repository][go-i18n-source] to find tools that will help you manage your translation workflows.

View file

@ -17,20 +17,15 @@ aliases: [/content/sections/]
toc: true
---
{{% note %}}
This section is not updated with the new nested sections support in Hugo 0.24, see https://github.com/gohugoio/hugoDocs/issues/36
{{% /note %}}
{{% todo %}}
See above
{{% /todo %}}
{{< youtube 0GZxidrlaRM >}}
## Organization of Content Source
In Hugo, your content should be organized in a manner that reflects the rendered website.
While Hugo supports content nested at any level, the top levels (i.e. `content/<DIRECTORIES>`) are special in Hugo and are considered the content [sections][]. Without any additional configuration, the following will just work:
While Hugo supports content nested at any level, the top levels (i.e. `content/<DIRECTORIES>`) are special in Hugo and are considered the content type used to determine layouts etc. To read more about sections, including how to nest them, see [sections][].
Without any additional configuration, the following will just work:
```
.
@ -49,11 +44,16 @@ While Hugo supports content nested at any level, the top levels (i.e. `content/<
## Path Breakdown in Hugo
The following demonstrates the relationships between your content organization and the output URL structure for your Hugo website when it renders. These examples assume you are [using pretty URLs][pretty], which is the default behavior for Hugo. The examples also assume a key-value of `baseurl = "https://example.com"` in your [site's configuration file][config].
### Index Pages: `_index.md`
`_index.md` has a special role in Hugo. It allows you to add front matter and content to your [list templates][lists] as of v0.18. These templates include those for [section templates][], [taxonomy templates][], [taxonomy terms templates][], and your [homepage template][]. In your templates, you can grab information from `_index.md` using the [`.Site.GetPage` function][getpage].
`_index.md` has a special role in Hugo. It allows you to add front matter and content to your [list templates][lists]. These templates include those for [section templates][], [taxonomy templates][], [taxonomy terms templates][], and your [homepage template][].
{{% note %}}
**Tip:** You can get a reference to the content and metadata in `_index.md` using the [`.Site.GetPage` function](/functions/getpage/).
{{% /note %}}
You can keep one `_index.md` for your homepage and one in each of your content sections, taxonomies, and taxonomy terms. The following shows typical placement of an `_index.md` that would contain content and front matter for a `posts` section list page on a Hugo website:
@ -81,6 +81,9 @@ At build, this will output to the following destination with the associated valu
https://example.com/posts/index.html
```
The [sections][] can be nested as deeply as you need. The important part to understand is, that to make the section tree fully navigational, at least the lower-most section needs a content file. (i.e. `_index.md`).
### Single Pages in Sections
Single content files in each of your sections are going to be rendered as [single page templates][singles]. Here is an example of a single `post` within `posts`:
@ -107,27 +110,6 @@ At the time Hugo builds your site, the content will be output to the following d
https://example.com/posts/my-first-hugo-post/index.html
```
### Section with Nested Directories
To continue the example, the following demonstrates destination paths for a file located at `content/events/chicago/lollapalooza.md` in the same site:
```
section
⊢--^--⊣
url
⊢-------------^------------⊣
baseURL path slug
⊢--------^--------⊣ ⊢------^-----⊣⊢----^------⊣
permalink
⊢----------------------^-----------------------⊣
https://example.com/events/chicago/lollapalooza/
```
{{% note %}}
As of v0.20, Hugo does not recognize nested sections. While you can nest as many content *directories* as you'd like, any child directory of a section will still be considered the same section as that of its parents. Therefore, in the above example, `{{.Section}}` for `lollapalooza.md` is `events` and *not* `chicago`. See the [related issue on GitHub](https://github.com/gohugoio/hugo/issues/465).
{{% /note %}}
## Paths Explained

View file

@ -1,7 +1,7 @@
---
title: Content Sections
linktitle: Sections
description: Hugo supports content sections, which according to Hugo's default behavior, will reflect the structure of the rendered website.
description: "Hugo generates a **section tree** that matches your content."
date: 2017-02-01
publishdate: 2017-02-01
lastmod: 2017-02-01
@ -17,53 +17,65 @@ aliases: [/content/sections/]
toc: true
---
## Nested Sections
The sections can be nested as deeply as you need.
```bash
blog
├── funny-cats
│   └── kittens
│   └── _index.md
└── tech
└── _index.md
```
**The important part to understand is, that to make the section tree fully navigational, at least the lower-most section needs a content file. (e.g. `_index.md`).**
{{% note %}}
This section is not updated with the new nested sections support in Hugo 0.24, see https://github.com/gohugoio/hugoDocs/issues/36
When we talk about a **section** in correlation with template selection, it is currently always the root section only (`/blog/funny/mypost/ => blog`).
It is currently not possible to add a specific layout for one of the sub-sections.
{{% /note %}}
{{% todo %}}
See above
{{% /todo %}}
Hugo believes that you organize your content with a purpose. The same structure that works to organize your source content is used to organize the rendered site (see [directory structure][]).
Following this pattern, Hugo uses the top level of your content organization as the content **section**.
## Example: Breadcrumb Navigation
The following example shows a content directory structure for a website that has three sections: "authors," "events," and "posts":
With the available [section variables and methods](#section-page-variables-and-methods) you can build powerful navigation. One common example would be a partial to show Breadcrumb navigation:
```
.
└── content
├── authors
| ├── _index.md // <- example.com/authors/
| ├── john-doe.md // <- example.com/authors/john-doe/
| └── jane-doe.md // <- example.com/authors/jane-doe/
└── events
| ├── _index.md // <- example.com/events/
| ├── event-1.md // <- example.com/events/event-1/
| ├── event-2.md // <- example.com/events/event-2/
| └── event-3.md // <- example.com/events/event-3/
└── posts
| ├── _index.md // <- example.com/posts/
| ├── post-1.md // <- example.com/posts/post-1/
| ├── post-2.md // <- example.com/posts/post-2/
| ├── post-3.md // <- example.com/posts/post-3/
| ├── post-4.md // <- example.com/posts/post-4/
| └── post-5.md // <- example.com/posts/post-5/
```
{{< code file="layouts/partials/breadcrumb.html" download="breadcrumb.html" >}}
<ol class="nav navbar-nav">
{{ template "breadcrumbnav" (dict "p1" . "p2" .) }}
</ol>
{{ define "breadcrumbnav" }}
{{ if .p1.Parent }}
{{ template "breadcrumbnav" (dict "p1" .p1.Parent "p2" .p2 ) }}
{{ else if not .p1.IsHome }}
{{ template "breadcrumbnav" (dict "p1" .p1.Site.Home "p2" .p2 ) }}
{{ end }}
<li{{ if eq .p1 .p2 }} class="active"{{ end }}>
<a href="{{ .p1.Permalink }}">{{ .p1.Title }}</a>
</li>
{{ end }}
{{< /code >}}
## Section Page Variables and Methods
Also see [Page Variables](/variables/page/).
{{< readfile file="/content/readfiles/sectionvars.md" markdown="true" >}}
## Content Section Lists
Hugo will automatically create pages for each section root that list all of the content in that section. See the documentation on [section templates][] for details on customizing the way these pages are rendered.
As of Hugo v0.18, section pages can also have a content file and front matter. These section content files must be placed in their corresponding section folder and named `_index.md` in order for Hugo to correctly render the front matter and content.
{{% warning "`index.md` vs `_index.md`" %}}
Hugo themes developed before v0.18 often used an `index.md`(i.e., without the leading underscore [`_`]) in a content section as a hack to emulate the behavior of `_index.md`. The hack may work...*sometimes*; however, the order of page rendering can be unpredictable in Hugo. What works now may fail to render appropriately as your site grows. It is **strongly advised** to use `_index.md` as content for your section index pages. **Note:** `_index.md`'s layout, as representative of a section, is a [list page template](/templates/section-templates/) and *not* a [single page template](/templates/single-page-templates/). If you want to alter the new default behavior for `_index.md`, configure `disableKinds` accordingly in your [site's configuration](/getting-started/configuration/).
{{% /warning %}}
## Content *Section* vs Content *Type*
By default, everything created within a section will use the [content type][] that matches the section name. For example, Hugo will assume that `posts/post-1.md` has a `posts` content type. If you are using an [archetype][] for your posts section, Hugo will generate front matter according to what it finds in `archetypes/posts.md`.
By default, everything created within a section will use the [content type][] that matches the root section name. For example, Hugo will assume that `posts/post-1.md` has a `posts` content type. If you are using an [archetype][] for your posts section, Hugo will generate front matter according to what it finds in `archetypes/posts.md`.
[archetype]: /content-management/archetypes/
[content type]: /content-management/types/

View file

@ -42,4 +42,7 @@ In the above, with no theme used:
* The English site will get its static files as a union of "static1", "static2" and "static_en". On file duplicates, the right-most version will win.
* The Norwegian site will get its static files as a union of "staticDir_override" and "static_no".
**Note:** The `2` `static2` (can be a number between 0 and 10) is added to tell Hugo that you want to **add** this directory to the global set of static directories. Using `staticDir` on the language level would replace the global value.
**Note:** The example above is a [multihost setup](/content-management/multilingual/#configure-multilingual-multihost). In a regular setup, all the static directories will be available to all sites.

View file

@ -132,7 +132,7 @@ Note that if you use `preserveTaxonomyNames` and intend to manually construct UR
{{% note %}}
You can add content and front matter to your taxonomy list and taxonomy terms pages. See [Content Organization](/content-management/organization/) for more information on how to add an `_index.md` for this purpose.
Note also that taxonomy [permalinks](/content-management/urls/) are *not* configurable.
Much like regular pages, taxonomy list [permalinks](/content-management/urls/) are configurable, but taxonomy term page permalinks are not.
{{% /note %}}
## Add Taxonomies to Content

View file

@ -45,6 +45,8 @@ permalinks:
Only the content under `post/` will have the new URL structure. For example, the file `content/post/sample-entry.md` with `date: 2017-02-27T19:20:00-05:00` in its front matter will render to `public/2017/02/sample-entry/index.html` at build time and therefore be reachable at `https://example.com/2017/02/sample-entry/`.
You can also configure permalinks of taxonomies with the same syntax, by using the plural form of the taxonomy instead of the section. You will probably only want to use the configuration values `:slug` or `:title`.
### Permalink Configuration Values
The following is a list of values that can be used in a `permalink` definition in your site `config` file. All references to time are dependent on the content's date.

View file

@ -11,7 +11,7 @@ menu:
docs:
parent: "functions"
keywords: [cross references, anchors]
signature: ["ref CONTENT"]
signature: ["ref . CONTENT"]
workson: []
hugoversion:
relatedfuncs: [relref]
@ -19,12 +19,16 @@ deprecated: false
aliases: []
---
`ref` and `relRef` look up a content page by relative path (`relref`) or logical name (`ref`) to return the permalink:
`ref` and `relref` look up a content page by logical name (`ref`) or relative path (`relref`) to return the permalink:
```
{{ ref "about.md" }}
{{ ref . "about.md" }}
```
{{% note "Usage Note" %}}
`ref` looks up Hugo "Regular Pages" only. It can't be used for the homepage, section pages, etc.
{{% /note %}}
These functions are used in two of Hugo's built-in shortcodes. You can see basic usage examples of both `ref` and `relref` in the [shortcode documentation](/content-management/shortcodes/#ref-and-relref).
For an extensive explanation of how to leverage `ref` and `relref` for content management, see [Cross References](/content-management/cross-references/).

View file

@ -11,20 +11,24 @@ menu:
docs:
parent: "functions"
keywords: [cross references, anchors]
signature: ["relref CONTENT"]
signature: ["relref . CONTENT"]
workson: []
hugoversion:
relatedfuncs: [relref]
relatedfuncs: [ref]
deprecated: false
aliases: []
---
`ref` and `relRef` look up a content page by relative path (`relref`) or logical name (`ref`) to return the permalink:
`ref` and `relref` look up a content page by logical name (`ref`) or relative path (`relref`) to return the permalink:
```
{{ relref "about.md" }}
{{ relref . "about.md" }}
```
{{% note "Usage Note" %}}
`relref` looks up Hugo "Regular Pages" only. It can't be used for the homepage, section pages, etc.
{{% /note %}}
These functions are used in two of Hugo's built-in shortcodes. You can see basic usage examples of both `ref` and `relref` in the [shortcode documentation](/content-management/shortcodes/#ref-and-relref).
For an extensive explanation of how to leverage `ref` and `relref` for content management, see [Cross References](/content-management/cross-references/).

View file

@ -288,8 +288,7 @@ pygmentsUseClasses = false
SectionPagesMenu =
# default sitemap configuration map
sitemap =
# filesystem path to read files relative from
source = ""
# filesystem path to read static files relative from
staticDir = "static"
# display memory and timing of different steps of the program
stepAnalysis = false

View file

@ -424,10 +424,6 @@ In any of the [Linux distributions that support snaps][snaps]:
snap install hugo
```
{{% note %}}
Hugo-as-a-snap can write only inside the users `$HOME` directory---and gvfs-mounted directories owned by the user---because of Snaps confinement and security model. More information is also available [in this related GitHub issue](https://github.com/gohugoio/hugo/issues/3143).
{{% /note %}}
### Debian and Ubuntu
Debian and Ubuntu provide a `hugo` version via `apt-get`:
@ -445,6 +441,10 @@ sudo apt-get install hugo
* Might not be the latest version, especially if you are using an older, stable version (e.g., Ubuntu 16.04 LTS). Until backports and PPA are available, you may consider installing the Hugo snap package to get the latest version of Hugo.
{{% note %}}
Hugo-as-a-snap can write only inside the users `$HOME` directory---and gvfs-mounted directories owned by the user---because of Snaps confinement and security model. More information is also available [in this related GitHub issue](https://github.com/gohugoio/hugo/issues/3143). Use ```sudo apt-get install hugo --classic``` to disable the default security model if you want hugo to be able to have write access in other paths besides the users `$HOME` directory.
{{% /note %}}
### Arch Linux
You can also install Hugo from the Arch Linux [community](https://www.archlinux.org/packages/community/x86_64/hugo/) repository. Applies also for derivatives such as Manjaro.

View file

@ -4,7 +4,7 @@ linktitle: Host on GitLab
description: GitLab makes it incredibly easy to build, deploy, and host your Hugo website via their free GitLab Pages service, which provides native support for Hugo.
date: 2016-06-23
publishdate: 2016-06-23
lastmod: 2016-06-23
lastmod: 2017-11-16
categories: [hosting and deployment]
keywords: [hosting,deployment,git,gitlab]
authors: [Riku-Pekka Silvola]
@ -40,9 +40,8 @@ In the root directory of your Hugo site, create a `.gitlab-ci.yml` file. The `.g
{{< code file="gitlab-ci.yml" >}}
image: monachus/hugo
before_script:
- git submodule init
- git submodule update --force
variables:
GIT_SUBMODULE_STRATEGY: recursive
pages:
script:

View file

@ -4,6 +4,10 @@ date: 2017-09-12
description: "Accelerate your Hugo site globally with a KeyCDN integration. This tutorial shows you how to setup your static site as a GitLab page behind a KeyCDN pull zone."
categories: [hosting and deployment]
keywords: [keycdn,hosting,deployment,cdn]
menu:
docs:
parent: "hosting-and-deployment"
weight: 40
slug: ""
aliases: []
toc: false

View file

@ -0,0 +1,80 @@
---
date: 2017-11-20
title: "Hugo 0.31: Language Multihost Edition!"
description: "Hugo 0.31: Multihost, smart union static dirs, and more ..."
slug: "0.31-relnotes"
categories: ["Releases"]
images:
- images/blog/hugo-31-poster.png
---
Hugo `0.31` is the **Language Multihost Edition!**
> <img src="https://esolia.com/img/eSolia-Logo-Flat-2015.svg" alt="eSolia" width="100px" align="top" style="width:100px" />The Multihost feature is sponsored by [eSolia](https://esolia.com/), [@rickcogley](https://github.com/rickcogley)'s company.
[Multihost](https://gohugo.io/content-management/multilingual/#configure-multilingual-multihost) means that you can have a **`baseURL` per language**, for example, `https://no.example.com` and `https://en.example.com`. This is seamlessly integrated, and the built-in web server with live reload and `navigateToChanged` etc. just works. A related enhancement in this release is the support for **as many static dirs as you need**, with intelligent language overrides, forming a big union file system. Add to that several other language related fixes and enhancements, it is safe to say that this is the version you want for multilingual Hugo sites!
This release represents **44 contributions by 7 contributors** to the main Hugo code base.
[@bep](https://github.com/bep) leads the Hugo development with a significant amount of contributions, but also a big shoutout to [@kaushalmodi](https://github.com/kaushalmodi), [@natefinch](https://github.com/natefinch), and [@betaveros](https://github.com/betaveros) for their ongoing contributions.
And as always a big thanks to [@digitalcraftsman](https://github.com/digitalcraftsman) for his relentless work on keeping the documentation and the themes site in pristine condition.
Many have also been busy writing and fixing the documentation in [hugoDocs](https://github.com/gohugoio/hugoDocs),
which has received **13 contributions by 9 contributors**. A special thanks to [@oncletom](https://github.com/oncletom), [@kaushalmodi](https://github.com/kaushalmodi), [@XhmikosR](https://github.com/XhmikosR), and [@digitalcraftsman](https://github.com/digitalcraftsman) for their work on the documentation site.
Hugo now has:
* 21105+ [stars](https://github.com/gohugoio/hugo/stargazers)
* 455+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
* 184+ [themes](http://themes.gohugo.io/)
## Notes
* For mapping of translated content, Hugo now considers the full path of the content file, which makes it possible with translation of duplicate content filenames such as `index.md`. A specific translation key can be specified with the new `translationKey` front matter variable. See [#2699](https://github.com/gohugoio/hugo/issues/2699).
## Enhancements
### Language related
* Support unknown language codes [23ba779f](https://github.com/gohugoio/hugo/commit/23ba779fab90ce45cddd68b4f49a2515ce6d4878) [@bep](https://github.com/bep) [#3564](https://github.com/gohugoio/hugo/issues/3564)
* Fix `.IsTranslated` with identical filenames [b3daa1f4](https://github.com/gohugoio/hugo/commit/b3daa1f4bf1b84bcc5da028257ba609be74e3ecc) [@bep](https://github.com/bep) [#2699](https://github.com/gohugoio/hugo/issues/2699)
* Fall back to unstranslated base template [0a81a6b4](https://github.com/gohugoio/hugo/commit/0a81a6b4bae3de53aa9c179b855c671a2d30eec7) [@bep](https://github.com/bep) [#3893](https://github.com/gohugoio/hugo/issues/3893)
* Add support for multiple static dirs [60dfb9a6](https://github.com/gohugoio/hugo/commit/60dfb9a6e076200ab3ca3fd30e34bb3c14e0a893) [@bep](https://github.com/bep) [#36](https://github.com/gohugoio/hugo/issues/36)[#4027](https://github.com/gohugoio/hugo/issues/4027)
* Add multilingual multihost support [2e046576](https://github.com/gohugoio/hugo/commit/2e0465764b5dacc511b977b1c9aa07324ad0ee9c) [@bep](https://github.com/bep) [#4027](https://github.com/gohugoio/hugo/issues/4027)
### Templates
* Refactor `Mod` with `cast` [76dc811c](https://github.com/gohugoio/hugo/commit/76dc811c6539b2ed8b4d3b22693e5088b9f6ecfe) [@artem-sidorenko](https://github.com/artem-sidorenko)
* Add support for height argument to figure shortcode [488631fe](https://github.com/gohugoio/hugo/commit/488631fe0abc3667355345c7eb98ba7a2204deb5) [@kaushalmodi](https://github.com/kaushalmodi) [#4014](https://github.com/gohugoio/hugo/issues/4014)
### Core
* Use ms precision for static change logging [bb048d81](https://github.com/gohugoio/hugo/commit/bb048d811d3977adb10656335cd339cd8c945a25) [@bep](https://github.com/bep)
* Update Chroma to get the latest SASS lexer [b32ffed6](https://github.com/gohugoio/hugo/commit/b32ffed6abc67646cad89e163846f3ffef29cec8) [@bep](https://github.com/bep) [#4069](https://github.com/gohugoio/hugo/issues/4069)
* Bump to Go 1.9.2 [9299a16c](https://github.com/gohugoio/hugo/commit/9299a16c9952a284d3ac3f31d2662f1812f77768) [@bep](https://github.com/bep) [#4064](https://github.com/gohugoio/hugo/issues/4064)
* Update Travis and snapcraft to Go 1.9.2 [77cbd001](https://github.com/gohugoio/hugo/commit/77cbd001ff6b2e0aaa48566ef2af49ca68e19af9) [@bep](https://github.com/bep) [#4064](https://github.com/gohugoio/hugo/issues/4064)
* Handle Taxonomy permalinks [d9a78b61](https://github.com/gohugoio/hugo/commit/d9a78b61adefe8e1803529f4774185874af85148) [@betaveros](https://github.com/betaveros) [#1208](https://github.com/gohugoio/hugo/issues/1208)
### Other
* Support Fast Render mode with sub-path in baseURL [31641033](https://github.com/gohugoio/hugo/commit/3164103310fbca1211cfa9ce4a5eb7437854b6ad) [@bep](https://github.com/bep) [#3981](https://github.com/gohugoio/hugo/issues/3981)
* Simplify Site benchmarks [c3c10f2c](https://github.com/gohugoio/hugo/commit/c3c10f2c7ce4ee11186f51161943efc8b37a28c9) [@bep](https://github.com/bep)
* Replace `make` with `mage` to build Hugo [#3969](https://github.com/gohugoio/hugo/issues/3969)
* Convert to `dep` as dependency/vendor manager for Hugo [#3988](https://github.com/gohugoio/hugo/issues/3988)
* Pre-allocate some slices [a9be687b](https://github.com/gohugoio/hugo/commit/a9be687b81df01c7343f78f0d3760042f467baa4) [@bep](https://github.com/bep)
## Fixes
### Templates
* Make sure only one instance of a cached partial is rendered [#4086](https://github.com/gohugoio/hugo/issues/4086)
### Other
* Fix broken shortcodes for `Ace` and `Amber` [503ca6de](https://github.com/gohugoio/hugo/commit/503ca6de6ceb0b4af533f9efeff917d6f3871278) [@bep](https://github.com/bep) [#4051](https://github.com/gohugoio/hugo/issues/4051)
* Fix error handling in `mage` build [c9c19d79](https://github.com/gohugoio/hugo/commit/c9c19d794537cf76ff281788c3d6cf5f2beac54d) [@natefinch](https://github.com/natefinch)
* Fix `hugo -w` [fa53b13c](https://github.com/gohugoio/hugo/commit/fa53b13ca0ffb1db6ed20f5353661d3f8a5fd455) [@bep](https://github.com/bep) [#3980](https://github.com/gohugoio/hugo/issues/3980)

View file

@ -0,0 +1,20 @@
---
date: 2017-11-27
title: "Hugo 0.31.1: One Bugfix!"
description: "Fixes broken `--appendPort=false`."
slug: "0.31.1"
categories: ["Releases"]
images:
- images/blog/hugo-bug-poster.png
---
This is a bug-fix release with one important bug fix:
* Fix broken `--appendPort=false` [8afd7d9c](https://github.com/gohugoio/hugo/commit/8afd7d9ceb0d168300e3399c6e87a355a88c9a28) [@bep](https://github.com/bep) [#4111](https://github.com/gohugoio/hugo/issues/4111)

View file

@ -52,7 +52,7 @@
`extensions`
: default: **`[]`** <br>
Purpose: Enable one or more Blackfriday's Markdown extensions (**`EXTENSION_*`**). <br>
Example: Include `hardLineBreak` in the list to enable Blackfriday's `EXTENSION_HARD_LINK_BREAK`. <br>
Example: Include `hardLineBreak` in the list to enable Blackfriday's `EXTENSION_HARD_LINE_BREAK`. <br>
*See [Blackfriday extensions](#blackfriday-extensions) section for information on all extensions.*
`extensionsmask`

View file

@ -0,0 +1,20 @@
.CurrentSection
: the page's current section. The value can be the page itself if it is a section or the homepage.
.InSection $anotherPage
: whether the given page is in the current section. Note that this will always return false for pages that are not either regular, home or section pages.
.IsAncestor $anotherPage
: whether the current page is an ancestor of the given page. Note that this method is not relevant for taxonomy lists and taxonomy terms pages.
.IsDescendant $anotherPage
: whether the current page is a descendant of the given page. Note that this method is not relevant for taxonomy lists and taxonomy terms pages.
.Parent
: a section's parent section or a page's section.
.Section
: the [section](/content-management/sections/) this content belongs to. **Note:** For nested sections, this is the first path element in the directory, for example, `/blog/funny/mypost/ => blog`.
.Sections
: the [sections](/content-management/sections/) below this content.

View file

@ -101,7 +101,7 @@ Go templates only ship with a few basic functions but also provide a mechanism f
=> true (i.e., since 1 is less than 2)
```
Note that both examples make us of Go template's [math functions][].
Note that both examples make use of Go template's [math functions][].
{{% note "Additional Boolean Operators" %}}
There are more boolean operators than those listed in the Hugo docs in the [Golang template documentation](http://golang.org/pkg/text/template/#hdr-Functions).

View file

@ -37,8 +37,6 @@ 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.
Example in `config.toml`:
```
[mediaTypes]
[mediaTypes."text/enriched"]
@ -49,6 +47,21 @@ Example in `config.toml`:
The above example adds one new media type, `text/enriched`, and changes the suffix for the built-in `text/html` media type.
**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 output format. So, if you want to change the suffix of the `HTML` output format from `html` (default) to `htm`:
```toml
[mediaTypes]
[mediaTypes."text/html"]
suffix = "htm"
# Redefine HTML to update its media type.
[outputFormats]
[outputFormats.HTML]
mediaType = "text/html"
```
**Note** that for the above to work, you also need to add an`outputs` definition in your site config.
## Output Formats
Given a media type and some additional configuration, you get an `Output Format`:
@ -61,7 +74,7 @@ This is the full set of Hugo's built-in output formats:
* The `MediaType` must match the `Type` of an already defined media type.
* You can define new output formats or redefine built-in output formats; e.g., if you want to put `AMP` pages in a different path.
To add or modify an output format, define it in an `outputFormats` section in your site's [configuration file](/templates/configuration/), either for all sites or for a given language.
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.
```
[outputFormats.MyEnrichedFormat]

View file

@ -78,6 +78,9 @@ A Taxonomy is a `map[string]WeightedPages`.
.ByCount
: Returns an OrderedTaxonomy (slice) ordered by number of entries.
.Reverse
: Returns an OrderedTaxonomy (slice) in reverse order. Must be used with an OrderedTaxonomy.
### OrderedTaxonomy
Since Maps are unordered, an OrderedTaxonomy is a special structure that has a defined order.
@ -160,6 +163,17 @@ Taxonomies can be ordered by either alphabetical key or by the number of content
</ul>
```
### Order by Least Popular Example
```
<ul>
{{ $data := .Data }}
{{ range $key, $value := .Data.Terms.ByCount.Reverse }}
<li><a href="{{ $.Site.LanguagePrefix }}/{{ $data.Plural }}/{{ $value.Name | urlize }}"> {{ $value.Name }} </a> {{ $value.Count }} </li>
{{ end }}
</ul>
```
<!-- [See Also Taxonomy Lists](/templates/list/) -->
## Order Content within Taxonomies

View file

@ -24,25 +24,25 @@ For information on creating shortcodes and templates that tap into Hugo's file-r
The `.File` object contains the following fields:
`.File.Path`
.File.Path
: the original relative path of the page (e.g., `content/posts/foo.en.md`)
`.File.LogicalName`
.File.LogicalName
: the name of the content file that represents a page (e.g., `foo.en.md`)
`.File.TranslationBaseName`
.File.TranslationBaseName
: the filename without extension or optional language identifier (e.g., `foo`)
`.File.BaseFileName`
.File.BaseFileName
: the filename without extension (e.g., `foo.en`)
`.File.Ext`
.File.Ext
: the file extension of the content file (e.g., `md`); this can also be called using `.File.Extension` as well. Note that it is *only* the extension without `.`.
`.File.Lang`
.File.Lang
: the language associated with the given file if Hugo's [Multilingual features][multilingual] are enabled (e.g., `en`)
`.File.Dir`
.File.Dir
: given the path `content/posts/dir1/dir2/`, the relative directory path of the content file will be returned (e.g., `posts/dir1/dir2/`)
[Multilingual]: /content-management/multilingual/

View file

@ -33,22 +33,22 @@ Hugo's Git integrations should be fairly performant but *can* increase your buil
The `GitInfo` object contains the following fields:
`.AbbreviatedHash`
.AbbreviatedHash
: the abbreviated commit hash (e.g., `866cbcc`)
`.AuthorName`
.AuthorName
: the author's name, respecting `.mailmap`
`.AuthorEmail`
.AuthorEmail
: the author's email address, respecting `.mailmap`
`.AuthorDate`
.AuthorDate
: the author date
`.Hash`
.Hash
: the commit hash (e.g., `866cbccdab588b9908887ffd3b4f2667e94090c3`)
`.Subject`
.Subject
: commit message subject (e.g., `tpl: Add custom index function`)
## `.Lastmod`

View file

@ -21,16 +21,16 @@ wip: false
It contains the following fields:
`.Hugo.Generator`
.Hugo.Generator
: `<meta>` tag for the version of Hugo that generated the site. `.Hugo.Generator` outputs a *complete* HTML tag; e.g. `<meta name="generator" content="Hugo 0.18" />`
`.Hugo.Version`
.Hugo.Version
: the current version of the Hugo binary you are using e.g. `0.13-DEV`<br>
`.Hugo.CommitHash`
.Hugo.CommitHash
: the git commit hash of the current Hugo binary e.g. `0e8bed9ccffba0df554728b46c5bbf6d78ae5247`
`.Hugo.BuildDate`
.Hugo.BuildDate
: the compile date of the current Hugo binary formatted with RFC 3339 e.g. `2002-10-02T10:00:00-05:00`<br>
{{% note "Use the Hugo Generator Tag" %}}

View file

@ -20,31 +20,31 @@ toc: false
The [menu template][] has the following properties:
`.URL`
.URL
: string
`.Name`
.Name
: string
`.Menu`
.Menu
: string
`.Identifier`
.Identifier
: string
`.Pre`
.Pre
: template.HTML
`.Post`
.Post
: template.HTML
`.Weight`
.Weight
: int
`.Parent`
.Parent
: string
`.Children`
.Children
: Menu
[menu template]: /templates/menu-templates/

View file

@ -26,68 +26,65 @@ See [`.Scratch`](/functions/scratch/) for page-scoped, writable variables.
## Page Variables
`.AlternativeOutputFormats`
.AlternativeOutputFormats
: contains all alternative formats for a given page; this variable is especially useful `link rel` list in your site's `<head>`. (See [Output Formats](/templates/output-formats/).)
`.Content`
.Content
: the content itself, defined below the front matter.
`.CurrentSection`
: the page's current section. The value can be the page itself if it is a section or the homepage.
`.Data`
.Data
: the data specific to this type of page.
`.Date`
.Date
: the date associated with the page; `.Date` pulls from the `date` field in a content's front matter. See also `.ExpiryDate`, `.PublishDate`, and `.Lastmod`.
`.Description`
.Description
: the description for the page.
`.Dir`
.Dir
: the path of the folder containing this content file. The path is relative to the `content` folder.
`.Draft`
.Draft
: a boolean, `true` if the content is marked as a draft in the front matter.
`.ExpiryDate`
.ExpiryDate
: the date on which the content is scheduled to expire; `.ExpiryDate` pulls from the `expirydate` field in a content's front matter. See also `.PublishDate`, `.Date`, and `.Lastmod`.
`.File`
.File
: filesystem-related data for this content file. See also [File Variables][].
`.FuzzyWordCount`
.FuzzyWordCount
: the approximate number of words in the content.
`.Hugo`
.Hugo
: see [Hugo Variables](/variables/hugo/).
`.IsHome`
.IsHome
: `true` in the context of the [homepage](/templates/homepage/).
`.IsNode`
.IsNode
: always `false` for regular content pages.
`.IsPage`
.IsPage
: always `true` for regular content pages.
`.IsTranslated`
.IsTranslated
: `true` if there are translations to display.
`.Keywords`
.Keywords
: the meta keywords for the content.
`.Kind`
.Kind
: the page's *kind*. Possible return values are `page`, `home`, `section`, `taxonomy`, or `taxonomyTerm`. Note that there are also `RSS`, `sitemap`, `robotsTXT`, and `404` kinds, but these are only available during the rendering of each of these respective page's kind and therefore *not* available in any of the `Pages` collections.
`.Lang`
.Lang
: language taken from the language extension notation.
`.Language`
.Language
: a language object that points to the language's definition in the site
`config`.
`.Lastmod`
.Lastmod
: the date the content was last modified. `.Lastmod` pulls from the `lastmod` field in a content's front matter.
- If `lastmod` is not set, and `.GitInfo` feature is disabled, the front matter `date` field will be used.
@ -95,98 +92,98 @@ See [`.Scratch`](/functions/scratch/) for page-scoped, writable variables.
See also `.ExpiryDate`, `.Date`, `.PublishDate`, and [`.GitInfo`][gitinfo].
`.LinkTitle`
.LinkTitle
: access when creating links to the content. If set, Hugo will use the `linktitle` from the front matter before `title`.
`.Next`
.Next
: pointer to the following content (based on the `publishdate` field in front matter).
`.NextInSection`
.NextInSection
: pointer to the following content within the same section (based on `publishdate` field in front matter).
`.OutputFormats`
.OutputFormats
: contains all formats, including the current format, for a given page. Can be combined the with [`.Get` function](/functions/get/) to grab a specific format. (See [Output Formats](/templates/output-formats/).)
`.Pages`
.Pages
: a collection of associated pages. This value will be `nil` for regular content pages. `.Pages` is an alias for `.Data.Pages`.
`.Permalink`
.Permalink
: the Permanent link for this page; see [Permalinks](/content-management/urls/)
`.Plain`
.Plain
: the Page content stripped of HTML tags and presented as a string.
`.PlainWords`
.PlainWords
: the Page content stripped of HTML as a `[]string` using Go's [`strings.Fields`](https://golang.org/pkg/strings/#Fields) to split `.Plain` into a slice.
`.Prev`
.Prev
: Pointer to the previous content (based on `publishdate` in front matter).
`.PrevInSection`
.PrevInSection
: Pointer to the previous content within the same section (based on `publishdate` in front matter). For example, `{{if .PrevInSection}}{{.PrevInSection.Permalink}}{{end}}`.
`.PublishDate`
.PublishDate
: the date on which the content was or will be published; `.Publishdate` pulls from the `publishdate` field in a content's front matter. See also `.ExpiryDate`, `.Date`, and `.Lastmod`.
`.RSSLink`
.RSSLink
: link to the taxonomies' RSS link.
`.RawContent`
.RawContent
: raw markdown content without the front matter. Useful with [remarkjs.com](
http://remarkjs.com)
`.ReadingTime`
.ReadingTime
: the estimated time, in minutes, it takes to read the content.
`.Ref`
.Ref
: returns the permalink for a given reference (e.g., `.Ref "sample.md"`). `.Ref` does *not* handle in-page fragments correctly. See [Cross References](/content-management/cross-references/).
`.RelPermalink`
.RelPermalink
: the relative permanent link for this page.
`.RelRef`
.RelRef
: returns the relative permalink for a given reference (e.g., `RelRef
"sample.md"`). `.RelRef` does *not* handle in-page fragments correctly. See [Cross References](/content-management/cross-references/).
`.Section`
: the [section](/content-management/sections/) this content belongs to.
`.Sections`
: the [sections](/content-management/sections/) below this content.
`.Site`
.Site
: see [Site Variables](/variables/site/).
`.Summary`
.Summary
: a generated summary of the content for easily showing a snippet in a summary view. The breakpoint can be set manually by inserting <code>&lt;!&#x2d;&#x2d;more&#x2d;&#x2d;&gt;</code> at the appropriate place in the content page. See [Content Summaries](/content-management/summaries/) for more details.
`.TableOfContents`
.TableOfContents
: the rendered [table of contents](/content-management/toc/) for the page.
`.Title`
.Title
: the title for this page.
`.Translations`
.Translations
: a list of translated versions of the current page. See [Multilingual Mode](/content-management/multilingual/) for more information.
`.Truncated`
.Truncated
: a boolean, `true` if the `.Summary` is truncated. Useful for showing a "Read more..." link only when necessary. See [Summaries](/content-management/summaries/) for more information.
`.Type`
.Type
: the [content type](/content-management/types/) of the content (e.g., `post`).
`.URL`
.URL
: the URL for the page relative to the web root. Note that a `url` set directly in front matter overrides the default relative URL for the rendered page.
`.UniqueID`
.UniqueID
: the MD5-checksum of the content file's path.
`.Weight`
.Weight
: assigned weight (in the front matter) to this content, used in sorting.
`.WordCount`
.WordCount
: the number of words in the content.
## Section Variables and Methods
Also see [Sections](/content-management/sections/).
{{< readfile file="/content/readfiles/sectionvars.md" markdown="true" >}}
## Page-level Params
Any other value defined in the front matter in a content file, including taxonomies, will be made available as part of the `.Params` variable.

View file

@ -20,13 +20,13 @@ toc: false
[Shortcodes][shortcodes] have access to parameters delimited in the shortcode declaration via [`.Get`][getfunction], page- and site-level variables, and also the following shortcode-specific fields:
`.Parent`
.Parent
: provides access to the parent shortcode context in nested shortcodes. This can be very useful for inheritance of common shortcode parameters from the root.
`.IsNamedParams`
.IsNamedParams
: boolean that returns `true` when the shortcode in question uses [named rather than positional parameters][shortcodes]
`.Inner`
.Inner
: represents the content between the opening and closing shortcode tags when a [closing shortcode][markdownshortcode] is used
[getfunction]: /functions/get/

View file

@ -22,82 +22,82 @@ The following is a list of site-level (aka "global") variables. Many of these va
## Site Variables List
`.Site.AllPages`
.Site.AllPages
: array of all pages, regardless of their translation.
`.Site.Author`
.Site.Author
: a map of the authors as defined in the site configuration.
`.Site.BaseURL`
.Site.BaseURL
: the base URL for the site as defined in the site configuration.
`.Site.BuildDrafts`
.Site.BuildDrafts
: a boolean (default: `false`) to indicate whether to build drafts as defined in the site configuration.
`.Site.Copyright`
.Site.Copyright
: a string representing the copyright of your website as defined in the site configuration.
`.Site.Data`
.Site.Data
: custom data, see [Data Templates](/templates/data-templates/).
`.Site.DisqusShortname`
.Site.DisqusShortname
: a string representing the shortname of the Disqus shortcode as defined in the site configuration.
`.Site.Files`
.Site.Files
: all source files for the Hugo website.
`.Site.GoogleAnalytics`
.Site.GoogleAnalytics
: a string representing your tracking code for Google Analytics as defined in the site configuration.
`.Site.IsMultiLingual`
.Site.IsMultiLingual
: whether there are more than one language in this site. See [Multilingual](/content-management/multilingual/) for more information.
`.Site.Language.Lang`
.Site.Language.Lang
: the language code of the current locale (e.g., `en`).
`.Site.Language.LanguageName`
.Site.Language.LanguageName
: the full language name (e.g. `English`).
`.Site.Language.Weight`
.Site.Language.Weight
: the weight that defines the order in the `.Site.Languages` list.
`.Site.Language`
.Site.Language
: indicates the language currently being used to render the website. This object's attributes are set in site configurations' language definition.
`.Site.LanguageCode`
.Site.LanguageCode
: a string representing the language as defined in the site configuration. This is mostly used to populate the RSS feeds with the right language code.
`.Site.LanguagePrefix`
.Site.LanguagePrefix
: this can be used to prefix URLs to point to the correct language. It will even work when only one defined language. See also the functions [absLangURL](/functions/abslangurl/) and [relLangURL](/functions/rellangurl).
`.Site.Languages`
.Site.Languages
: an ordered list (ordered by defined weight) of languages.
`.Site.LastChange`
.Site.LastChange
: a string representing the date/time of the most recent change to your site. This string is based on the [`date` variable in the front matter](/content-management/front-matter) of your content pages.
`.Site.Menus`
.Site.Menus
: all of the menus in the site.
`.Site.Pages`
.Site.Pages
: array of all content ordered by Date with the newest first. This array contains only the pages in the current language.
`.Site.Permalinks`
.Site.Permalinks
: a string to override the default [permalink](/content-management/urls/) format as defined in the site configuration.
`.Site.RegularPages`
.Site.RegularPages
: a shortcut to the *regular* page collection. `.Site.RegularPages` is equivalent to `where .Site.Pages "Kind" "page"`.
`.Site.RSSLink`
.Site.RSSLink
: the URL for the site RSS.
`.Site.Sections`
.Site.Sections
: top-level directories of the site.
`.Site.Taxonomies`
.Site.Taxonomies
: the [taxonomies](/taxonomies/usage/) for the entire site. Replaces the now-obsolete `.Site.Indexes` since v0.11. Also see section [Taxonomies elsewhere](#taxonomies-elsewhere).
`.Site.Title`
.Site.Title
: a string representing the title of the site.
## The `.Site.Params` Variable

View file

@ -20,13 +20,13 @@ toc: false
A sitemap is a `Page` and therefore has all the [page variables][pagevars] available to use sitemap templates. They also have the following sitemap-specific variables available to them:
`.Sitemap.ChangeFreq`
.Sitemap.ChangeFreq
: the page change frequency
`.Sitemap.Priority`
.Sitemap.Priority
: the priority of the page
`.Sitemap.Filename`
.Sitemap.Filename
: the sitemap filename
[pagevars]: /variables/page/

View file

@ -24,22 +24,22 @@ toc: true
For example, the following fields would be available in `layouts/_defaults/terms.html`, depending on how you organize your [taxonomy templates][taxonomytemplates]:
`.Data.Singular`
.Data.Singular
: The singular name of the taxonomy (e.g., `tags => `tag`)
`.Data.Plural`
.Data.Plural
: The plural name of the taxonomy (e.g., `tags => tags`)
`.Data.Pages`
.Data.Pages
: The list of pages in the taxonomy
`.Data.Terms`
.Data.Terms
: The taxonomy itself
`.Data.Terms.Alphabetical`
.Data.Terms.Alphabetical
: The taxonomy terms alphabetized
`.Data.Terms.ByCount`
.Data.Terms.ByCount
: The Terms ordered by popularity
Note that `.Data.Terms.Alphabetical` and `.Data.Terms.ByCount` can also be reversed:

View file

@ -3,15 +3,15 @@
command = "hugo"
[context.production.environment]
HUGO_VERSION = "0.30.2"
HUGO_VERSION = "0.31.1"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"
[context.deploy-preview.environment]
HUGO_VERSION = "0.30.2"
HUGO_VERSION = "0.31.1"
[context.branch-deploy.environment]
HUGO_VERSION = "0.30.2"
HUGO_VERSION = "0.31.1"
[context.next.environment]
HUGO_BASEURL = "https://next--gohugoio.netlify.com/"

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

View file

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

View file

@ -0,0 +1,17 @@
[[banners]]
name = "Forestry.io"
link = "https://forestry.io/"
logo = "/images/sponsors/forestry-logotype.svg"
copy = ""
[[banners]]
name = ""
link = ""
logo = ""
copy = ""
[[banners]]
name = ""
link = ""
logo = ""
copy = ""

View file

@ -14,6 +14,9 @@
<section class="w-100 ph4 ph5-ns pv4 pv6-ns mid-gray bg-white bb bt b--light-gray">
{{- partial "home-page-sections/installation" . -}}
</section>
{{ partial "home-page-sections/sponsors.html" (dict "cx" . ) }}
<section class="w-100 ph4 ph5-ns pv4 pv6-ns mid-gray bg-accent-color-dark">
{{- partial "home-page-sections/tweets" . -}}
</section>

View file

@ -0,0 +1,30 @@
{{$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 "}}
{{ with .cx.Site.Data.sponsors }}
<section class="{{ $.classes_section | default "bg-primary-color-dark b--light-gray bb bt ph5 pv4 w-100"}}">
<div class="center mw9"> 
<f3 class="b f3 light-gray">Hugo Sponsors</f3>
<div class="flex-ns flex-wrap center justify-between pt3">
{{ range .banners }}
{{if .logo}}
<div class="{{$classes_box}} o-100">
{{with .link -}}
<a href="{{.}}?{{ (querify "utm_source" "homepage" "utm_medium" "banner" "utm_campaign" "hugosponsor") | safeURL }}" class="grow">
{{- end}}
<img src="{{ .logo }}" alt="Logo for {{ .name }}" class="img h3 center" />
{{with .link}}</a>{{end}}
{{with .copy}}
<p class="center lh-copy gray mv1 tc {{$.classes_copy | default "f5 w-70-ns"}}">
{{- . -}}
</p>
{{end}}
</div>
{{else}}
<div class="{{$classes_box}} o-10">
<p class="b black tc">Your Logo Here</p>
</div>
{{end}}
{{end}}
</div>
</div>
</section>
{{end}}

View file

@ -5,8 +5,8 @@
{{ partial "nav-links-docs-mobile.html" . }}
</div>
<div class="flex dn-l">
<button class="js-toggle flex-auto ml2 dib dn-l f6 tc db mt4-ns ph3 pv2 link white bg-primary-color-dark hover-bg-primary-color ba b--white-40 w-auto" data-target=".globalmenu">Menu</button>
<div class="flex dn-l justify-between">
<button class="js-toggle flex-auto dib dn-l f6 tc db mt4-ns ph3 pv2 link mr2 white bg-primary-color-dark hover-bg-primary-color ba b--white-40 w-auto" data-target=".globalmenu">Menu</button>
<button class="js-toggle flex-auto ml2 dib dn-l f6 tc db mt4-ns ph3 pv2 link white bg-primary-color-dark hover-bg-primary-color ba b--white-40 w-auto" data-target=".docsmenu">Docs Menu</button>
<button class="js-toggle flex-auto dib dn-l f6 tc db mt4-ns ph3 pv2 link white bg-primary-color-dark hover-bg-primary-color ba b--white-40 w-auto" data-target=".docsmenu">Docs Menu</button>
</div>

View file

@ -1,40 +1,48 @@
<footer class="fixed relative-l bg-primary-color-dark bottom-0 w-100 pa3 pa4-l" role="contentinfo">
<!-- TODO: Make sure we don't lose all the footer content on mobile -->
<!-- TODO: Add icons https://github.com/rdwatters/hugo-docs-concept/issues/3#issuecomment-287194777
-->
<div class="dn db-l flex-ns flex-wrap w-80 center mw9 justify-between">
<div class="w-third pv3 dn db-l">
<div class="mb3 gray tc nested-links">
<footer class="bg-primary-color-dark ph4-ns pt4 relative w-100" role="contentinfo">
<div class="center flex-ns flex-wrap justify-between mw9 w-90">
<div class="pb3 pt4 w-100 w-50-ns">
<div class="b f3 light-gray mb3 nested-links tc">
By the <a href="https://github.com/gohugoio/hugo/contributors" class="link">Hugo Authors</a><br />
</div>
<div class="w4 center">
{{ partialCached "svg/hugo-logo-wide.svg" (dict "size" "100") }}
</div>
<p class="f6 gray tc w-70 center">The Hugo logos are copyright © Steve Francia 2013{{ now.Year }}.</p>
<p class="f6 gray tc w-70 center">The Hugo Gopher is based on an original work by Renée French.</p>
<div class="center w4">
{{ partialCached "svg/hugo-logo-wide.svg" . }}
</div>
<ul class="center f6 list ma0 mv3 pa0 tc">
{{- with .Site.Params.github_repo -}}<li class="dib mr3"><a href="{{ . }}" class="dim link light-gray pv2">File an Issue</a></li>{{- end -}}
{{- with .Site.Params.forum -}}<li class="dib mr3"><a href="{{ . }}" class="dim link light-gray pv2">Get Help</a></li>{{- end -}}
{{- with .Site.Params.gitter -}}<li class="dib"><a href="{{ . }}" class="dim link light-gray pv2">Discuss Source Code</a></li>{{- end -}}
</ul>
<ul class="center f6 list ma0 mv4 pa0 tc">
<li class="dib mr3"><a href="https://twitter.com/gohugoio" class="dim link light-gray pv2">@GoHugoIO</a></li>
<li class="dib mr3"><a href="https://twitter.com/spf13" class="dim link light-gray pv2">@spf13</a></li>
<li class="dib"><a href="https://twitter.com/bepsays" class="dim link light-gray pv2">@bepsays</a></li>
</ul>
{{ with getenv "REPOSITORY_URL" -}}
<p class="f6 tc w-70 center"><a href="https://www.netlify.com"><img src="https://www.netlify.com/img/global/badges/netlify-dark.svg"/></a></p>
<p class="center f6 tc w-70"><a href="https://www.netlify.com"><img src="https://www.netlify.com/img/global/badges/netlify-dark.svg"/></a></p>
{{- end }}
</div>
<div class="w-third pv3 dn db-l">
<ul class="list ma0 pa0 w-50 center">
{{- with .Site.Params.github_repo -}}<li><a href="{{ . }}" class="link white dim pv2 db">File an Issue</a></li>{{- end -}}
{{- with .Site.Params.forum -}}<li><a href="{{ . }}" class="link white dim pv2 db">Get Help</a></li>{{- end -}}
{{- with .Site.Params.gitter -}}<li><a href="{{ . }}" class="link white dim pv2 db">Discuss the Source Code</a></li>{{- end -}}
</ul>
<div class="w-100 w-50-l"> 
{{ partial "home-page-sections/sponsors.html" (dict "cx" . "classes_section" "pb3 w-100" "classes_copy" "f7 w-90-ns") }}
</div>
<div class="w-third pv3 dn db-l">
<ul class="list ma0 pa0">
<li><a href="https://twitter.com/gohugoio" class="link white dim pv2 db">@GoHugoIO</a></li>
<li><a href="https://twitter.com/spf13" class="link white dim pv2 db">@spf13</a></li>
<li><a href="https://twitter.com/bepsays" class="link white dim pv2 db">@bepsays</a></li>
</ul>
</div>
</div>
<div class="f7 gray mb5 mb0-ns ph3 w-100"> 
<p class="dib mr4">The Hugo logos are copyright © Steve Francia 2013{{ now.Year }}.</p>
<p class="dib">The Hugo Gopher is based on an original work by Renée French.</p>
</div>
{{ partial "nav-mobile.html" . }}
<img src="/images/gopher-side_color.svg" class="absolute-l bottom-0 dn db-l h4 right-0 z-999"/>
<div class="bg-primary-color-dark bottom-0 dn-ns fixed pb3 ph3 w-100"> 
{{ partial "nav-mobile.html" . }}
</div>
</footer>

View file

@ -1,43 +1,67 @@
/* Background */ .chroma { background-color: #f0f0f0 }
/* Error */ .chroma .ss4 { }
/* Error */ .chroma .err { }
/* LineTableTD */ .chroma .lntd { ; vertical-align: top; padding: 0; margin: 0; border: 0; }
/* LineTable */ .chroma .lntable { ; border-spacing: 0; padding: 0; margin: 0; border: 0; width: 100%; overflow: auto; display: block; }
/* LineHighlight */ .chroma .hl { background-color: #ffffcc; display: block; width: 100% }
/* LineNumbersTable */ .chroma .lnt { ; margin-right: 0.4em; padding: 0 0.4em 0 0.4em; display: block; }
/* LineNumbers */ .chroma .ln { ; margin-right: 0.4em; padding: 0 0.4em 0 0.4em; }
/* Keyword */ .chroma .s3e8 { color: #007020; font-weight: bold }
/* KeywordPseudo */ .chroma .s3ec { color: #007020 }
/* KeywordType */ .chroma .s3ee { color: #902000 }
/* NameAttribute */ .chroma .s7d1 { color: #4070a0 }
/* NameBuiltin */ .chroma .s7d2 { color: #007020 }
/* NameClass */ .chroma .s7d4 { color: #0e84b5; font-weight: bold }
/* NameConstant */ .chroma .s7d5 { color: #60add5 }
/* NameDecorator */ .chroma .s7d6 { color: #555555; font-weight: bold }
/* NameEntity */ .chroma .s7d7 { color: #d55537; font-weight: bold }
/* NameException */ .chroma .s7d8 { color: #007020 }
/* NameFunction */ .chroma .s7d9 { color: #06287e }
/* NameLabel */ .chroma .s7dc { color: #002070; font-weight: bold }
/* NameNamespace */ .chroma .s7dd { color: #0e84b5; font-weight: bold }
/* NameTag */ .chroma .s7e2 { color: #062873; font-weight: bold }
/* NameVariable */ .chroma .s7e3 { color: #bb60d5 }
/* LiteralString */ .chroma .sc1c { color: #4070a0 }
/* LiteralStringDoc */ .chroma .sc23 { color: #4070a0; font-style: italic }
/* LiteralStringEscape */ .chroma .sc25 { color: #4070a0; font-weight: bold }
/* LiteralStringInterpol */ .chroma .sc27 { color: #70a0d0; font-style: italic }
/* LiteralStringOther */ .chroma .sc29 { color: #c65d09 }
/* LiteralStringRegex */ .chroma .sc2a { color: #235388 }
/* LiteralStringSymbol */ .chroma .sc2c { color: #517918 }
/* LiteralNumber */ .chroma .sc80 { color: #40a070 }
/* Operator */ .chroma .sfa0 { color: #666666 }
/* OperatorWord */ .chroma .sfa1 { color: #007020; font-weight: bold }
/* Comment */ .chroma .s1770 { color: #60a0b0; font-style: italic }
/* CommentSpecial */ .chroma .s1774 { color: #60a0b0; background-color: #fff0f0 }
/* CommentPreproc */ .chroma .s17d4 { color: #007020 }
/* GenericDeleted */ .chroma .s1b59 { color: #a00000 }
/* GenericEmph */ .chroma .s1b5a { font-style: italic }
/* GenericError */ .chroma .s1b5b { color: #ff0000 }
/* GenericHeading */ .chroma .s1b5c { color: #000080; font-weight: bold }
/* GenericInserted */ .chroma .s1b5d { color: #00a000 }
/* GenericOutput */ .chroma .s1b5e { color: #888888 }
/* GenericPrompt */ .chroma .s1b5f { color: #c65d09; font-weight: bold }
/* GenericStrong */ .chroma .s1b60 { font-weight: bold }
/* GenericSubheading */ .chroma .s1b61 { color: #800080; font-weight: bold }
/* GenericTraceback */ .chroma .s1b62 { color: #0044dd }
/* TextWhitespace */ .chroma .s1f41 { color: #bbbbbb }
/* Keyword */ .chroma .k { color: #007020; font-weight: bold }
/* KeywordConstant */ .chroma .kc { color: #007020; font-weight: bold }
/* KeywordDeclaration */ .chroma .kd { color: #007020; font-weight: bold }
/* KeywordNamespace */ .chroma .kn { color: #007020; font-weight: bold }
/* KeywordPseudo */ .chroma .kp { color: #007020 }
/* KeywordReserved */ .chroma .kr { color: #007020; font-weight: bold }
/* KeywordType */ .chroma .kt { color: #902000 }
/* NameAttribute */ .chroma .na { color: #4070a0 }
/* NameBuiltin */ .chroma .nb { color: #007020 }
/* NameClass */ .chroma .nc { color: #0e84b5; font-weight: bold }
/* NameConstant */ .chroma .no { color: #60add5 }
/* NameDecorator */ .chroma .nd { color: #555555; font-weight: bold }
/* NameEntity */ .chroma .ni { color: #d55537; font-weight: bold }
/* NameException */ .chroma .ne { color: #007020 }
/* NameFunction */ .chroma .nf { color: #06287e }
/* NameLabel */ .chroma .nl { color: #002070; font-weight: bold }
/* NameNamespace */ .chroma .nn { color: #0e84b5; font-weight: bold }
/* NameTag */ .chroma .nt { color: #062873; font-weight: bold }
/* NameVariable */ .chroma .nv { color: #bb60d5 }
/* LiteralString */ .chroma .s { color: #4070a0 }
/* LiteralStringAffix */ .chroma .sa { color: #4070a0 }
/* LiteralStringBacktick */ .chroma .sb { color: #4070a0 }
/* LiteralStringChar */ .chroma .sc { color: #4070a0 }
/* LiteralStringDelimiter */ .chroma .dl { color: #4070a0 }
/* LiteralStringDoc */ .chroma .sd { color: #4070a0; font-style: italic }
/* LiteralStringDouble */ .chroma .s2 { color: #4070a0 }
/* LiteralStringEscape */ .chroma .se { color: #4070a0; font-weight: bold }
/* LiteralStringHeredoc */ .chroma .sh { color: #4070a0 }
/* LiteralStringInterpol */ .chroma .si { color: #70a0d0; font-style: italic }
/* LiteralStringOther */ .chroma .sx { color: #c65d09 }
/* LiteralStringRegex */ .chroma .sr { color: #235388 }
/* LiteralStringSingle */ .chroma .s1 { color: #4070a0 }
/* LiteralStringSymbol */ .chroma .ss { color: #517918 }
/* LiteralNumber */ .chroma .m { color: #40a070 }
/* LiteralNumberBin */ .chroma .mb { color: #40a070 }
/* LiteralNumberFloat */ .chroma .mf { color: #40a070 }
/* LiteralNumberHex */ .chroma .mh { color: #40a070 }
/* LiteralNumberInteger */ .chroma .mi { color: #40a070 }
/* LiteralNumberIntegerLong */ .chroma .il { color: #40a070 }
/* LiteralNumberOct */ .chroma .mo { color: #40a070 }
/* Operator */ .chroma .o { color: #666666 }
/* OperatorWord */ .chroma .ow { color: #007020; font-weight: bold }
/* Comment */ .chroma .c { color: #60a0b0; font-style: italic }
/* CommentHashbang */ .chroma .ch { color: #60a0b0; font-style: italic }
/* CommentMultiline */ .chroma .cm { color: #60a0b0; font-style: italic }
/* CommentSingle */ .chroma .c1 { color: #60a0b0; font-style: italic }
/* CommentSpecial */ .chroma .cs { color: #60a0b0; background-color: #fff0f0 }
/* CommentPreproc */ .chroma .cp { color: #007020 }
/* CommentPreprocFile */ .chroma .cpf { color: #007020 }
/* GenericDeleted */ .chroma .gd { color: #a00000 }
/* GenericEmph */ .chroma .ge { font-style: italic }
/* GenericError */ .chroma .gr { color: #ff0000 }
/* GenericHeading */ .chroma .gh { color: #000080; font-weight: bold }
/* GenericInserted */ .chroma .gi { color: #00a000 }
/* GenericOutput */ .chroma .go { color: #888888 }
/* GenericPrompt */ .chroma .gp { color: #c65d09; font-weight: bold }
/* GenericStrong */ .chroma .gs { font-weight: bold }
/* GenericSubheading */ .chroma .gu { color: #800080; font-weight: bold }
/* GenericTraceback */ .chroma .gt { color: #0044dd }
/* TextWhitespace */ .chroma .w { color: #bbbbbb }

View file

@ -1,67 +0,0 @@
/* Background */ .chroma { background-color: #f0f0f0 }
/* Error */ .chroma .err { }
/* LineTableTD */ .chroma .lntd { ; vertical-align: top; padding: 0; margin: 0; border: 0; }
/* LineTable */ .chroma .lntable { ; border-spacing: 0; padding: 0; margin: 0; border: 0; width: 100%; overflow: auto; display: block; }
/* LineHighlight */ .chroma .hl { background-color: #ffffcc; display: block; width: 100% }
/* LineNumbersTable */ .chroma .lnt { ; margin-right: 0.4em; padding: 0 0.4em 0 0.4em; display: block; }
/* LineNumbers */ .chroma .ln { ; margin-right: 0.4em; padding: 0 0.4em 0 0.4em; }
/* Keyword */ .chroma .k { color: #007020; font-weight: bold }
/* KeywordConstant */ .chroma .kc { color: #007020; font-weight: bold }
/* KeywordDeclaration */ .chroma .kd { color: #007020; font-weight: bold }
/* KeywordNamespace */ .chroma .kn { color: #007020; font-weight: bold }
/* KeywordPseudo */ .chroma .kp { color: #007020 }
/* KeywordReserved */ .chroma .kr { color: #007020; font-weight: bold }
/* KeywordType */ .chroma .kt { color: #902000 }
/* NameAttribute */ .chroma .na { color: #4070a0 }
/* NameBuiltin */ .chroma .nb { color: #007020 }
/* NameClass */ .chroma .nc { color: #0e84b5; font-weight: bold }
/* NameConstant */ .chroma .no { color: #60add5 }
/* NameDecorator */ .chroma .nd { color: #555555; font-weight: bold }
/* NameEntity */ .chroma .ni { color: #d55537; font-weight: bold }
/* NameException */ .chroma .ne { color: #007020 }
/* NameFunction */ .chroma .nf { color: #06287e }
/* NameLabel */ .chroma .nl { color: #002070; font-weight: bold }
/* NameNamespace */ .chroma .nn { color: #0e84b5; font-weight: bold }
/* NameTag */ .chroma .nt { color: #062873; font-weight: bold }
/* NameVariable */ .chroma .nv { color: #bb60d5 }
/* LiteralString */ .chroma .s { color: #4070a0 }
/* LiteralStringAffix */ .chroma .sa { color: #4070a0 }
/* LiteralStringBacktick */ .chroma .sb { color: #4070a0 }
/* LiteralStringChar */ .chroma .sc { color: #4070a0 }
/* LiteralStringDelimiter */ .chroma .dl { color: #4070a0 }
/* LiteralStringDoc */ .chroma .sd { color: #4070a0; font-style: italic }
/* LiteralStringDouble */ .chroma .s2 { color: #4070a0 }
/* LiteralStringEscape */ .chroma .se { color: #4070a0; font-weight: bold }
/* LiteralStringHeredoc */ .chroma .sh { color: #4070a0 }
/* LiteralStringInterpol */ .chroma .si { color: #70a0d0; font-style: italic }
/* LiteralStringOther */ .chroma .sx { color: #c65d09 }
/* LiteralStringRegex */ .chroma .sr { color: #235388 }
/* LiteralStringSingle */ .chroma .s1 { color: #4070a0 }
/* LiteralStringSymbol */ .chroma .ss { color: #517918 }
/* LiteralNumber */ .chroma .m { color: #40a070 }
/* LiteralNumberBin */ .chroma .mb { color: #40a070 }
/* LiteralNumberFloat */ .chroma .mf { color: #40a070 }
/* LiteralNumberHex */ .chroma .mh { color: #40a070 }
/* LiteralNumberInteger */ .chroma .mi { color: #40a070 }
/* LiteralNumberIntegerLong */ .chroma .il { color: #40a070 }
/* LiteralNumberOct */ .chroma .mo { color: #40a070 }
/* Operator */ .chroma .o { color: #666666 }
/* OperatorWord */ .chroma .ow { color: #007020; font-weight: bold }
/* Comment */ .chroma .c { color: #60a0b0; font-style: italic }
/* CommentHashbang */ .chroma .ch { color: #60a0b0; font-style: italic }
/* CommentMultiline */ .chroma .cm { color: #60a0b0; font-style: italic }
/* CommentSingle */ .chroma .c1 { color: #60a0b0; font-style: italic }
/* CommentSpecial */ .chroma .cs { color: #60a0b0; background-color: #fff0f0 }
/* CommentPreproc */ .chroma .cp { color: #007020 }
/* CommentPreprocFile */ .chroma .cpf { color: #007020 }
/* GenericDeleted */ .chroma .gd { color: #a00000 }
/* GenericEmph */ .chroma .ge { font-style: italic }
/* GenericError */ .chroma .gr { color: #ff0000 }
/* GenericHeading */ .chroma .gh { color: #000080; font-weight: bold }
/* GenericInserted */ .chroma .gi { color: #00a000 }
/* GenericOutput */ .chroma .go { color: #888888 }
/* GenericPrompt */ .chroma .gp { color: #c65d09; font-weight: bold }
/* GenericStrong */ .chroma .gs { font-weight: bold }
/* GenericSubheading */ .chroma .gu { color: #800080; font-weight: bold }
/* GenericTraceback */ .chroma .gt { color: #0044dd }
/* TextWhitespace */ .chroma .w { color: #bbbbbb }

View file

@ -26,7 +26,6 @@
@import '_svg';
@import '_chroma';
@import '_chroma2';
@import '_variables';
.nested-blockquote blockquote {

View file

@ -24,12 +24,12 @@ This theme uses the [Tachyons CSS Library](http://tachyons.io/). It's about 15kb
You'll find the commands to run in `src/package.json`.
For development, you'll need Node and Yarn installed:
For development, you'll need Node with NPM installed:
```
$ cd themes/gohugo-theme/src/
$ yarn install
$ npm install
$ npm start
@ -37,13 +37,3 @@ $ npm start
This will process both the postcss and scripts.
For production, instead of `npm start`, run `npm run build:production,` which will output minified versions of your files.
---
To run the NPM "critical" from package.json, you first must run `hugo` from the root of the project to generate a `public` folder.
Make critical better:
- [ ] run for a wider variety of pages. It currently runs off the new Hugo home page, but should run for docs/themes. There's much shared between them though.
- [ ] Minify the CSS. The critical script seems only to minify when running inline, which we don't want to do (because it would change the build process)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 7.6 KiB