Merge commit '374d184e6747678364fd61f5faf328ec9205eb6b'

This commit is contained in:
Bjørn Erik Pedersen 2018-02-21 10:02:51 +01:00
commit 4560261b58
No known key found for this signature in database
GPG Key ID: 330E6E2BD4859D8F
56 changed files with 368 additions and 274 deletions

View File

@ -61,13 +61,6 @@ To be sure to get the correct reference in this case, use the full path:
{{</* relref "events/my-birthday.md" */>}} => /events/my-birthday/
{{< /code >}}
{{< todo >}}Remove this warning when https://github.com/gohugoio/hugo/issues/3703 is released.{{< /todo >}}
A relative document name must *not* begin with a slash (`/`).
```
{{</* relref "/events/my-birthday.md" */>}} => ""
```
### With Multiple Output Formats
If the page exists in multiple [output formats][], `ref` or `relref` can be used with a output format name:

View File

@ -118,7 +118,7 @@ aliases:
---
{{< /code >}}
Now when you visit any of the locations specified in aliases---i.e., *assuming the same site domain*---you'll be redirected to the page they are specified on. For example, a visitor to `example.com/posts/my-original-url/` will be immediately redirected to `example.com/posts/my-awesome-blog-post/`.
Now when you visit any of the locations specified in aliases---i.e., *assuming the same site domain*---you'll be redirected to the page they are specified on. For example, a visitor to `example.com/posts/my-original-url/` will be immediately redirected to `example.com/posts/my-awesome-post/`.
### Example: Aliases in Multilingual
@ -222,7 +222,7 @@ Here's the same organization run with `hugo --uglyURLs`:
.
└── content
└── about
| └── _index.md // <- https://example.com/about/index.html
| └── _index.md // <- https://example.com/about.html
├── post
| ├── firstpost.md // <- https://example.com/post/firstpost.html
| ├── happy

View File

@ -4,7 +4,6 @@ linktitle: Hugo
description: Hugo is the world's fastest static website engine. It's written in Go (aka Golang) and developed by bep, spf13 and friends.
date: 2017-02-01
publishdate: 2017-02-01
lastmod: 2017-02-01
menu:
main:
parent: "section name"
@ -16,4 +15,6 @@ aliases: []
toc: false
layout: documentation-home
---
Hugo is the **world's fastest static website engine.** It's written in Go (aka Golang) and developed by [bep](https://github.com/bep), [spf13](https://github.com/spf13) and [friends](https://github.com/gohugoio/hugo/graphs/contributors). Below you will find some of the most common and helpful pages from our documentation.
Hugo is the **world's fastest static website engine.** It's written in Go (aka Golang) and developed by [bep](https://github.com/bep), [spf13](https://github.com/spf13) and [friends](https://github.com/gohugoio/hugo/graphs/contributors).
Below you will find some of the most common and helpful pages from our documentation.

View File

@ -10,7 +10,7 @@ menu:
docs:
parent: "functions"
keywords: [advanced]
signature: ["apply COLLETION FUNCTION [PARAM...]"]
signature: ["apply COLLECTION FUNCTION [PARAM...]"]
workson: []
hugoversion:
relatedfuncs: []
@ -20,16 +20,16 @@ aliases: []
---
{{< todo >}}
<!-- POTENTIAL NEW CONTENT: see apply/sequence discussion: https://discourse.gohugo.io/t/apply-printf-on-a-sequence/5722; -->
POTENTIAL NEW CONTENT: see apply/sequence discussion: https://discourse.gohugo.io/t/apply-printf-on-a-sequence/5722;
{{< /todo >}}
`apply` expects at least three parameters, depending on the function being applied.
1. The first parameter is the sequence to operate on
1. The first parameter is the sequence to operate on.
2. The second parameter is the name of the function as a string, which must be the name of a valid [Hugo function][functions].
3. After that, the parameters to the applied function are provided, with the string `"."` standing in for each element of the sequence the function is to be applied against.
Here is an example of a content file with `name:` as a front matter field:
Here is an example of a content file with `names:` as a front matter field:
```
+++
@ -43,19 +43,19 @@ You can then use `apply` as follows:
{{ apply .Params.names "urlize" "." }}
```
Which will result as follows:
Which will result in the following:
```
"derek-perkins", "joe-bergevin", "tanner-linsley"
```
This is *roughly* equivalent to using the following with [range][]
This is *roughly* equivalent to using the following with [range][]:
```
{{ range .Params.names }}{{ . | urlize }}{{ end }}
```
However, it isnt possible to provide the output of a range to the [`delimit` function][delimit], so you need to `apply` it.
However, it is not possible to provide the output of a range to the [`delimit` function][delimit], so you need to `apply` it.
If you have `post-tag-list.html` and `post-tag-link.html` as [partials][], you *could* use the following snippets, respectively:

View File

@ -79,16 +79,10 @@ defaultContentLanguage: "en"
# Renders the default content language in subdir, e.g. /en/. The root directory / will redirect to /en/
defaultContentLanguageInSubdir: false
disableLiveReload: false
# Do not build RSS files
disableRSS: false
# Do not build Sitemap file
disableSitemap: false
# Enable GitInfo feature
enableGitInfo: false
# Build robots.txt file
enableRobotsTXT: false
# Do not render 404 page
disable404: false
# Do not inject generator meta tag on homepage
disableHugoGeneratorInject: false
# Allows you to disable all page types and will render nothing related to 'kind';
@ -221,16 +215,10 @@ defaultContentLanguage = "en"
# Renders the default content language in subdir, e.g. /en/. The root directory / will redirect to /en/
defaultContentLanguageInSubdir = false
disableLiveReload = false
# Do not build RSS files
disableRSS = false
# Do not build Sitemap file
disableSitemap = false
# Enable GitInfo feature
enableGitInfo = false
# Build robots.txt file
enableRobotsTXT = false
# Do not render 404 page
disable404 = false
# Do not inject generator meta tag on homepage
disableHugoGeneratorInject = false
# Allows you to disable all page types and will render nothing related to 'kind';

View File

@ -70,7 +70,7 @@ choco install hugo -confirm
#### Vendored Dependencies
Hugo uses [dep][] to vendor dependencies, but we don't commit the vendored packages themselves to the Hugo git repository. Therefore, a simple `go get` is *not* supported because the command is not vendor aware.
Hugo uses [dep][] to vendor dependencies, but we don't commit the vendored packages themselves to the Hugo git repository. Therefore, a simple `go get` is *not* supported because the command is not vendor aware.
The simplest way is to use [mage][] (a Make alternative for Go projects.)
@ -79,7 +79,7 @@ The simplest way is to use [mage][] (a Make alternative for Go projects.)
{{< code file="from-gh.sh" >}}
go get github.com/magefile/mage
go get -d github.com/gohugoio/hugo
cd $HOME/go/src/github.com/gohugoio/hugo
cd ${GOPATH:-$HOME/go}/src/github.com/gohugoio/hugo
mage vendor
mage install
{{< /code >}}

View File

@ -44,6 +44,7 @@ Usage:
Available Commands:
benchmark Benchmark Hugo by building a site a number of times.
check Contains some verification checks
config Print the site configuration
convert Convert your content to different formats
env Print Hugo version and environment info
@ -61,18 +62,16 @@ Flags:
-E, --buildExpired include expired content
-F, --buildFuture include content with publishdate in the future
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
--canonifyURLs if true, all relative URLs will be canonicalized using baseURL
--canonifyURLs (deprecated) if true, all relative URLs will be canonicalized using baseURL
--cleanDestinationDir remove files from destination not found in static directories
--config string config file (default is path/config.yaml|json|toml)
-c, --contentDir string filesystem path to content directory
--debug debug output
-d, --destination string filesystem path to write files to
--disable404 do not render 404 page
--disableKinds stringSlice disable different kind of pages (home, RSS etc.)
--disableRSS do not build RSS files
--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
@ -81,23 +80,21 @@ Flags:
--logFile string log File path (if set, logging enabled automatically)
--noChmod don't sync permission mode of files
--noTimes don't sync modification time of files
--pluralizeListTitles pluralize titles in lists using inflect (default true)
--preserveTaxonomyNames preserve taxonomy names as written ("Gérard Depardieu" vs "gerard-depardieu")
--pluralizeListTitles (deprecated) pluralize titles in lists using inflect (default true)
--preserveTaxonomyNames (deprecated) preserve taxonomy names as written ("Gérard Depardieu" vs "gerard-depardieu")
--quiet build in quiet mode
--renderToMemory render to memory (only useful for benchmark testing)
-s, --source string filesystem path to read files relative from
--stepAnalysis display memory and timing of different steps of the program
--templateMetrics display metrics about template executions
--templateMetricsHints calculate some improvement hints when combined with --templateMetrics
-t, --theme string theme to use (located in /themes/THEMENAME/)
--themesDir string filesystem path to themes directory
--uglyURLs if true, use /filename.html instead of /filename/
--uglyURLs (deprecated) if true, use /filename.html instead of /filename/
-v, --verbose verbose output
--verboseLog verbose logging
-w, --watch watch filesystem for changes and recreate as needed
Additional help topics:
hugo check Contains some verification checks
Use "hugo [command] --help" for more information about a command.
```

View File

@ -20,6 +20,14 @@ wip: false
aliases: [/tutorials/hosting-on-gitlab/]
---
{{% warning %}}
GitLab has temporarily turned off custom domains support because of a security issue. The plan is to re-enable it after the 20th of February.
For more information:
https://about.gitlab.com/2018/02/05/gitlab-pages-custom-domain-validation/
{{% /warning %}}
{{< todo >}}Remove the above when fixed.{{< /todo >}}
[GitLab](https://gitlab.com/) makes it incredibly easy to build, deploy, and host your Hugo website via their free GitLab Pages service, which provides [native support for Hugo, as well as numerous other static site generators](https://gitlab.com/pages/hugo).
## Assumptions

View File

@ -59,37 +59,33 @@ Select the repo you want to use for continuous deployment. If you have a large n
Once selected, you'll be brought to a screen for basic setup. Here you can select the branch you wanted published, your [build command][], and your publish (i.e. deploy) directory. The publish directory should mirror that of what you've set in your [site configuration][config], the default of which is `public`. The following steps assume you are publishing from the `master` branch.
### Build with a Specific Hugo Version
## Configure Hugo Version in Netlify
Setting the build command to `hugo` will build your site according to the current default Hugo version used by Netlify. You can see the full list of [available Hugo versions in Netlify's Docker file][hugoversions].
If you want to tell Netlify to build with a specific version (hugo <= 0.20), you can append an underscore followed by the version number to the build command:
```
hugo_0.19
```
Your simple configuration should now look similar to the following:
![Screenshot of 3-step, basic continuous deployment setup with a new Hugo site on Netlify](/images/hosting-and-deployment/hosting-on-netlify/netlify-create-new-site-step-3.jpg)
For version hugo > 0.20 you have to [specify version hugo for testing and production](https://www.netlify.com/blog/2017/04/11/netlify-plus-hugo-0.20-and-beyond/) in `netlify.toml` file or set `HUGO_VERSION` as a build environment variable in the Netlify console.
You can [set Hugo version](https://www.netlify.com/blog/2017/04/11/netlify-plus-hugo-0.20-and-beyond/) for your environments in `netlify.toml` file or set `HUGO_VERSION` as a build environment variable in the Netlify console.
For production:
```
[context.production.environment]
HUGO_VERSION = "0.26"
HUGO_VERSION = "0.36"
```
For testing:
```
[context.deploy-preview.environment]
HUGO_VERSION = "0.26"
```
HUGO_VERSION = "0.36"
```
Selecting "Deploy site" will immediately take you to a terminal for your build:.
The Netlify configuration file can be a little hard to understand and get right for the different environment, and you may get some inspiration and tips from this site's `netlify.toml`:
{{< code file="netlify.toml" nocode="true" >}}
{{< readfile file="netlify.toml" highlight="toml" >}}
{{< /code >}}
## Build and Deploy Site
In the Netlify console, selecting "Deploy site" will immediately take you to a terminal for your build:.
![Animated gif of deploying a site to Netlify, including the terminal read out for the build.](/images/hosting-and-deployment/hosting-on-netlify/netlify-deploying-site.gif)
@ -103,6 +99,8 @@ Once the build is finished---this should only take a few seconds--you should now
Now every time you push changes to your hosted git repository, Netlify will rebuild and redeploy your site.
See [this blog post](https://www.netlify.com/blog/2017/04/11/netlify-plus-hugo-0.20-and-beyond/) for more details about how Netlify handles Hugo versions.
## Use Hugo Themes with Netlify
The [`git clone` method for installing themes][installthemes] is not supported by Netlify. If you were to use `git clone`, it would require you to recursively remove the `.git` subdirectory from the theme folder and would therefore prevent compatibility with future versions of the theme.

View File

@ -0,0 +1,14 @@
---
title: Maintenance
description: Some lists useful for the maintenance of the Hugo docs site.
date: 2018-02-09
categories: [maintenance]
keywords: [maintenance]
menu:
docs:
weight: 200
slug:
aliases: []
toc: true
---

View File

@ -1,51 +0,0 @@
---
date: 2018-02-05
title: "0.36"
description: "0.36"
slug: "0.36"
categories: ["Releases"]
---
Hugo `0.36` announces **smart cropping** of images, using the [library](https://github.com/muesli/smartcrop) created by [muesli](https://github.com/muesli). We will work with him to improve this even more in the future, but this is now the default used when cropping images in Hugo.
Go [here](http://hugotest.bep.is/resourcemeta/smartcrop/) for a list of examples.
This release represents **7 contributions by 3 contributors** to the main Hugo code base.
Many have also been busy writing and fixing the documentation in [hugoDocs](https://github.com/gohugoio/hugoDocs),
which has received **9 contributions by 4 contributors**. A special thanks to [@bep](https://github.com/bep), [@Jibec](https://github.com/Jibec), [@Nick-Rivera](https://github.com/Nick-Rivera), and [@kaushalmodi](https://github.com/kaushalmodi) for their work on the documentation site.
Hugo now has:
* 23100+ [stars](https://github.com/gohugoio/hugo/stargazers)
* 448+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
* 197+ [themes](http://themes.gohugo.io/)
## Notes
Hugo now defaults to **smart crop** when cropping images, if you don't specify it when calling `.Fill`.
You can get the old default by adding this to your `config.toml`:
```toml
[imaging]
anchor = "center"
```
Also, we have removed the superflous anchor name from the processed filenames that does not use this anchor, so it can be wise to run `hugo --gc` once to remove unused images.
## Enhancements
* Add smart cropping [722086b4](https://github.com/gohugoio/hugo/commit/722086b4ed3e77d1aba6724474bec06d08e7de06) [@bep](https://github.com/bep) [#4375](https://github.com/gohugoio/hugo/issues/4375)
## Fixes
* Ensure site templates can override theme templates [084cf419](https://github.com/gohugoio/hugo/commit/084cf4191b3c1e7590a4223fd9251019ef5d4c21) [@moorereason](https://github.com/moorereason) [#3505](https://github.com/gohugoio/hugo/issues/3505)
* Add additional test to `TestTemplateLookupOrder` [fc06d5c1](https://github.com/gohugoio/hugo/commit/fc06d5c18bb1e47f90f0297aa8121ee0775e047d) [@moorereason](https://github.com/moorereason) [#3505](https://github.com/gohugoio/hugo/issues/3505)
* Fix broken `TestTemplateLookupOrder` [9a367d9d](https://github.com/gohugoio/hugo/commit/9a367d9d06db6f6cf22121d0397c464ae36e7089) [@moorereason](https://github.com/moorereason)
* Fix JSON array-based data file handling regression [4402c077](https://github.com/gohugoio/hugo/commit/4402c077754991df19c3bbab0c4a671dcfdc192c) [@vassudanagunta](https://github.com/vassudanagunta) [#4361](https://github.com/gohugoio/hugo/issues/4361)
* Increase data directory test coverage [4743de0d](https://github.com/gohugoio/hugo/commit/4743de0d3c7564fc06972074e903d5502d204353) [@vassudanagunta](https://github.com/vassudanagunta) [#4138](https://github.com/gohugoio/hugo/issues/4138)

View File

@ -1,15 +1,14 @@
---
date: 2018-02-15
title: "0.36.1"
description: "0.36.1"
slug: "0.36.1"
title: "Hugo 0.36.1: One Bugfix"
description: "Fixes a multi-thread image processing issue."
slug: "0.36.1-relnotes"
categories: ["Releases"]
images:
- images/blog/hugo-bug-poster.png
---
This release fixes a multi-thread issue when reprocessing and reusing images across pages. When doing something like this with the same image from a partial used in, say, both the home page and the single page:
```bash

View File

@ -0,0 +1,3 @@
---
headless: true
---

View File

@ -0,0 +1,4 @@
**1Password** is a popular password manager.
Their website is built with **Hugo**.

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

View File

@ -0,0 +1,15 @@
---
title: 1password.com
date: 2018-02-16
description: "Showcase: \"1Password is my favourite piece of boring software, and I was happy to see that they built their website with Hugo\""
siteURL: https://1password.com/
byline: "[bep](https://github.com/bep), Hugo Lead"
---
**1Password** is my favourite piece of boring software. It just works. I was pleased to read that they use [Go](https://golang.org/) (aka Golang) extensively to build their software. This is also Hugo's platform. And I was also happy to see that they have **built their website with Hugo**.

View File

@ -12,15 +12,15 @@ byline: "[Trys Mudford](http://www.trysmudford.com), Lead Developer, Tomango"
---
Weve just launched a shiny new website for [Hartwell Insurance](https://www.hartwell-insurance.com/) Im really proud of it. It was tackled it in a different way to most previous Tomango site builds, using some fancy new tools and some vintage web standards.
Weve just launched a shiny new website for [Hartwell Insurance](https://www.hartwell-insurance.com/) Im really proud of it. It was tackled in a different way to most previous Tomango site builds, using some fancy new tools and some vintage web standards.
Its multi-page, single-page (!) website written in Hugo, a static site generator built with performance as a first-class feature. _Ive outlined a load of benefits to Hugo & static sites [here](https://why-static.netlify.com/), in case youre interested._
Its a multi-page, single-page (!) website written in Hugo, a static site generator built with performance as a first-class feature. _Ive outlined a load of benefits to Hugo & static sites [here](https://why-static.netlify.com/), in case youre interested._
> **In essence, a static site generator pre-renders the whole site into HTML files and serves them like its 1995.**
Theres no Apache or Node backend that does compilation at runtime, its all done at the build step. This means the server; Netlify in this case, only has to do one thing serve files. Unsurprisingly, serving simple files is VERY quick.
The starter point was the [victor-hugo](https://github.com/netlify/victor-hugo) repository that Netlify have created. It let me dive in with Hugo, PostCSS, BrowserSync and ES6 without setting up any tooling myself always a win!
The starter point was the [Victor Hugo](https://github.com/netlify/victor-hugo) repository that Netlify have created. It let me dive in with Hugo, PostCSS, BrowserSync and ES6 without setting up any tooling myself always a win!
I then took all the content from the design file and moved it into Markdown, putting shortcodes in where necessary. This site did need a number of custom shortcodes for the presentational elements like the expanding circles and full width backgrounds. But mostly it was just clean, semantic HTML with some CSS and JS enhancement thrown in.

View File

@ -0,0 +1,4 @@
**Linode** is a cloud hosting provider that offers high performance SSD Linux servers for your infrastructure needs.
**Hugo** offers the documentation team incredible performance as we scale and continue providing quality Linux tutorials.

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

View File

@ -0,0 +1,21 @@
---
title: Linode Docs
date: 2018-02-12
description: "Showcase: \"Hugo allows us to build thousands of pages in seconds.\""
siteURL: https://linode.com/docs/
siteSource: https://github.com/linode/docs
---
The documentation team at Linode has been writing guides since 2009, with the goal of helping new and experienced Linux users find the best tools and get the most out of their systems.
As our library grew into thousands of guides, we needed a fast static site generator with intuitive templating and the flexibility to extend Markdown without constantly writing HTML and CSS.
Hugo solved a lot of our growing pains with features like shortcodes, customizable URLs, LiveReload, and more. We have already brought our site build time down from minutes to just a few seconds, and we are excited to see what future developments in Hugo will bring.
Thank you to all the [Hugo contributors](https://github.com/gohugoio/hugo/graphs/contributors) and especially [@bep](https://github.com/bep) for helping us with the adoption of Hugo.

View File

@ -0,0 +1,4 @@
**Quiply** is an employee communications app enabling mobile collaboration across an entire organization.
Our customers get their own branded app enabling them to communicate fast and effectively with all employees, also non-desk and shift workers.
As the Quiply app's build process is based on **Gulp**, we have started to build our company and product website using **Gulp + Hugo** which is super-fast and gives us exactly the flexibility we need.

Binary file not shown.

After

Width:  |  Height:  |  Size: 616 KiB

View File

@ -0,0 +1,29 @@
---
# A suitable title for this article.
title: Quiply Employee Communications App
# Set this to the current date.
date: 2018-02-13
description: "\"It became immediately clear that we'd use Hugo going forward as it compiles super-fast, is intuitive to use and offers all the features we need.\""
# The URL to the site on the internet.
siteURL: https://www.quiply.com
# Link to the site's Hugo source code if public and you can/want to share.
# Remove or leave blank if not needed/wanted.
# siteSource: https://github.com/gohugoio/hugoDocs
# Add credit to the article author. Leave blank or remove if not needed/wanted.
byline: "[Sebastian Schirmer](mailto:sebastian.schirmer@quiply.com), Quiply Co-Founder"
---
With the launch of our Employee Communications app Quiply we created a very simple and static one-page website to showcase our product.
As our customer base and demand for marketing and communication started to grow, we needed a solution to easily grow and extend the contents of our web presence. As we do not have the need to serve dynamic content, we decided to use a static site generator. Amongst a couple of others, we tried Hugo and it became immediately clear that we'd use Hugo going forward as it compiles super-fast, is intuitive to use and offers all the features we need.
Our website which we launched a couple of weeks ago is still growing and new content is being added constantly. By using Hugo, this can be easily done by content authors writing markdown files without always having to touch HTML or CSS code. It is available in German only for the time being, an English version is in the works.
Huge thanks to everyone involved in making Hugo a success.

View File

@ -0,0 +1,4 @@
**StackImpact** is a production-grade performance profiler for production and development environments.
The [stackimpact.com](https://stackimpact.com/) website is built with awesome Hugo. Grunt is used for CSS minification and bundling.

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

View File

@ -0,0 +1,21 @@
---
title: StackImpact
date: 2018-02-20
description: "\"Hugo is a perfect choice for a product website.\""
siteURL: https://stackimpact.com/
---
After gradually handing over the control of our website to WordPress plugins, we realized that we needed to act.
Static web sites have natural advantages such as security, performance and content versioning (e.g. with Git). Static site generators such as Hugo made static websites cool again. Importantly, the best practices of software development (e.g. peer reviews, multi-stage deployments, rollbacks) can now be easily applied to websites.
Besides the blog and documentation sections, our website needed custom sections with own templates. Hugo supported it beautifully.
Hugo is written in Go language and uses Go templates. StackImpact is a performance profiler that has an advanced support for Go applications. Being aware of the advantages of Go in terms of speed and productivity, this was another strong reason for choosing Hugo.
Thanks to all Hugo contributors for making such a beautiful and fast site generator!

View File

@ -8,8 +8,8 @@ lastmod: 2017-02-01
menu:
docs:
parent: "troubleshooting"
weight: 01
weight: 01 #rem
weight: 1
weight: 1
draft: false
hidesectioncontents: false
slug:

View File

@ -1,60 +0,0 @@
---
title: Accented Characters in URLs
linktitle: Accented Characters in URLs
description: If you're having trouble with special characters in your taxonomies or titles adding odd characters to your URLs.
date: 2017-02-01
publishdate: 2017-02-01
lastmod: 2017-02-01
keywords: [urls,multilingual,special characters]
categories: [troubleshooting]
menu:
docs:
parent: "troubleshooting"
weight:
draft: false
slug:
aliases: [/troubleshooting/categories-with-accented-characters/]
toc: true
---
## Trouble: Categories with accented characters
> One of my categories is named "Le-carré," but the link ends up being generated like this:
>
> ```
> categories/le-carr%C3%A9
> ```
>
> And not working. Is there an easy fix for this that I'm overlooking?
## Solution
Are you a macOS user? If so, you are likely a victim of HFS Plus file system's insistence to store the "é" (U+00E9) character in Normal Form Decomposed (NFD) mode, i.e. as "e" + " ́" (U+0065 U+0301).
`le-carr%C3%A9` is actually correct, `%C3%A9` being the UTF-8 version of U+00E9 as expected by the web server. The problem is that OS X turns [U+00E9] into [U+0065 U+0301], and thus `le-carr%C3%A9` no longer works. Instead, only `le-carre%CC%81` ending with `e%CC%81` would match that [U+0065 U+0301] at the end.
This is unique to OS X. The rest of the world does not do this, and most certainly not your web server which is most likely running Linux. This is not a Hugo-specific problem either. Other people have been bitten by this when they have accented characters in their HTML files.
Note that this problem is not specific to Latin scripts. Japanese Mac users often run into the same issue; e.g., with `だ` decomposing into `た` and `&#x3099;`. (Read the [Japanese Perl users article][]).
Rsync 3.x to the rescue! From [an answer posted on Server Fault][]:
> You can use rsync's `--iconv` option to convert between UTF-8 NFC & NFD, at least if you're on a Mac. There is a special `utf-8-mac` character set that stands for UTF-8 NFD. So to copy files from your Mac to your web server, you'd need to run something like:
>
> `rsync -a --iconv=utf-8-mac,utf-8 localdir/ mywebserver:remotedir/`
>
> This will convert all the local filenames from UTF-8 NFD to UTF-8 NFC on the remote server. The files' contents won't be affected. - [Server Fault][]
Please make sure you have the latest version of rsync 3.x installed. The rsync that ships with OS X is outdated. Even the version that comes packaged with 10.10 (Yosemite) is version 2.6.9 protocol version 29. The `--iconv` flag is new in rsync 3.x.
### Discussion Forum References
* http://discourse.gohugo.io/t/categories-with-accented-characters/505
* http://wiki.apache.org/subversion/NonNormalizingUnicodeCompositionAwareness
* https://en.wikipedia.org/wiki/Unicode_equivalence#Example
* http://zaiste.net/2012/07/brand_new_rsync_for_osx/
* https://gogo244.wordpress.com/2014/09/17/drived-me-crazy-convert-utf-8-mac-to-utf-8/
[an Answer posted on Server Fault]: http://serverfault.com/questions/397420/converting-utf-8-nfd-filenames-to-utf-8-nfc-in-either-rsync-or-afpd "Converting UTF-8 NFD filenames to UTF-8 NFC in either rsync or afpd, Server Fault Discussion"
[Japanese Perl users article]: http://perl-users.jp/articles/advent-calendar/2010/english/24 "Encode::UTF8Mac makes you happy while handling file names on MacOSX"
[Server Fault]: http://serverfault.com/questions/397420/converting-utf-8-nfd-filenames-to-utf-8-nfc-in-either-rsync-or-afpd "Converting UTF-8 NFD filenames to UTF-8 NFC in either rsync or afpd, Server Fault Discussion"

View File

@ -10,7 +10,7 @@ categories: [troubleshooting]
menu:
docs:
parent: "troubleshooting"
weight:
weight: 3
slug:
aliases: []
toc: true

View File

@ -1,49 +0,0 @@
---
title: EOF Error
linktitle: EOF Error
description: If you find yourself seeing an EOF error in the console whenever you create a new content file from Hugo's archetype feature.
date: 2017-02-01
publishdate: 2017-02-01
lastmod: 2017-02-01
categories: [troubleshooting]
menu:
docs:
parent: "troubleshooting"
keywords: [eof, end of file, error, faqs]
draft: false
weight:
aliases: [/troubleshooting/strange-eof-error/]
toc: true
---
## Trouble: `hugo new` Aborts with EOF error
> I'm running into an issue where I cannot get archetypes working, when running `hugo new showcase/test.md`, for example, I see an `EOF` error thrown by Hugo.
>
> When I run Hugo with v0.12 via `hugo new -v showcase/test.md`, I see the following output:
>
> ```
> INFO: 2015/01/04 Using config file: /private/tmp/test/config.toml
> INFO: 2015/01/04 attempting to create showcase/test.md of showcase
> INFO: 2015/01/04 curpath: /private/tmp/test/archetypes/showcase.md
> ERROR: 2015/01/04 EOF
> ```
>
> Is there something that I am blatantly missing?
## Solution: Carriage Returns
The solution is to add a final newline (i.e., `EOL`) to the end of your default.md archetype file of your theme. You can do this by adding a carriage return after the closing `+++` or `---` of your TOML or YAML front matter, respectively.
{{% note "Final EOL Unnecessary in v0.13+" %}}
As of v0.13, Hugo's parser has been enhanced to accommodate archetype files without final EOL thanks to the great work by [@tatsushid](https://github.com/tatsushid).
{{% /note %}}
## Discussion Forum References
* http://discourse.gohugo.io/t/archetypes-not-properly-working-in-0-12/544
* http://discourse.gohugo.io/t/eol-f-in-archetype-files/554
## Related Hugo Issues
* https://github.com/gohugoio/hugo/issues/776

View File

@ -0,0 +1,37 @@
---
title: Frequently Asked Questions
linktitle: FAQ
description: Solutions to some common Hugo problems.
date: 2018-02-10
categories: [troubleshooting]
menu:
docs:
parent: "troubleshooting"
keywords: [faqs]
weight: 2
toc: true
aliases: [/faq/]
---
{{% note %}}
**Note:** The answers/solutions presented below are short, and may not be note be enough to solve your problem. Visit [Hugo Discourse](https://discourse.gohugo.io/) and use the search. It that does not help, start a new topic and ask your questions.
{{% /note %}}
## How do I schedule posts?
1. Set `publishDate` in the page [Front Matter](/content-management/front-matter/) to a date in the future.
2. Build and publish at intervals.
How to automate the "publish at intervals" part depends on your situation:
* If you deploy from your own PC/server, you can automate with [Cron](https://en.wikipedia.org/wiki/Cron) or similar.
* If your site is hosted on a service similar to [Netlify](https://www.netlify.com/) you can use a service such as [ifttt](https://ifttt.com/date_and_time) to schedule the updates.
Also see this Twitter thread:
{{< tweet 962380712027590657 >}}
## Can I use the latest Hugo version on Netlify?
Yes you can! Read [this](/hosting-and-deployment/hosting-on-netlify/#configure-hugo-version-in-netlify).

View File

@ -0,0 +1,36 @@
{{ define "main" }}
<div class="w-100 ph4 pb5 pb6-ns pt1 mt4 pt3-ns">
<div class="flex-l">
<div class="order-2 w-100 w-20-l ph5-m ph0-l mb4 sticky">
<aside class="fixed-lTK mw5-l right-0 f6 bl-l b--moon-gray pv4 pv0-ns ph4-l nested-list-reset nested-links nested-copy-line-height">
<p class="b">What's on this Page</p>
<ul>
<li><a href="#last-updated">Last Updated</a></li>
<li><a href="#least-recently-updated">Least Recently Updated</a></li>
<li><a href="#todos">Pages marked with TODO</a></li>
</ul>
</aside>
</div>
<div class="w-100">
{{ $byLastMod := .Site.RegularPages.ByLastmod }}
{{ $recent := ($byLastMod | last 30).Reverse }}
{{ $leastRecent := $byLastMod | first 10 }}
<h2 id="last-updated">Last Updated</h2>
{{ partial "maintenance-pages-table" $recent }}
<h2 id="least-recently-updated">Least Recently Updated</h2>
{{ partial "maintenance-pages-table" $leastRecent }}
{{/* Don't think this is possible with where directly. Should investigate. */}}
{{ .Scratch.Set "todos" slice }}
{{ range .Site.RegularPages }}
{{ if .HasShortcode "todo" }}
{{ $.Scratch.Add "todos" . }}
{{ end }}
{{ end }}
<h2 id="todos">Pages marked with TODO</h2>
{{ partial "maintenance-pages-table" (.Scratch.Get "todos") }}
</div>
</div>
</div>
{{ end }}

View File

@ -0,0 +1,24 @@
<table class="collapse ba br2 b--black-10 pv2 ph3">
<thead>
<tr>
<th class="pv2 ph3 tl f6 fw6 ttu">LastMod</th>
<th class="pv2 ph3 tl f6 fw6 ttu">Link</th>
<th class="pv2 ph3 tl f6 fw6 ttu">GitHub</th>
</tr>
</thead>
<tbody>
{{ range . }}
<tr class="striped--light-gray">
<td class="pv2 ph3">{{ .Lastmod.Format "2006-01-02" }}</td>
<td class="pv2 ph3">
<a href="{{ .Permalink }}">{{ .Title }}</a>
</td>
<td class="pv2 ph3">
<a href="{{.Site.Params.ghrepo}}blob/master/content/{{.Path}}">
{{ with .GitInfo }}{{ .Subject }}{{ else }}Source{{ end }}
</a>
</td>
</tr>
{{ end }}
</tbody>
</table>

View File

@ -11,7 +11,7 @@
{{/* Functionality located within filesaver.js The copy here is located in the css with .copy class so it can be replaced with JS on success */}}
{{end}}
<div class="code-copy-content nt3" {{with .Get "download"}}id="{{.}}"{{end}}>
{{ if $isHTML }}{{- highlight .Inner "html" "" | -}}{{ else }}<pre><code>{{- .Inner | string -}}</code></pre>{{ end }}
{{ if .Get "nocode" }}{{ .Inner }}{{ else }}{{ if $isHTML }}{{- highlight .Inner "html" "" | -}}{{ else }}<pre><code>{{- .Inner | string -}}</code></pre>{{ end }}{{ end }}
</div>
</div>

View File

@ -1,6 +1,8 @@
{{$file := .Get "file"}}
{{- if eq (.Get "markdown") "true" -}}
{{- $file | readFile | markdownify -}}
{{- else if (.Get "highlight") -}}
{{- highlight ($file | readFile) (.Get "highlight") "" -}}
{{- else -}}
{{ $file | readFile | safeHTML }}
{{- end -}}

View File

@ -3,7 +3,7 @@ publish = "public"
command = "hugo"
[context.production.environment]
HUGO_VERSION = "0.36"
HUGO_VERSION = "0.36.1"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"
@ -11,13 +11,13 @@ HUGO_ENABLEGITINFO = "true"
command = "hugo -b $DEPLOY_PRIME_URL"
[context.deploy-preview.environment]
HUGO_VERSION = "0.36"
HUGO_VERSION = "0.36.1"
[context.branch-deploy]
command = "hugo -b $DEPLOY_PRIME_URL"
[context.branch-deploy.environment]
HUGO_VERSION = "0.36"
HUGO_VERSION = "0.36.1"
[context.next.environment]
HUGO_ENABLEGITINFO = "true"

View File

@ -34,7 +34,7 @@
{{- template "_internal/twitter_cards.html" . -}}
{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }}
{{ template "_internal/google_analytics_async.html" . }}
{{ partial "gtag" . }}
{{ end }}

View File

@ -9,16 +9,16 @@
{{- partial "home-page-sections/features-icons" . -}}
</section>
{{- partial "home-page-sections/showcase.html" . -}}
{{ partial "home-page-sections/sponsors.html" (dict "cx" . "gtag" "home" ) }}
{{- partial "home-page-sections/features-single" . -}}
{{- partial "home-page-sections/showcase.html" . -}}
<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,26 @@
{{ with .Site.GoogleAnalytics }}
<script async src="https://www.googletagmanager.com/gtag/js?id={{ . }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ . }}');
/**
* Function that tracks a click on an outbound link in Analytics.
* Setting the transport method to 'beacon' lets the hit be sent
* using 'navigator.sendBeacon' in browser that support it.
*/
var trackOutboundLink = function(id, url) {
console.log("track:", id, url)
gtag('event', 'click', {
'event_category': 'outbound',
'event_label': id,
'transport_type': 'beacon',
'event_callback': function(){document.location = url;}
});
}
</script>
{{ end }}

View File

@ -4,26 +4,10 @@
<div class="w-100">
<div class="w-100 overflow-x-scroll">
<div class="row nowrap mv2 pb1">
{{ range $p := first 10 (where .Site.RegularPages "Section" "showcase") }}
{{ $img := (.Resources.ByType "image").GetMatch "*featured*" }}
{{ with $img }}
{{ $big := .Fill "1024x512 top" }}
{{ $small := $big.Resize "512x" }}
<a href="{{ $p.RelPermalink}}" class="tile lazyload cover dib f4 h5 ml1 mr4 bg-black relative mw-100 shadow-5" style="width:{{ $small.Width }}px;"
data-bg="{{ $img.RelPermalink }}"
data-sizes="auto"
data-srcset="{{ $small.RelPermalink }} 1x,
{{ $big.RelPermalink }} 2x" data-src="small"
>
{{with $p.Title}}
<div class="details absolute bottom-0 f3-ns f4 left-0 o-0 right-0 top-0">
<div class="absolute bottom-0 pa2 tc white">
{{.}} &#8594;
</div>
</div>
{{end}}
</a>
{{ end }}
{{ $showcasePages := where .Site.RegularPages "Section" "showcase" }}
{{ template "home_showcase_item" (index $showcasePages 0) }}
{{ range $p := first 10 ($showcasePages | after 1 | shuffle) }}
{{template "home_showcase_item" $p }}
{{end}}
</div>
</div>
@ -32,4 +16,27 @@
<div class="flex w-100 mt4 justify-end">{{/* using Flex to make the button show up on the right side */}}
<a href="/showcase/" class="br2 f6 bg-primary-color-dark hover-bg-primary-color link ph3 pv2 ttu white">See All</a>
</div>
</section>
</section>
{{ define "home_showcase_item" }}
{{ $img := (.Resources.ByType "image").GetMatch "*featured*" }}
{{ with $img }}
{{ $big := .Fill "1024x512 top" }}
{{ $small := $big.Resize "512x" }}
<a href="{{ $.RelPermalink}}" class="tile lazyload cover dib f4 h5 ml1 mr4 bg-black relative mw-100 shadow-5" style="width:{{ $small.Width }}px;"
data-bg="{{ $img.RelPermalink }}"
data-sizes="auto"
data-srcset="{{ $small.RelPermalink }} 1x,
{{ $big.RelPermalink }} 2x" data-src="small"
>
{{with $.Title}}
<div class="details absolute bottom-0 f3-ns f4 left-0 o-0 right-0 top-0">
<div class="absolute bottom-0 pa2 tc white">
{{.}} &#8594;
</div>
</div>
{{end}}
</a>
{{ end }}
{{ end }}

View File

@ -1,14 +1,22 @@
{{$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 "}}
{{$gtag := .gtag | default "unknown" }}
{{ with .cx.Site.Data.sponsors }}
<section class="{{ $.classes_section | default "bg-primary-color-dark b--light-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"}}">
<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 }}
{{ $banner := . }}
{{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">
{{ $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") }}
{{ $gtagID := printf "Sponsor %s %s" $banner.name $gtag | title }}
<a href="{{ $url }}" onclick="trackOutboundLink({{ printf "'%s', '%s'" $gtagID $url | safeJS }}); return false;" class="grow">
{{ else }}
<a href="{{ $url }}" class="grow">
{{ end }}
{{- end}}
<img src="{{ .logo }}" alt="Logo for {{ .name }}" class="img h3 center" />
{{with .link}}</a>{{end}}

View File

@ -29,7 +29,7 @@
</div>
<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") }}
{{ partial "home-page-sections/sponsors.html" (dict "cx" . "gtag" "footer" "classes_section" "pb3 w-100" "classes_copy" "f7 w-90-ns") }}
</div>
</div>

View File

@ -9,7 +9,7 @@
</div>
</article>
<section class="flex-ns flex-wrap justify-between w-100 v-top">
{{ range (.Paginator 20).Pages }}
{{ range (.Paginate (.Pages | shuffle ) 20).Pages }}
{{template "showcase_items" .}}
{{ end }}
</section>

View File

@ -9,15 +9,15 @@ Showcase: {{ .Title }}
<div class="flex flex-wrap">
<div class="w-100 w-20-l order-1 order-0-l">
{{template "details" .}}
{{template "sc-details" .}}
</div>
<div class="w-100 w-60-l order-0 order-1-l">
{{template "main-column" .}}
<div class="w-100 w-60-l order-0 order-1-l ph4-l">
{{template "sc-main-column" .}}
</div>
<aside class="dn mid-gray w-100 w-20-ns flex-l justify-center order-2">
{{template "navigation" .}}
{{template "sc-navigation" .}}
</aside>
</div>
@ -32,7 +32,7 @@ Showcase: {{ .Title }}
{{define "main-column"}}
{{define "sc-main-column"}}
{{ $img := (.Resources.ByType "image").GetMatch "*featured*" }}
{{ with $img }}
{{ $big := .Fill "1024x512 top" }}
@ -50,12 +50,12 @@ Showcase: {{ .Title }}
{{end}}
{{define "details"}}
<div class="mt4 mt0-ns nested-links mr3-m mr4-l">
{{define "sc-details"}}
<div class="mt4 mt0-ns nested-links">
<div class="ba b--light-gray bg-white pa3">
<h1 class="f3 mt0">{{.Title}}</h1>
<h1 class="f2-fluid mt0">{{.Title}}</h1>
{{ with .Params.siteURL }}
<a href="{{ . }}" class="db f5 mb1">{{ . | replaceRE "^https?://([^/]+).*" "$1"}} {{ partial "svg/link-ext.svg" (dict "size" "10") }}</a>
<a href="{{ . }}" class="db f5 mb1">{{ . | replaceRE "^https?://(www\\.)?([^/]+).*" "$2"}} {{ partial "svg/link-ext.svg" (dict "size" "10") }}</a>
{{ end }}
{{ with .Params.siteSource }}
<a href="{{ . }}" class="db mb4">source {{ partial "svg/link-ext.svg" (dict "size" "10") }}</a>
@ -74,7 +74,7 @@ Showcase: {{ .Title }}
</div>
{{end}}
{{define "navigation"}}
{{define "sc-navigation"}}
{{$section := where .Site.RegularPages "Section" .Section}}
{{$number_of_entries := $section | len}}
<ul class="pa0 list">

View File

@ -0,0 +1,10 @@
.f2-fluid {
font-size: 2.25rem;
}
@media (--breakpoint-large) {
.f2-fluid {
font-size: 1.25rem;
font-size: calc(0.875rem + 0.5 * ((100vw - 20rem) / 60));
}
}

View File

@ -18,6 +18,7 @@
@import '_content';
@import '_content-tables';
@import '_definition-lists';
@import '_fluid-type';
@import '_font-family';
/*@import '_hljs';*/
@import '_hugo-internal-template-styling';

File diff suppressed because one or more lines are too long