Compare commits

...

51 Commits

Author SHA1 Message Date
hugoreleaser 01fdf6d26c releaser: Add release notes to /docs for release of 0.27
[ci skip]
2017-09-11 05:32:02 +00:00
hugoreleaser 828eb70fa6 releaser: Bump versions for release of 0.27
[ci skip]
2017-09-11 05:32:02 +00:00
Bjørn Erik Pedersen f4ea433984 Release of 0.27 2017-09-11 07:27:02 +02:00
hugoreleaser 457048634f releaser: Add release notes draft for 0.27
Rename to *-ready.md to continue. [ci skip]
2017-09-11 07:26:21 +02:00
Bjørn Erik Pedersen 58245a29df docs: Merge commit '1b4319be62ba071f79e90ef32dbe92eb893429f7' 2017-09-10 17:27:23 +02:00
Bjørn Erik Pedersen 1b4319be62 Squashed 'docs/' changes from 1d052b16..44fe0285
44fe0285 Fix links to JSON spec

git-subtree-dir: docs
git-subtree-split: 44fe0285a0
2017-09-10 17:27:23 +02:00
Bjørn Erik Pedersen d2249c5099 Set up Hugo release flow on CircleCI
This rewrites the release logic to use CircleCI 2.0 and its approve workflow in combination with the state of the release notes to determine what to do next.

Fixes #3779
2017-09-10 17:14:02 +02:00
Bjørn Erik Pedersen f4bf214137 tpl/time: Add time.Duration and time.ParseDuration template funcs
And with time.Duration with the convenient alias `duration`:

```
{{ mul 60 60 | duration "second" }}
```

Fixes #3828
2017-09-09 09:43:00 +02:00
Bjørn Erik Pedersen 0462c96a5a tpl/compare: Add cond (ternary) template func
Fixes #3860
2017-09-08 16:59:43 +02:00
Bjørn Erik Pedersen 202510fdc9 hugolib: Fix "published" front matter handling
Also related:

* support "modified" as an optional way to signal "last modified"
* make sure all relevant page dates are also added to params

Fixes #3867
2017-09-08 12:28:15 +02:00
Fiisio 573deca089 hugolib: Fix typo in aquired
Signed-off-by: wgliang <liangcszzu@163.com>
2017-09-07 16:21:33 +02:00
Bjørn Erik Pedersen eeb057f222 docs: Document Related Content
See https://github.com/gohugoio/hugo/issues/98
2017-09-06 00:20:02 +02:00
Bjørn Erik Pedersen 3b4f17bbc9 hugolib: Implement "related content"
This closes #98, even if this commit does not do full content text search.

We may revisit that problem in the future, but that deserves its own issue.

Fixes #98
2017-09-06 00:20:02 +02:00
Bjørn Erik Pedersen 7d63a23b0c Squashed 'docs/' changes from f887bd7b..1d052b16
1d052b16 Update hosting-on-netlify.md
28b96bec Remove double brackets in Netlify hosting tutorial
373ed38b Update deployment instructions from hugo > 0.20 on Netlify
1bbb41ca Generate static assets on deploy in Nanobox tutorial
816d207f Add missing backtick in templates/views.md
bf88e772 Add nanobox as a deployment option
9c37b4cc Change config's syntax order matching description
d3cb05a7 Fix wrongly named default value of publishDir
4be85c54 Add link to showcase a theme setup via config file
46837195 Init and update of submodules in .gitlab-ci.yml
9e7c2827 Add CSS lang argument to code block
85aad56e Abstract the type in the lookup order
4e1e43e9 Fix broken Pygments url
65b4e79b Correct GitLab project pipelines URL
94af72b5 Fix .Data.Terms usage in taxonomy template example
eb371e52 functions: Fix lang.NumFmt docs
a745cd6c Fix layouts' folder name in template primer
e181e637 Correct typo on GitHub pages guide (#151)
28698500 Remove HTML special chars from Windows install example
96b1f5b5 Remove not needed escape slashes in urls.md
2e05043f Add upgrade instructions using homebrew
2a14624d Fix alias in countrunes.md
5e26bb97 Update docker image for build/publish
01424887 List the internal templates
a3ef5be9 Remove string concatenation from add (math) sample
43d12b44 Fix typo
89bafa49 Change to Asciidoc URI
4e14071e Removes an extra bracket (>) in single-page-templates.md
0938e423 Fix typo in http2 server push blog
fac55121 Fix typo in deployment with rsync tutorial

git-subtree-dir: docs
git-subtree-split: 1d052b16a1
2017-09-05 18:09:40 +02:00
Bjørn Erik Pedersen 16c9127663 docs: Merge commit '7d63a23b0c68d9cd7c7c09c2755619237bc03485' 2017-09-05 18:09:40 +02:00
Bjørn Erik Pedersen f88fe312cb output: Fix taxonomy term base template lookup
To make sure it uses the base templates in _default as a last resort.

Fixes #3856
2017-09-03 11:32:26 +02:00
Bjørn Erik Pedersen d33563b5d7 release: CGO_ENABLED=0 2017-08-28 11:46:03 +02:00
Bjørn Erik Pedersen fc4a0d1704 Update Travis build to Go 1.9!
Just released: https://blog.golang.org/go1.9
2017-08-25 08:08:17 +02:00
Yihui Xie 7231d5a829 livereload: Maintain the scroll position if possible
This fixes #3824: when the current pathname is the same as the one to be loaded, just call location.reload() so that the current scroll position can be preserved, instead of assigning to location.href, which will cause the scroll position to be lost.
2017-08-22 20:26:33 +02:00
oneleaftea 88e1bca92c Update template_embedded.go
Changed disqus urls from http to https. This fixes mixed content warnings on browsers when viewing Hugo websites over SSL (https).
2017-08-22 20:26:04 +02:00
Bjørn Erik Pedersen d000cf6050 tpl: Prepare for template metrics 2017-08-19 09:57:37 +02:00
Cameron Moore 29a2da0593 tpl: Cleanup strings.TrimPrefix and TrimSuffix
These funcs were added during the move to namespaces but were
undocumented.  This commit fixes the order of the arguments and adds the
funcs to the method mapping.
2017-08-18 14:21:58 +02:00
Cameron Moore 7674ad7382 tpl: Add strings.TrimLeft and TrimRight 2017-08-18 09:12:04 +02:00
Bjørn Erik Pedersen 08f48b91d6 compare, hugolib, tpl: Add Eqer interface
And use it in `eq` and `ne` so `Page` values can be compared directly in the templates without thinking about it being a `Page` or a `PageOutput` wrapper.

Fixes #3807
2017-08-18 07:36:32 +02:00
Bjørn Erik Pedersen 2fc121ce23 appveyor: Simplify 2017-08-17 10:37:42 +02:00
Bjørn Erik Pedersen 2a2e690707 hugolib: Simplify Page.Eq 2017-08-17 09:43:39 +02:00
Bjørn Erik Pedersen a7555c5431 hugolib: Do not return error in Eq on type mismatch 2017-08-17 08:32:47 +02:00
Bjørn Erik Pedersen c265c102ae hugolib: Rename Page.Equals to Page.Eq
To get the name in line with the template func `eq`.
2017-08-16 10:01:16 +02:00
Bjørn Erik Pedersen f0f49ed9b0 hugolib: Add Page.Equals 2017-08-16 09:59:42 +02:00
Bjørn Erik Pedersen 71ae9b4533 hugolib: Rewrite replaceDivider to reduce memory allocation
```bash
name              old time/op    new time/op    delta
ReplaceDivider-4   9.76µs ±105%    7.96µs ±24%     ~     (p=0.690 n=5+5)

name              old alloc/op   new alloc/op   delta
ReplaceDivider-4    3.46kB ± 0%    1.54kB ± 0%  -55.56%  (p=0.008 n=5+5)

name              old allocs/op  new allocs/op  delta
ReplaceDivider-4      6.00 ± 0%      1.00 ± 0%  -83.33%  (p=0.008 n=5+5)
```
2017-08-14 09:42:55 +02:00
Bjørn Erik Pedersen 199816fddd hugolib: Extract replaceDivider logic
To its own function and add a test and a benchmark for it.
2017-08-14 09:42:55 +02:00
Nic Raboy 919bc9210a Add an iFrame title to the YouTube shortcode
To accommodate modern web accessibility as outlined here https://dequeuniversity.com/tips/provide-iframe-titles
2017-08-12 00:36:40 +02:00
Bjørn Erik Pedersen 07f6e1499c travis: Pull docutils out into requirements.txt 2017-08-11 18:39:04 +02:00
Bjørn Erik Pedersen e8468a9852 travis: Fix docutils setup 2017-08-11 17:23:40 +02:00
Bjørn Erik Pedersen 359af563a1 travis: Try to fix docutils setup on Linux 2017-08-11 14:21:21 +02:00
Bjørn Erik Pedersen 0019ce0024 output: Improve the base template identification
See https://discourse.gohugo.io/t/main-block-not-rendered-in-custom-archetypes-layout/7917/3
2017-08-11 09:34:31 +02:00
Bjørn Erik Pedersen 33ae10b6ad tpl/transform: Only strip p tag in markdownify if only one paragraph
Fixes #3040
2017-08-10 19:52:41 +02:00
Bjørn Erik Pedersen 2d1bd876cd Update docs versiona and README
Closes #3791
2017-08-10 17:22:32 +02:00
Bjørn Erik Pedersen ec4e6f9df2 Squashed 'docs/' content from commit f887bd7b
git-subtree-dir: docs
git-subtree-split: f887bd7b4e
2017-08-10 17:18:22 +02:00
Bjørn Erik Pedersen a1900826b9 Merge commit 'ec4e6f9df2ab9ffdc62a3f59675369096e0d3f77' as 'docs' 2017-08-10 17:18:22 +02:00
Bjørn Erik Pedersen d384c661fe docs: Re-integrate 2017-08-10 17:17:07 +02:00
Bjørn Erik Pedersen 9a2eb0f1d3 Revert "Squashed 'docs/' changes from 35abbc86..f887bd7b"
That did not go well...

This reverts commit 0373e43102.
2017-08-10 15:00:30 +02:00
Bjørn Erik Pedersen 0373e43102 Squashed 'docs/' changes from 35abbc86..f887bd7b
f887bd7b Add script to pull theme changes
e89bbb2f Update README
78155dec Merge commit '9301947b25099dd402065104b340b1a480906a74' as 'themes/gohugoioTheme'
9301947b Squashed 'themes/gohugoioTheme/' content from commit 7dd8a302
e7557a34 Remove gohugoioTheme submodule
a78bbe22 Add link to Go issue
31d1ef40 Add example for taxonomy terms with metadata
da978cc7 Fix links in Blackfriday extension documentation
950ad115 Fix reference to Blackfriday Extensions section
12d1d026 Add documentation for Blackfriday Extensions
8c2b8fb5 Fix explaination for uglyURLs config option
378aded7 Use community repository for Arch Linux installation guide
56455e7e Improve 0.26 release notes
be7db03a netlify: Build with the new 0.26
d430b2d3 Bump version to 0.26
61adaca0 releaser: Prepare repository for 0.27-DEV
abef29a6 releaser: Add release notes to /docs for release of 0.26
5937fe41 releaser: Bump versions for release of 0.26
033752f1 Merge commit 'e81208265bb3cdb7606d051a23d83aeebcb7d34d'
bec2bd12 Make the title case style guide configurable
f1739a44 Merge commit '50ec65fbe1a48475d3320775dab2c47389c02114'
a1aac0e5 helpers: Add support for French Guillemets
b8dc1592 doc: Merge commit '2c0d1ccdcd95de0bddeb39dca2e4d08f0d8056d7'
7b3e31b8 Merge commit '6dbde8d731f221b027c0c60b772ba82dad759943'
a37e7201 Bump versions to 0.26-DEV

git-subtree-dir: docs
git-subtree-split: f887bd7b4e
2017-08-10 14:58:09 +02:00
Bjørn Erik Pedersen ea2cc26b39 Remove the theme submodule from /docs
See #3791
2017-08-10 14:54:19 +02:00
Johan Gielstra 0f9f73cce5 Add support for multiple config files via --config a.toml,b.toml,c.toml 2017-08-09 20:13:02 +02:00
Daniel Karlsson c8257f8b72 Render task list item inside label for correct accessibility
Fixes #3303
2017-08-09 20:09:43 +02:00
Matthieu Harlé 0abdeeef67 source: Normalize UniqueID between Windows & Linux 2017-08-09 19:35:40 +02:00
Bjørn Erik Pedersen e2f8664ef4 hugolib: More spelling 2017-08-08 10:54:35 +02:00
Bjørn Erik Pedersen 46ac745374 all: Fix spelling
And some other minor issues.
2017-08-07 20:19:24 +02:00
Bjørn Erik Pedersen 4b54fb0701 all: gofmt -s 2017-08-07 20:03:15 +02:00
Bjørn Erik Pedersen 40d7d3baa8 releaser: Prepare repository for 0.27-DEV
[ci skip]
2017-08-07 09:13:50 +02:00
367 changed files with 17254 additions and 387 deletions
+49
View File
@@ -0,0 +1,49 @@
defaults: &defaults
working_directory: /go/src/github.com/gohugoio
docker:
- image: bepsays/ci-goreleaser:0.30.5-2
version: 2
jobs:
build:
<<: *defaults
steps:
- checkout:
path: hugo
- run:
command: |
git clone git@github.com:gohugoio/hugoDocs.git
cd hugo
make vendor
make check
- persist_to_workspace:
root: .
paths: .
release:
<<: *defaults
steps:
- attach_workspace:
at: /go/src/github.com/gohugoio
- run:
command: |
cd hugo
git config --global user.email "bjorn.erik.pedersen+hugoreleaser@gmail.com"
git config --global user.name "hugoreleaser"
go run -tags release main.go release -r ${CIRCLE_BRANCH}
workflows:
version: 2
release:
jobs:
- build:
filters:
branches:
only: /release-.*/
- hold:
type: approval
requires:
- build
- release:
context: org-global
requires:
- hold
-3
View File
@@ -1,3 +0,0 @@
[submodule "themes/gohugoioTheme"]
path = docs/themes/gohugoioTheme
url = https://github.com/gohugoio/gohugoioTheme.git
+2 -2
View File
@@ -1,8 +1,9 @@
language: go
sudo: required
dist: precise
go:
- 1.7.6
- 1.8.3
- 1.9
- tip
os:
- linux
@@ -20,4 +21,3 @@ script:
before_install:
# gem install must be run with sudo on OSX
- sudo gem install asciidoctor | gem install asciidoctor
- sudo pip install docutils
+2 -9
View File
@@ -67,18 +67,11 @@ To update Hugos dependencies, use `go get` with the `-u` option.
## The Hugo Documentation
The Hugo documentation now lives in its own repository, see https://github.com/gohugoio/hugoDocs. But we do keep a version of that documentation as a `git subtree` in this repository. To build the sub folder `/docs` as a Hugo site, you need to clone this repo with submodules:
The Hugo documentation now lives in its own repository, see https://github.com/gohugoio/hugoDocs. But we do keep a version of that documentation as a `git subtree` in this repository. To build the sub folder `/docs` as a Hugo site, you need to clone this repo:
```bash
git clone --recursive git@github.com:gohugoio/hugo.git
git clone git@github.com:gohugoio/hugo.git
```
Or after you have cloned it you can do:
```bash
git submodule update --init
```
## Contributing to Hugo
For a complete guide to contributing to Hugo, see the [Contribution Guide](CONTRIBUTING.md).
-1
View File
@@ -8,7 +8,6 @@ init:
clone_folder: C:\GOPATH\src\github.com\gohugoio\hugo
install:
- git submodule update --init --recursive
- gem install asciidoctor
- pip install docutils
+1 -1
View File
@@ -347,7 +347,7 @@ description = ""
homepage = "http://example.com/"
tags = []
features = []
min_version = "0.26"
min_version = "0.27"
[author]
name = ""
+1 -4
View File
@@ -33,8 +33,6 @@ type releaseCommandeer struct {
skipPublish bool
try bool
step int
}
func createReleaser() *releaseCommandeer {
@@ -53,7 +51,6 @@ func createReleaser() *releaseCommandeer {
}
r.cmd.PersistentFlags().StringVarP(&r.version, "rel", "r", "", "new release version, i.e. 0.25.1")
r.cmd.PersistentFlags().IntVarP(&r.step, "step", "s", -1, "release step, defaults to -1 for all steps.")
r.cmd.PersistentFlags().BoolVarP(&r.skipPublish, "skip-publish", "", false, "skip all publishing pipes of the release")
r.cmd.PersistentFlags().BoolVarP(&r.try, "try", "", false, "simulate a release, i.e. no changes")
@@ -64,5 +61,5 @@ func (r *releaseCommandeer) release() error {
if r.version == "" {
return errors.New("must set the --rel flag to the relevant version number")
}
return releaser.New(r.version, r.step, r.skipPublish, r.try).Run()
return releaser.New(r.version, r.skipPublish, r.try).Run()
}
+44
View File
@@ -0,0 +1,44 @@
// Copyright 2017-present The Hugo Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Package types contains types shared between packages in Hugo.
package types
import (
"fmt"
"github.com/spf13/cast"
)
// KeyValues holds an key and a slice of values.
type KeyValues struct {
Key interface{}
Values []interface{}
}
// KeyString returns the key as a string, an empty string if conversion fails.
func (k KeyValues) KeyString() string {
return cast.ToString(k.Key)
}
func (k KeyValues) String() string {
return fmt.Sprintf("%v: %v", k.Key, k.Values)
}
func NewKeyValuesStrings(key string, values ...string) KeyValues {
iv := make([]interface{}, len(values))
for i := 0; i < len(values); i++ {
iv[i] = values[i]
}
return KeyValues{Key: key, Values: iv}
}
+29
View File
@@ -0,0 +1,29 @@
// Copyright 2017-present The Hugo Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package types
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestKeyValues(t *testing.T) {
assert := require.New(t)
kv := NewKeyValuesStrings("key", "a1", "a2")
assert.Equal("key", kv.KeyString())
assert.Equal([]interface{}{"a1", "a2"}, kv.Values)
}
+21
View File
@@ -0,0 +1,21 @@
// Copyright 2017-present The Hugo Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package compare
// Eqer can be used to determine if this value is equal to the other.
// The semantics of equals is that the two value are interchangeable
// in the Hugo templates.
type Eqer interface {
Eq(other interface{}) bool
}
+1 -1
View File
@@ -49,7 +49,7 @@ type ArchetypeFileData struct {
}
const (
// ArchetypeTemplateTemplate is used as inital template when adding an archetype template.
// ArchetypeTemplateTemplate is used as initial template when adding an archetype template.
ArchetypeTemplateTemplate = `---
title: "{{ replace .TranslationBaseName "-" " " | title }}"
date: {{ .Date }}
-3
View File
@@ -1,3 +0,0 @@
[submodule "themes/gohugoioTheme"]
path = themes/gohugoioTheme
url = https://github.com/gohugoio/gohugoioTheme.git
+2 -7
View File
@@ -13,17 +13,12 @@ Note that this repository contains solely the documentation for Hugo. For contri
## Build
To view the documentation site locally, you need to clone this repository with submodules:
To view the documentation site locally, you need to clone this repository:
```bash
git clone --recursive https://github.com/gohugoio/hugoDocs.git
git clone https://github.com/gohugoio/hugoDocs.git
```
Or if you already have a clone locally:
```bash
git submodule update --init
```
Also note that the documentation version for a given version of Hugo can also be found in the `/docs` sub-folder of the [Hugo source repository](https://github.com/gohugoio/hugo).
Then to view the docs in your browser, run Hugo and open up the link:
+1 -1
View File
@@ -52,7 +52,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.26"
release = "0.27"
## Setting this to true will add a "noindex" to *EVERY* page on the site
removefromexternalsearch = false
## Gh repo for site footer (include trailing slash)
+1 -1
View File
@@ -214,7 +214,7 @@ Markdown syntax is simple enough to learn in a single sitting. The following are
* [Markdown Tutorial (Interactive), Garen Torikian][mdtutorial]
[`emojify` function]: /functions/emojify/
[ascii]: http://asciidoc.org/
[ascii]: http://asciidoctor.org/
[bfconfig]: /getting-started/configuration/#configuring-blackfriday-rendering
[blackfriday]: https://github.com/russross/blackfriday
[mmark]: https://github.com/miekg/mmark
@@ -184,7 +184,7 @@ It's possible to set some options for Markdown rendering in a content's front ma
[content type]: /content-management/types/
[contentorg]: /content-management/organization/
[definetype]: /content-management/types/#defining-a-content-type "Learn how to specify a type and a layout in a content's front matter"
[json]: /documents/ecma-404-json-spec.pdf "Specification for JSON, JavaScript Object Notation"
[json]: https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf "Specification for JSON, JavaScript Object Notation"
[lists]: /templates/lists/#ordering-content "See how to order content in list pages; for example, templates that look to specific _index.md for content and front matter."
[lookup]: /templates/lookup-order/ "Hugo traverses your templates in a specific order when rendering content to allow for DRYer templating."
[ordering]: /templates/lists/ "Hugo provides multiple ways to sort and order your content in list templates"
+134
View File
@@ -0,0 +1,134 @@
---
title: Related Content
description: List related content in "See Also" sections.
date: 2017-09-05
categories: [content management]
#tags: [content]
menu:
docs:
parent: "content-management"
weight: 40
weight: 30
draft: false
aliases: [/content/related/,/related/]
toc: true
---
{{% note %}}
We currently do not index **Page content**. We thought we would release something that will make most people happy before we start solving [Sherlock's last case](https://github.com/joearms/sherlock).
{{% /note %}}
## List Related Content
To list up to 5 related pages is as simple as including something similar to this partial in your single page template:
{{< code file="layouts/partials/related.html" >}}
{{ $related := .Site.RegularPages.Related . | first 5 }}
{{ with $related }}
<h3>See Also</h3>
<ul>
{{ range . }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>
{{ end }}
{{< /code >}}
The full set of methods available on the page lists can bee seen in this Go interface:
```go
// A PageGenealogist finds related pages in a page collection. This interface is implemented
// by Pages and PageGroup, which makes it available as `{{ .RegularPages.Related . }}` etc.
type PageGenealogist interface {
// Template example:
// {{ $related := .RegularPages.Related . }}
Related(doc related.Document) (Pages, error)
// Template example:
// {{ $related := .RegularPages.RelatedIndices . "tags" "date" }}
RelatedIndices(doc related.Document, indices ...interface{}) (Pages, error)
// Template example:
// {{ $related := .RegularPages.RelatedTo ( keyVals "tags" "hugo" "rocks") ( keyVals "date" .Date ) }}
RelatedTo(args ...types.KeyValues) (Pages, error)
}
```
## Configure Related Content
Hugo provides a sensible default configuration of Related Content, but you can fine-tune this in your configuration, on the global or language level if needed.
Below is a sample `config.toml` section:
```
[related]
# Only include matches with rank >= threshold. This is a normalized rank between 0 and 100.
threshold = 80
# To get stable "See also" sections we, by default, exclude newer related pages.
includeNewer = false
# Will lower case keywords in both queries and in the indexes.
toLower = false
[[related.indices]]
name = "keywords"
weight = 150
[[related.indices]]
name = "author"
toLower = true
weight = 30
[[related.indices]]
name = "tags"
weight = 100
[[related.indices]]
name = "date"
weight = 10
pattern = "2006"
```
### Top Level Config Options
threshold
: A value between 0-100. Lower value will give more, but maybe not so relevant, matches.
includeNewer
: Set to true to include **pages newer than the current page** in the related content listing. This will mean that the output for older posts may change as new related content gets added.
toLower
: Set to true to lower case keywords in both the indexes and the queries. This may give more accurate results at a slight performance penalty. Note that this can also be set per index.
### Config Options per Index
name
: The index name. This value maps directly to a page param. Hugo supports string values (`author` in the example) and lists (`tags`, `keywords` etc.) and time and date objects.
weight
: An integer weight that indicates _how important_ this parameter is relative to the other parameters. It can be 0, which has the effect of turning this index off, or even negative. Test with different values to see what fits your content best.
pattern
: This is currently only relevant for dates. When listing related content, we may want to list content that is also close in time. Setting "2006" (default value for date indexes) as the pattern for a date index will add weight to pages published in the same year. For busier blogs, "200601" (year and month) may be a better default.
toLower
: See above.
## Performance Considerations
**Fast is Hugo's middle name** and we would not have released this feature had it not been blistering fast.
This feature has been in the back log and requested by many for a long time. The development got this recent kick start from this Twitter thread:
{{< tweet 898398437527363585 >}}
Scott S. Lowe removed the "Related Content" section built using the `intersect` template function on tags, and the build time dropped from 30 seconds to less than 2 seconds on his 1700 content page sized blog.
He should now be able to add an improved version of that "Related Content" section without giving up the fast live-reloads. But it's worth noting that:
* If you don't use any of the `Related` methods, you will not use the Relate Content feature, and performance will be the same as before.
* Calling `.RegularPages.Related` etc. will create one inverted index, also sometimes named posting list, that will be reused for any lookups in that same page collection. Doing that in addition to, as an example, calling `.Pages.Related` will work as expected, but will create one additional inverted index. This should still be very fast, but worth having in mind, especially for bigger sites.
+14 -1
View File
@@ -84,7 +84,7 @@ Moonrise Kingdom <- Content
## Hugo Taxonomy Defaults
Hugo natively supports taxonomies.
Hugo natively supports taxonomies.
Without adding a single line to your site's configuration file, Hugo will automatically create taxonomies for `tags` and `categories`. If you do not want Hugo to create any taxonomies, set `disableKinds` in your site's configuration to the following:
@@ -229,6 +229,19 @@ By using taxonomic weight, the same piece of content can appear in different pos
Currently taxonomies only support the [default `weight => date` ordering of list content](/templates/lists/#default-weight-date). For more information, see the documentation on [taxonomy templates](/templates/taxonomy-templates/).
{{% /note %}}
## Add custom metadata to a Taxonomy Term
If you need to add custom metadata to your taxonomy terms, you will need to create a page for that term at `/content/<TAXONOMY>/<TERM>/_index.md` and add your metadata in it's front matter. Continuing with our 'Actors' example, let's say you want to add a wikipedia page link to each actor. Your terms pages would be something like this:
{{< code file="/content/actors/bruce-willis/_index.md" >}}
---
title: "Bruce Willis"
wikipedia: "https://en.wikipedia.org/wiki/Bruce_Willis"
---
{{< /code >}}
You can later use your custom metadata as shown in the [Taxonomy Terms Templates documentation](/templates/taxonomy-templates/#displaying-custom-meta-data-in-taxonomy-terms-templates).
[`urlize` template function]: /functions/urlize/
[content section]: /content-management/sections/
[content type]: /content-management/types/
+3 -3
View File
@@ -24,7 +24,7 @@ The default Hugo target directory for your built website is `public/`. However,
The `permalinks` option in your [site configuration][config] allows you to adjust the directory paths (i.e., the URLs) on a per-section basis. This will change where the files are written to and will change the page's internal "canonical" location, such that template references to `.RelPermalink` will honor the adjustments made as a result of the mappings in this option.
{{% note "Default Publish and Content Folders" %}}
These examples use the default values for `publishDir` and `contentDir`; i.e., `publish` and `content`, respectively. You can override the default values in your [site's `config` file](/getting-started/configuration/).
These examples use the default values for `publishDir` and `contentDir`; i.e., `public` and `content`, respectively. You can override the default values in your [site's `config` file](/getting-started/configuration/).
{{% /note %}}
For example, if one of your [sections][] is called `post` and you want to adjust the canonical path to be hierarchical based on the year, month, and post title, you could set up the following configurations in YAML and TOML, respectively.
@@ -149,14 +149,14 @@ Assuming a `baseURL` of `example.com`, the contents of the auto-generated alias
<head>
<title>https://example.com/posts/my-intended-url</title>
<link rel="canonical" href="https://example.com/posts/my-intended-url"/>
<meta name=\"robots\" content=\"noindex\">
<meta name="robots" content="noindex">
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta http-equiv="refresh" content="0; url=https://example.com/posts/my-intended-url"/>
</head>
</html>
```
The `http-equiv="refresh"` line is what performs the redirect, in 0 seconds in this case. If an end user of your website goes to `https://example.com/posts/my-old-url`, they will now be automatically redirected to the newer, correct URL. The addition of `<meta name=\"robots\" content=\"noindex\">` lets search engine bots know they they should not crawl and index your new alias page.
The `http-equiv="refresh"` line is what performs the redirect, in 0 seconds in this case. If an end user of your website goes to `https://example.com/posts/my-old-url`, they will now be automatically redirected to the newer, correct URL. The addition of `<meta name="robots" content="noindex">` lets search engine bots know they they should not crawl and index your new alias page.
### Customize
You may customize this alias page by creating an `alias.html` template in the
+8 -7
View File
@@ -1,18 +1,18 @@
---
title: lang.NumFmt
description: "Formats a number with a given precision using the requested `decimal`, `grouping`, and `negative` characters."
description: "Formats a number with a given precision using the requested `negative`, `decimal`, and `grouping` options. The `options` parameter is a string consisting of `<negative> <decimal> <grouping>`."
godocref: ""
workson: []
date: 2017-02-01
publishdate: 2017-02-01
lastmod: 2017-02-01
lastmod: 2017-08-21
categories: [functions]
#tags: [numbers]
menu:
docs:
parent: "functions"
toc: false
signature: ["lang.NumFmt <decimal> <grouping> <negative> <precision> <number>"]
signature: ["lang.NumFmt PRECISION NUMBER [OPTIONS]"]
workson: []
hugoversion:
relatedfuncs: []
@@ -27,8 +27,9 @@ The default options value is `- . ,`.
Numbers greater than or equal to 5 are rounded up. For example, if precision is set to `0`, `1.5` becomes `2`, and `1.4` becomes `1`.
```
{{ lang.NumFmt "," "." "-" 2 12345.6789 }} → 12.345,68
{{ lang.NumFmt "." "" "-" 6 -12345.6789 }} → -12345.678900
{{ lang.NumFmt "." "," "-" 0 -12345.6789 }} → -12,346
{{ -98765.4321 | lang.NumFmt "." "," "-" 2 }} → -98,765.43
{{ lang.NumFmt 2 12345.6789 }} → 12,345.68
{{ lang.NumFmt 2 12345.6789 "- , ." }} → 12.345,68
{{ lang.NumFmt 0 -12345.6789 "- . ," }} → -12,346
{{ lang.NumFmt 6 -12345.6789 "- ." }} → -12345.678900
{{ -98765.4321 | lang.NumFmt 2 }} → -98,765.43
```
+1 -1
View File
@@ -15,7 +15,7 @@ workson: []
hugoversion:
relatedfuncs: []
deprecated: false
aliases: [/functions/countrunes/,/functions/countwords/]
aliases: [/functions/countrunes/]
---
In contrast with `countwords` function, which counts every word in a string, the `countrunes` function determines the number of runes in the content and excludes any whitespace. This has specific utility if you are dealing with CJK-like languages.
-32
View File
@@ -31,35 +31,3 @@ There are 6 basic mathematical operators that can be used in Hugo templates:
| `mul` | Multiplies two integers. | `{{mul 2 3}}` &rarr; 6 |
| `sub` | Subtracts two integers. | `{{sub 3 2}}` &rarr; 1 |
## Use `add` with Strings
You can also use the `add` function with strings. You may like this functionality in many use cases, including creating new variables by combining page- or site-level variables with other strings.
For example, social media sharing with [Twitter Cards][cards] requires the following `meta` link in your site's `<head>` to display Twitter's ["Summary Card with Large Image"][twtsummary]:
```
<meta name="twitter:image" content="https://example.com/images/my-twitter-image.jpg">
```
Let's assume you have an `image` field in the front matter of each of your content files:
```
---
title: My Post
image: my-post-image.jpg
---
```
You can then concatenate the `image` value (string) with the path to your `images` directory in `static` and leverage a URL-related templating function for increased flexibility:
{{< code file="partials/head/twitter-card.html" >}}
{{$socialimage := add "images/" .Params.image}}
<meta name="twitter:image" content="{{ $socialimage | absURL }}">
{{< /code >}}
{{% note %}}
The `add` example above makes use of the [`absURL` function](/functions/absurl/). `absURL` and its relative companion `relURL` is the recommended way to construct URLs in Hugo.
{{% /note %}}
[cards]: https://dev.twitter.com/cards/overview
[twtsummary]: https://dev.twitter.com/cards/types/summary-large-image
+4
View File
@@ -22,6 +22,10 @@ aliases: [/extras/scratch/,/doc/scratch/]
In most cases you can do well without `Scratch`, but there are some use cases that aren't solvable with Go's templates without `Scratch`'s help, due to scoping issues.
{{% note %}}
See [this Go issue](https://github.com/golang/go/issues/10608) for the main motivation behind Scratch.
{{% /note %}}
`Scratch` is added to both `Page` and `Shortcode` -- with following methods:
* `Set` and `Add` takes a `key` and the `value` to add.
@@ -155,11 +155,11 @@ stepAnalysis: false
themesDir: "themes"
theme: ""
title: ""
# if true, use /filename.html instead of /filename/
# Title Case style guide for the title func and other automatic title casing in Hugo.
// Valid values are "AP" (default), "Chicago" and "Go" (which was what you had in Hugo <= 0.25.1).
// See https://www.apstylebook.com/ and http://www.chicagomanualofstyle.org/home.html
titleCaseStyle: "AP"
# if true, use /filename.html instead of /filename/
uglyURLs: false
# verbose output
verbose: false
@@ -387,9 +387,9 @@ Hugo v0.20 introduced the ability to render your content to multiple output form
[`.Site.Params`]: /variables/site/
[directory structure]: /getting-started/directory-structure
[json]: /documents/ecma-404-json-spec.pdf
[json]: https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf "Specification for JSON, JavaScript Object Notation"
[lookup order]: /templates/lookup-order/
[Output Formats]: /templates/output-formats/
[templates]: /templates/
[toml]: https://github.com/toml-lang/toml
[yaml]: http://yaml.org/spec/
[yaml]: http://yaml.org/spec/
+9 -12
View File
@@ -388,10 +388,10 @@ C:\Hugo\Sites> hugo new site example.com
You should now have a directory at `C:\Hugo\Sites\example.com`. Change into that directory and list the contents. You should get output similar to the following:
```
C:\Hugo\Sites&gt;cd example.com
C:\Hugo\Sites\example.com&gt;dir
&nbsp;Directory of C:\hugo\sites\example.com
&nbsp;
C:\Hugo\Sites> cd example.com
C:\Hugo\Sites\example.com> dir
Directory of C:\hugo\sites\example.com
04/13/2015 10:44 PM <DIR> .
04/13/2015 10:44 PM <DIR> ..
04/13/2015 10:44 PM <DIR> archetypes
@@ -441,15 +441,12 @@ 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.
### Arch
### Arch Linux
You can also install Hugo from the [Arch user repository](https://aur.archlinux.org/) on Arch Linux or derivatives such as Manjaro.
Be aware that Hugo is built from source. This means that additional tools like [Git](https://git-scm.com) and [Go](https://golang.org/doc/install) will be installed as well.
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.
```
sudo pacman -S yaourt
yaourt -S hugo
sudo pacman -Sy hugo
```
### Fedora, CentOS, and Red Hat
@@ -462,7 +459,7 @@ See the [related discussion in the Hugo forums][redhatforum].
## Upgrade Hugo
Upgrading Hugo is as easy as downloading and replacing the executable youve placed in your `PATH`.
Upgrading Hugo is as easy as downloading and replacing the executable youve placed in your `PATH` or run `brew upgrade hugo` if using Homebrew.
## Install Pygments (Optional)
@@ -484,7 +481,7 @@ Now that you've installed Hugo, read the [Quick Start guide][quickstart] and exp
[installgit]: http://git-scm.com/
[installgo]: https://golang.org/dl/
[Path Editor]: https://patheditor2.codeplex.com/
[pygments]: https://pygments.org
[pygments]: http://pygments.org
[quickstart]: /getting-started/quick-start/
[redhatforum]: https://discourse.gohugo.io/t/solved-fedora-copr-repository-out-of-service/2491
[releases]: https://github.com/gohugoio/hugo/releases
@@ -0,0 +1,247 @@
---
title: Host-Agnostic Deploys with Nanobox
linktitle: Host-Agnostic Deploys with Nanobox
description: Easily deploy Hugo to AWS, DigitalOcean, Google, Azure, and more...
date: 2017-08-24
publishdate: 2017-08-24
lastmod: 2017-08-24
categories: [hosting and deployment]
#tags: [nanobox,deployment,hosting,aws,digitalocean,azure,google,linode]
authors: [Steve Domino]
menu:
docs:
parent: "hosting-and-deployment"
weight: 05
weight: 05
sections_weight: 05
draft: false
aliases: [/tutorials/deployment-with-nanobox/]
toc: true
---
![hugo with nanobox](/images/hosting-and-deployment/deployment-with-nanobox/hugo-with-nanobox.png)
## Before You Begin
Nanobox provides an entire end-to-end workflow for developing and deploying applications. Using Nanobox to deploy also means you'll use it to develop your application.
{{% note %}}
If you're already using Nanobox and just need deployment instructions, you can skip to [Deploying Hugo with Nanobox](#deploying-hugo-with-nanobox)
{{% /note %}}
## What You'll Need
With Nanobox you don't need to worry about having Golang or Hugo installed. They'll be installed as part of the development environment created for you.
To get started you'll just need the following three items:
* [A Nanobox Account](https://nanobox.io) - Signup is free
* [Nanobox Desktop](https://dashboard.nanobox.io/download) - The free desktop development tool
* An account with a hosting provider such as:
- [AWS](https://aws.amazon.com/)
- [DigitalOcean](https://www.digitalocean.com/)
- [Linode](https://www.linode.com/)
- Azure (coming)
- Google (coming)
- [Roll Your Own](https://docs.nanobox.io/providers/create/)
### Before We Begin
There are a few things to get out of the way before diving into the guide. To deploy, you'll need to make sure you have connected a host account to your Nanobox account, and launched a new application.
#### Connect a Host Account
Nanobox lets you choose where to host your application (AWS, DigitalOcean, Google, Azure, etc.). In the [Hosting Accounts](https://dashboard.nanobox.io/provider_accounts) section of your Nanobox dashboard [link your Nanobox account with your host](https://docs.nanobox.io/providers/hosting-accounts/).
#### Launch a New Application on Nanobox
[Launching a new app on Nanobox](https://docs.nanobox.io/workflow/launch-app/) is very simple. Navigate to [Launch New App](https://dashboard.nanobox.io/apps/new) in the dashboard, and follow the steps there. You'll be asked to name your app, and select a host and region.
With those out of the way you're ready to get started!
## Getting Started
{{% note %}}
If you already have a functioning Hugo app, you can skip to [Configure Hugo to run with Nanobox](#configure-hugo-to-run-with-nanobox)
{{% /note %}}
To get started, all you'll need an empty project directory. Create a directory wherever you want your application to live and `cd` into it:
`mkdir path/to/project && cd path/to/project`
### Configure Hugo to run with Nanobox
Nanobox uses a simple config file known as a [boxfile.yml](https://docs.nanobox.io/boxfile/) to describe your application's infrastructure. In the root of your project add the following `boxfile.yml`:
{{< code file="boxfile.yml" >}}
run.config:
# use the static engine
engine: static
engine.config:
# tell the engine where to serve static assets from
rel_dir: public
# enable file watching for live reload
fs_watch: true
# install hugo
extra_steps:
- bash ./install.sh
deploy.config:
# generate site on deploy
extra_steps:
- hugo
{{< /code >}}
{{% note %}}
If you already have a functioning Hugo app, which should now be configured, you can skip to [Deploying Hugo with Nanobox](#deploying-hugo-with-nanobox).
{{% /note %}}
### Installing Hugo
Nanobox uses Docker to create instant, isolated, development environments. Because of this, you'll need to make sure that during development you have Hugo available.
Do this by add a custom install script at the root of your project that will install Hugo automatically for you:
{{< code file="install.sh" >}}
#!/bin/bash
if [[ ! -f /data/bin/hugo ]]; then
cd /tmp
wget https://github.com/gohugoio/hugo/releases/download/v0.25.1/hugo_0.25.1_Linux-64bit.tar.gz
tar -xzf hugo_0.25.1_Linux-64bit.tar.gz
mv hugo /data/bin/hugo
cd -
rm -rf /tmp/*
fi
{{< /code >}}
{{% note %}}
If the install script fails during `nanobox run` you may need to make it executable with `chmod +x install.sh`
{{% /note %}}
### Generating a New Hugo App
You'll generate your new application from inside a Nanobox console (this is why you don't need to worry about having Golang or Hugo installed).
Run the following command to drop into a Nanobox console (inside the VM) where your codebase is mounted:
```
nanobox run
```
![nanobox run](/images/hosting-and-deployment/deployment-with-nanobox/nanobox-run.png)
Once inside here use the following steps to create a new Hugo application:
```
# cd into the /tmp dir to create an app
cd /tmp
# generate the hugo app
hugo new site app
# cd back into the /app dir
cd -
# copy the generated app into the project
shopt -s dotglob
cp -a /tmp/app/* .
```
### Install a theme
`cd` into the `themes` directory and clone the `nanobox-hugo-theme` repo:
```
cd themes
git clone https://github.com/sdomino/nanobox-hugo-theme
```
To use the theme *either* copy the entire `config.toml` that comes with the theme, or just add the theme to your existing `config.toml`
```
# copy the config.toml that comes with the theme
cp ./themes/nanobox-hugo-theme/config.toml config.toml
# or, add it to your existing config.toml
theme = "nanobox-hugo-theme"
```
{{% note %}}
It is not intended that you use the `nanobox-hugo-theme` as your actual theme. It's simply a theme to start with and should be replaced.
{{% /note %}}
### View Your App
To view your application simply run the following command from a Nanobox console:
```
hugo server --bind="0.0.0.0" --baseUrl=$APP_IP
```
![hugo server](/images/hosting-and-deployment/deployment-with-nanobox/hugo-server.png)
With that you should be able to visit your app at the given IP:1313 address
{{% note %}}
You can [add a custom DNS alias](https://docs.nanobox.io/cli/dns/#add) to make it easier to access your app. Run `nanobox dns add local hugo.dev`. After starting your server, visit your app at [hugo.dev:1313](http://hugo.dev:1313)
{{% /note %}}
### Develop, Develop, Develop
{{% note %}}
IMPORTANT: One issue we are aware of, and actively investigating, is livereload. Currently, livereload does not work when developing Hugo applications with Nanobox.
{{% /note %}}
With Hugo installed you're ready to go. Develop Hugo like you would normally (using all the generators, etc.). Once your app is ready to deploy, run `hugo` to generate your static assets and get ready to deploy!
## Deploying Hugo with Nanobox
{{% note %}}
If you haven't already, make sure to [connect a hosting account](#connect-a-host-account) to your Nanobox account, and [launch a new application](#launch-a-new-application-on-nanobox) in the Dashboard.
{{% /note %}}
To deploy your application to Nanobox you simply need to [link your local codebase](https://docs.nanobox.io/workflow/deploy-code/#add-your-live-app-as-a-remote) to an application you've created on Nanobox. That is done with the following command:
```
nanobox remote add <your-app-name>
```
{{% note %}}
You may be prompted to login using your ***Nanobox credentials*** at this time
{{% /note %}}
### Stage Your Application (optional)
Nanobox gives you the ability to [simulate your production environment locally](https://docs.nanobox.io/workflow/deploy-code/#preview-locally). While staging is optional it's always recommended, so there's no reason not to!
To stage your app simply run:
```
nanobox deploy dry-run
```
Now visit your application with the IP address provided.
![nanobox deploy dry-run](/images/hosting-and-deployment/deployment-with-nanobox/nanobox-deploy-dry-run.png)
### Deploy Your Application
Once everything checks out and you're [ready to deploy](https://docs.nanobox.io/workflow/deploy-code/#deploy-to-production), simply run:
```
nanobox deploy
```
Within minutes you're Hugo app will be deployed to your host and humming along smoothly. That's it!
@@ -1,12 +1,12 @@
---
title: Deployment with Rysnc
linktitle: Deployment with Rysnc
title: Deployment with Rsync
linktitle: Deployment with Rsync
description: If you have access to your web host with SSH, you can use a simple rsync one-liner to incrementally deploy your entire Hugo website.
date: 2017-02-01
publishdate: 2017-02-01
lastmod: 2017-02-01
categories: [hosting and deployment]
#tags: [rysnc,deployment]
#tags: [rsync,deployment]
authors: [Adrien Poupin]
menu:
docs:
@@ -37,13 +37,12 @@ Make sure your `baseURL` key-value in your [site configuration](/getting-started
[As described in the GitHub Pages documentation][ghpfromdocs], you can deploy from a folder called `docs/` on your master branch. To effectively use this feature with Hugo, you need to change the Hugo publish directory in your [site's][config] `config.toml` and `config.yaml`, respectively:
```
publishDir: docs
```
```
publishDir = "docs"
```
```
publishDir: docs
```
After running `hugo`, push your master branch to the remote repository and choose the `docs/` folder as the website source of your repo. Do the following from within your GitHub project:
@@ -217,7 +216,7 @@ cd ..
```
You can then run `./deploy.sh "Your optional commit message"` to send changes to `<USERNAME>.github.io`. Note that you likely will want to commit changes to your `<YOUR-PROJECDT>` repository as well.
You can then run `./deploy.sh "Your optional commit message"` to send changes to `<USERNAME>.github.io`. Note that you likely will want to commit changes to your `<YOUR-PROJECT>` repository as well.
That's it! Your personal page should be up and running at `https://yourusername.github.io` within a couple minutes.
@@ -38,7 +38,11 @@ cd your-hugo-site
In the root directory of your Hugo site, create a `.gitlab-ci.yml` file. The `.gitlab-ci.yml` configures the GitLab CI on how to build your page. Simply add the content below.
{{< code file="gitlab-ci.yml" >}}
image: publysher/hugo
image: monachus/hugo
before_script:
- git submodule init
- git submodule update --force
pages:
script:
@@ -70,7 +74,7 @@ git push -u origin master
## Wait for Your Page to Build
That's it! You can now follow the CI agent building your page at https://gitlab.com/<YourUsername>/<your-hugo-site>/pipelines.
That's it! You can now follow the CI agent building your page at `https://gitlab.com/<YourUsername>/<your-hugo-site>/pipelines`.
After the build has passed, your new website is available at `https://<YourUsername>.gitlab.io/<your-hugo-site>/`.
@@ -63,7 +63,7 @@ Once selected, you'll be brought to a screen for basic setup. Here you can selec
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, you can append an underscore followed by the version number to the build command:
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
@@ -73,6 +73,22 @@ 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.
For production:
```
[context.production.environment]
HUGO_VERSION = "0.26"
```
For testing:
```
[context.deploy-preview.environment]
HUGO_VERSION = "0.26"
```
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)
+4 -4
View File
@@ -1,13 +1,13 @@
---
date: 2017-08-07
title: "0.26"
description: "0.26"
title: "Hugo 0.26: Language Style Edition"
description: "Hugo 0.26 brings proper AP Style or Chicago Style Title Case, « French Guillemets » and more."
categories: ["Releases"]
images:
- images/blog/hugo-26-poster.png
---
Hugo `0.26` is the **Language Style Edition**.
This release brings a choice of **AP Style or Chicago Style Title Case** ([8fb594bf](https://github.com/gohugoio/hugo/commit/8fb594bfb090c017d4e5cbb2905780221e202c41) [#989](https://github.com/gohugoio/hugo/issues/989)). You can also now configure Blackfriday to render **« French Guillemets »** ([cb9dfc26](https://github.com/gohugoio/hugo/commit/cb9dfc2613ae5125cafa450097fb0f62dd3770e7) [#3725](https://github.com/gohugoio/hugo/issues/3725)). To enable French Guillemets, put this in your site `config.toml`:
+93
View File
@@ -0,0 +1,93 @@
---
date: 2017-09-11
title: "0.27"
description: "0.27"
categories: ["Releases"]
---
Hugo `0.27`comes with fast and flexible **Related Content** ([3b4f17bb](https://github.com/gohugoio/hugo/commit/3b4f17bbc9ff789faa581ac278ad109d1ac5b816) [@bep](https://github.com/bep) [#98](https://github.com/gohugoio/hugo/issues/98)). To add this to your site, put something like this in your single page template:
```html
{{ $related := .Site.RegularPages.Related . | first 5 }}
{{ with $related }}
<h3>See Also</h3>
<ul>
{{ range . }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>
{{ end }}
```
The above translates to _list the five regular pages mostly related to the current page_. See the [Related Content Documentation](https://gohugo.io/content-management/related/) for details and configuration options.
This release represents **37 contributions by 9 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 [@moorereason](https://github.com/moorereason), [@yihui](https://github.com/yihui), and [@oneleaftea](https://github.com/oneleaftea) 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 **44 contributions by 30 contributors**. A special thanks to [@bep](https://github.com/bep), [@sdomino](https://github.com/sdomino), [@gotgenes](https://github.com/gotgenes), and [@digitalcraftsman](https://github.com/digitalcraftsman) for their work on the documentation site.
Hugo now has:
* 19464+ [stars](https://github.com/gohugoio/hugo/stargazers)
* 455+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
* 178+ [themes](http://themes.gohugo.io/)
## Notes
* We now only strip p tag in `markdownify` if there is only one paragraph. This allows blocks of paragraphs to be "markdownified" [33ae10b6](https://github.com/gohugoio/hugo/commit/33ae10b6ade67cd9618970121d7de5fd2ce7d781) [@bep](https://github.com/bep) [#3040](https://github.com/gohugoio/hugo/issues/3040)
## Enhancements
### Templates
* Add `time.Duration` and `time.ParseDuration` template funcs [f4bf2141](https://github.com/gohugoio/hugo/commit/f4bf214137ebd24a0d12f16d3a98d9038e6eabd3) [@bep](https://github.com/bep) [#3828](https://github.com/gohugoio/hugo/issues/3828)
* Add `cond` (ternary) template func [0462c96a](https://github.com/gohugoio/hugo/commit/0462c96a5a9da3e8adc78d96acd39575a8b46c40) [@bep](https://github.com/bep) [#3860](https://github.com/gohugoio/hugo/issues/3860)
* Prepare for template metrics [d000cf60](https://github.com/gohugoio/hugo/commit/d000cf605091c6999b72d6c632752289bc680223) [@bep](https://github.com/bep)
* Add `strings.TrimLeft` and `TrimRight` [7674ad73](https://github.com/gohugoio/hugo/commit/7674ad73825c61eecc4003475fe0577f225fe579) [@moorereason](https://github.com/moorereason)
* compare, hugolib, tpl: Add `Eqer` interface [08f48b91](https://github.com/gohugoio/hugo/commit/08f48b91d68d3002b887ddf737456ff0cc4e786d) [@bep](https://github.com/bep) [#3807](https://github.com/gohugoio/hugo/issues/3807)
* Only strip p tag in `markdownify` if only one paragraph [33ae10b6](https://github.com/gohugoio/hugo/commit/33ae10b6ade67cd9618970121d7de5fd2ce7d781) [@bep](https://github.com/bep) [#3040](https://github.com/gohugoio/hugo/issues/3040)
* Cleanup `strings.TrimPrefix` and `TrimSuffix` [29a2da05](https://github.com/gohugoio/hugo/commit/29a2da0593b081cdd61b93c6328af2c9ea4eb20f) [@moorereason](https://github.com/moorereason)
### Output
* Improve the base template (aka `baseof.html`) identification [0019ce00](https://github.com/gohugoio/hugo/commit/0019ce002449d671a20a69406da37b10977f9493) [@bep](https://github.com/bep)
### Core
* Implement "related content" [3b4f17bb](https://github.com/gohugoio/hugo/commit/3b4f17bbc9ff789faa581ac278ad109d1ac5b816) [@bep](https://github.com/bep) [#98](https://github.com/gohugoio/hugo/issues/98)
* Add `Page.Equals` [f0f49ed9](https://github.com/gohugoio/hugo/commit/f0f49ed9b0c9b4545a45c95d56340fcbf4aafbef) [@bep](https://github.com/bep)
* Rewrite `replaceDivider` to reduce memory allocation [71ae9b45](https://github.com/gohugoio/hugo/commit/71ae9b4533083be185c5314c9c5b273cc3bd07bd) [@bep](https://github.com/bep)
### Other
* Set up Hugo release flow on `CircleCI` [d2249c50](https://github.com/gohugoio/hugo/commit/d2249c50991ba7b00b092aca6e315ca1a4de75a1) [@bep](https://github.com/bep) [#3779](https://github.com/gohugoio/hugo/issues/3779)
* Maintain the scroll position if possible [7231d5a8](https://github.com/gohugoio/hugo/commit/7231d5a829f8d97336a2120afde1260db6ee6541) [@yihui](https://github.com/yihui) [#3824](https://github.com/gohugoio/hugo/issues/3824)
* Add an `iFrame` title to the `YouTube` shortcode [919bc921](https://github.com/gohugoio/hugo/commit/919bc9210a69c801c7304c0b529df93d1dca27aa) [@nraboy](https://github.com/nraboy)
* Remove the theme submodule from /docs [ea2cc26b](https://github.com/gohugoio/hugo/commit/ea2cc26b390476f1c605405604f8c92afd09b6ee) [@bep](https://github.com/bep) [#3791](https://github.com/gohugoio/hugo/issues/3791)
* Add support for multiple config files via `--config a.toml,b.toml,c.toml` [0f9f73cc](https://github.com/gohugoio/hugo/commit/0f9f73cce5c3f1f05be20bcf1d23b2332623d7f9) [@jgielstra](https://github.com/jgielstra)
* Render task list item inside `label` for correct accessibility [c8257f8b](https://github.com/gohugoio/hugo/commit/c8257f8b726478ca70dc8984cdcc17b31e4bdc0c) [@danieka](https://github.com/danieka) [#3303](https://github.com/gohugoio/hugo/issues/3303)
* Normalize `UniqueID` between Windows & Linux [0abdeeef](https://github.com/gohugoio/hugo/commit/0abdeeef6740a3cbba0db95374853d040f2022b8) [@Shywim](https://github.com/Shywim)
## Fixes
### Output
* Fix taxonomy term base template lookup [f88fe312](https://github.com/gohugoio/hugo/commit/f88fe312cb35f7de1615c095edd2f898303dd23b) [@bep](https://github.com/bep) [#3856](https://github.com/gohugoio/hugo/issues/3856)
* Fix `published` front matter handling [202510fd](https://github.com/gohugoio/hugo/commit/202510fdc92d52a20baeaa7edb1091f6882bd95f) [@bep](https://github.com/bep) [#3867](https://github.com/gohugoio/hugo/issues/3867)
@@ -66,7 +66,7 @@ Also note that this is a template for the home page, so the full `Page` with its
## 3. Add Template For the _redirects File
Add `layouts/index.redirects`:
Add `layouts/index.redir`:
```bash
# Netlify redirects. See https://www.netlify.com/docs/redirects/
{{ range $p := .Site.Pages -}}
+129 -5
View File
@@ -1,7 +1,9 @@
## Blackfriday Options
`taskLists`
: default: **`true`**<br>
Blackfriday flag: <br>
Purpose: `false` turns off GitHub-style automatic task/TODO list generation
Purpose: `false` turns off GitHub-style automatic task/TODO list generation.
`smartypants`
: default: **`true`** <br>
@@ -27,14 +29,14 @@
`smartDashes`
: default: **`true`** <br>
Blackfriday flag: **`HTML_SMARTY_DASHES`** <br>
Purpose: `false` disables smart dashes; i.e., the conversion of multiple hyphens into an en dash or em dash. If `true`, its behavior can be modified with the `latexDashes` flag below.
Purpose: `false` disables smart dashes; i.e., the conversion of multiple hyphens into an en-dash or em-dash. If `true`, its behavior can be modified with the `latexDashes` flag below.
`latexDashes`
: default: **`true`** <br>
Blackfriday flag: **`HTML_SMARTYPANTS_LATEX_DASHES`** <br>
Purpose: `false` disables LaTeX-style smart dashes and selects conventional smart dashes. Assuming `smartDashes`: <br>
If `true`, `--` is translated into &ndash; (`&ndash;`), whereas `---` is translated into &mdash; (`&mdash;`). <br>
However, *spaced* single hyphen between two words is translated into an en&nbsp;dash&mdash; e.g., "`12 June - 3 July`" becomes `12 June ndash; 3 July` upon rendering.
However, *spaced* single hyphen between two words is translated into an en&nbsp;dash&mdash; e.g., "`12 June - 3 July`" becomes `12 June &ndash; 3 July` upon rendering.
`hrefTargetBlank`
: default: **`false`** <br>
@@ -51,10 +53,132 @@
: default: **`[]`** <br>
Blackfriday flag: **`EXTENSION_*`** <br>
Purpose: Enable one or more Blackfriday's Markdown extensions (if they aren't Hugo defaults). <br>
Example: Include `hardLineBreak` in the list to enable Blackfriday's `EXTENSION_HARD_LINK_BREAK`
Example: Include `hardLineBreak` in the list to enable Blackfriday's `EXTENSION_HARD_LINK_BREAK`. <br>
*See [Blackfriday extensions](#blackfriday-extensions) section for more information.*
`extensionsmask`
: default: **`[]`** <br>
Blackfriday flag: **`EXTENSION_*`** <br>
Purpose: Enable one or more of Blackfriday's Markdown extensions (if they aren't Hugo defaults). <br>
Example: Include `autoHeaderIds` as `false` in the list to disable Blackfriday's `EXTENSION_AUTO_HEADER_IDS`.
Example: Include `autoHeaderIds` as `false` in the list to disable Blackfriday's `EXTENSION_AUTO_HEADER_IDS`. <br>
*See [Blackfriday extensions](#blackfriday-extensions) section for more information.*
## Blackfriday extensions
`noIntraEmphasis`
: default: *enabled* <br>
Purpose: The "\_" character is commonly used inside words when discussing
code, so having Markdown interpret it as an emphasis command is usually the
wrong thing. When enabled, Blackfriday lets you treat all emphasis markers
as normal characters when they occur inside a word.
`tables`
: default: *enabled* <br>
Purpose: When enabled, tables can be created by drawing them in the input
using the below syntax:
Example:
Name | Age
--------|------
Bob | 27
Alice | 23
`fencedCode`
: default: *enabled* <br>
Purpose: When enabled, in addition to the normal 4-space indentation to mark
code blocks, you can explicitly mark them and supply a language (to make
syntax highlighting simple).
You can use 3 or more backticks to mark the beginning of the block, and the
same number to mark the end of the block.
Example:
```md
# Heading Level 1
Some test
## Heading Level 2
Some more test
```
`autolink`
: default: *enabled* <br>
Purpose: When enabled, URLs that have not been explicitly marked as links
will be converted into links.
`strikethrough`
: default: *enabled* <br>
Purpose: When enabled, text wrapped with two tildes will be crossed out. <br>
Example: `~~crossed-out~~`
`laxHtmlBlocks`
: default: *disabled* <br>
Purpose: When enabled, loosen up HTML block parsing rules.
`spaceHeaders`
: default: *enabled* <br>
Purpose: When enabled, be strict about prefix header rules.
`hardLineBreak`
: default: *disabled* <br>
Purpose: When enabled, newlines in the input translate into line breaks in
the output.
`tabSizeEight`
: default: *disabled* <br>
Purpose: When enabled, expand tabs to eight spaces instead of four.
`footnotes`
: default: *enabled* <br>
Purpose: When enabled, Pandoc-style footnotes will be supported. The
footnote marker in the text that will become a superscript text; the
footnote definition will be placed in a list of footnotes at the end of the
document. <br>
Example:
This is a footnote.[^1]
[^1]: the footnote text.
`noEmptyLineBeforeBlock`
: default: *disabled* <br>
Purpose: When enabled, no need to insert an empty line to start a (code,
quote, ordered list, unordered list) block.
`headerIds`
: default: *enabled* <br>
Purpose: When enabled, allow specifying header IDs with `{#id}`.
`titleblock`
: default: *disabled* <br>
Purpose: When enabled, support [Pandoc-style title blocks][1].
`autoHeaderIds`
: default: *enabled* <br>
Purpose: When enabled, auto-create the header ID's from the headline text.
`backslashLineBreak`
: default: *enabled* <br>
Purpose: When enabled, translate trailing backslashes into line breaks.
`definitionLists`
: default: *enabled* <br>
Purpose: When enabled, a simple definition list is made of a single-line
term followed by a colon and the definition for that term. <br>
Example:
Cat
: Fluffy animal everyone likes
Internet
: Vector of transmission for pictures of cats
Terms must be separated from the previous definition by a blank line.
`joinLines`
: default: *enabled* <br>
Purpose: When enabled, delete newlines and join the lines.
[1]: http://pandoc.org/MANUAL.html#extension-pandoc_title_block
+2 -2
View File
@@ -31,8 +31,8 @@ The [lookup order][lookup] for base templates is as follows:
4. `/themes/<THEME>/layouts/<TYPE>/baseof.html`
5. `/layouts/section/baseof.html`
6. `/themes/<THEME>/layouts/section/baseof.html`
7. `/layouts/_default/post-baseof.html`
8. `/themes/<THEME>/layouts/_default/post-baseof.html`
7. `/layouts/_default/<TYPE>-baseof.html`
8. `/themes/<THEME>/layouts/_default/<TYPE>-baseof.html`
9. `/layouts/_default/baseof.html`
10. `/themes/<THEME>/layouts/_default/baseof.html`
+1 -1
View File
@@ -240,7 +240,7 @@ If you change any local file and the LiveReload is triggered, Hugo will read the
[config]: /getting-started/configuration/
[csv]: https://tools.ietf.org/html/rfc4180
[customize]: /themes/customizing/
[json]: /documents/ecma-404-json-spec.pdf
[json]: https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf "Specification for JSON, JavaScript Object Notation"
[LiveReload]: /getting-started/usage/#livereload
[lookup]: /templates/lookup-order/
[markdownify]: /functions/markdownify/
+10 -14
View File
@@ -118,18 +118,14 @@ You can then render your custom Disqus partial template as follows:
{{ partial "disqus.html" . }}
```
```
_internal/_default/robots.txt
_internal/_default/rss.xml
_internal/_default/sitemap.xml
_internal/_default/sitemapindex.xml
## The Internal Templates
* `_internal/disqus.html`
* `_internal/google_news.html`
* `_internal/google_analytics.html`
* `_internal/google_analytics_async.html`
* `_internal/opengraph.html`
* `_internal/pagination.html`
* `_internal/schema.html`
* `_internal/twitter_cards.html`
_internal/disqus.html
_internal/google_news.html
_internal/google_analytics.html
_internal/google_analytics_async.html
_internal/opengraph.html
_internal/pagination.html
_internal/schema.html
_internal/twitter_cards.html
```
+1 -1
View File
@@ -110,7 +110,7 @@ There are more boolean operators than those listed in the Hugo docs in the [Gola
When including another template, you will pass to it the data it will be
able to access. To pass along the current context, please remember to
include a trailing dot. The templates location will always be starting at
the `/layout/` directory within Hugo.
the `/layouts/` directory within Hugo.
### Template and Partial Examples
@@ -119,7 +119,7 @@ You could then include the following as part of your shortcode templating:
```
{{ if .IsNamedParams }}
<img src="{{.Get "src" alt="">
<img src="{{.Get "src" }}" alt="">
{{ else }}
<img src="{{.Get 0}}" alt="">
{{ end }}.
@@ -345,4 +345,4 @@ More shortcode examples can be found in the [shortcodes directory for spf13.com]
[spfscs]: https://github.com/spf13/spf13.com/tree/master/layouts/shortcodes "See more examples of shortcodes by visiting the shortcode directory of the source for spf13.com, the blog of Hugo's creator, Steve Francia."
[templates]: /templates/ "The templates section of the Hugo docs."
[vimeoexample]: #single-flexible-example-vimeo
[youtubeshortcode]: /content-management/shortcodes/#youtube "See how to use Hugo's built-in YouTube shortcode."
[youtubeshortcode]: /content-management/shortcodes/#youtube "See how to use Hugo's built-in YouTube shortcode."
@@ -25,7 +25,7 @@ You can specify a [content's `type`][content type] and `layout` in a single cont
Hugo assumes your content section and content type are the same unless you tell Hugo otherwise by providing a `type` directly in the front matter of a content file. This is why #1 and #3 come before #2 and #4, respectively, in the following lookup order. Values in angle brackets (`<>`) are variable.
1. `/layouts/<TYPE>/<LAYOUT>.html`
2. `/layouts/<SECTION>>/<LAYOUT>.html`
2. `/layouts/<SECTION>/<LAYOUT>.html`
3. `/layouts/<TYPE>/single.html`
4. `/layouts/<SECTION>/single.html`
5. `/layouts/_default/single.html`
@@ -102,4 +102,4 @@ To easily generate new instances of a content type (e.g., new `.md` files in a s
[section]: /content-management/sections/
[site variables]: /variables/site/
[spf13]: http://spf13.com/
[`with`]: /functions/with/
[`with`]: /functions/with/
+17 -2
View File
@@ -117,6 +117,21 @@ type WeightedPages []WeightedPage
.Pages
: Returns a slice of pages, which then can be ordered using any of the [list methods][renderlists].
## Displaying custom metadata in Taxonomy Terms Templates
If you need to display custom metadata for each taxonomy term, you will need to create a page for that term at `/content/<TAXONOMY>/<TERM>/_index.md` and add your metadata in it's front matter, [as explained in the taxonomies documentation](/content-management/taxonomies/#add-custom-meta-data-to-a-taxonomy-term). Based on the Actors taxonomy example shown there, within your taxonomy terms template, you may access your custom fields by iterating through the variable `.Data.Pages` as such:
```
<ul>
{{ range .Data.Pages }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
{{ .Params.wikipedia }}
</li>
{{ end }}
</ul>
```
<!-- Begin /taxonomies/ordering/ -->
## Order Taxonomies
@@ -128,7 +143,7 @@ Taxonomies can be ordered by either alphabetical key or by the number of content
```
<ul>
{{ $data := .Data }}
{{ range $key, $value := .Data.Taxonomy.Alphabetical }}
{{ range $key, $value := .Data.Terms.Alphabetical }}
<li><a href="{{ $.Site.LanguagePrefix }}/{{ $data.Plural }}/{{ $value.Name | urlize }}"> {{ $value.Name }} </a> {{ $value.Count }} </li>
{{ end }}
</ul>
@@ -139,7 +154,7 @@ Taxonomies can be ordered by either alphabetical key or by the number of content
```
<ul>
{{ $data := .Data }}
{{ range $key, $value := .Data.Taxonomy.ByCount }}
{{ range $key, $value := .Data.Terms.ByCount }}
<li><a href="{{ $.Site.LanguagePrefix }}/{{ $data.Plural }}/{{ $value.Name | urlize }}"> {{ $value.Name }} </a> {{ $value.Count }} </li>
{{ end }}
</ul>
+2 -2
View File
@@ -27,7 +27,7 @@ The following are common use cases for content views:
## Create a Content View
To create a new view, create a template in each of your different content type directories with the view name. The following example contains an "li" view and a "summary" view for the `post` and `project` content types. As you can see, these sit next to the [single content view][single] template, `single.html. You can even provide a specific view for a given type and continue to use the `_default/single.html` for the primary view.
To create a new view, create a template in each of your different content type directories with the view name. The following example contains an "li" view and a "summary" view for the `post` and `project` content types. As you can see, these sit next to the [single content view][single] template, `single.html`. You can even provide a specific view for a given type and continue to use the `_default/single.html` for the primary view.
```
▾ layouts/
@@ -118,4 +118,4 @@ Continuing on the previous example, we can change our render function to use a s
[spfsourcesection]: https://github.com/spf13/spf13.com/blob/master/layouts/_default/section.html
[spfsourcesummary]: https://github.com/spf13/spf13.com/blob/master/layouts/_default/summary.html
[summaries]: /content-management/summaries/
[taxonomylists]: /templates/taxonomy-templates/
[taxonomylists]: /templates/taxonomy-templates/
@@ -79,7 +79,7 @@ Hugo applies the decided theme first and then applies anything that is in the lo
### Command Line
There are two different approaches to using a theme with your Hugo website: via the Hugo CLI or as part of your
There are two different approaches to using a theme with your Hugo website: via the Hugo CLI or as part of your [site configuration file][config].
To change a theme via the Hugo CLI, you can pass the `-t` [flag][] when building your site:
@@ -109,4 +109,4 @@ The `themename` in the above examples must match the name of the specific theme
[flag]: /getting-started/usage/ "See the full list of flags in Hugo's basic usage."
[install]: /getting-started/installing/
[config]: /getting-started/configuration/ "Learn how to customize your Hugo website configuration file in yaml, toml, or json."
[themesrepo]: https://github.com/gohugoio/hugoThemes
[themesrepo]: https://github.com/gohugoio/hugoThemes
+2 -2
View File
@@ -203,7 +203,7 @@ body {
Here is the same example but with triple back ticks to denote the fenced code block:
{{< nohighlight >}}
```
```css
body {
font-family: "Noto Sans", sans-serif;
}
@@ -234,4 +234,4 @@ Please see individual libraries' documentation for how to implement each of the
[Rainbow]: http://craig.is/making/rainbows
[Syntax Highlighter]: http://alexgorbatchev.com/SyntaxHighlighter/
[Google Prettify]: https://github.com/google/code-prettify
[Yandex]: http://yandex.ru/
[Yandex]: http://yandex.ru/
+3 -3
View File
@@ -3,15 +3,15 @@
command = "hugo"
[context.production.environment]
HUGO_VERSION = "0.25.1"
HUGO_VERSION = "0.26"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"
[context.deploy-preview.environment]
HUGO_VERSION = "0.25.1"
HUGO_VERSION = "0.26"
[context.branch-deploy.environment]
HUGO_VERSION = "0.25.1"
HUGO_VERSION = "0.26"
[context.next.environment]
HUGO_BASEURL = "https://next--gohugoio.netlify.com/"
+4
View File
@@ -0,0 +1,4 @@
#!/bin/bash
git subtree pull --prefix=themes/gohugoioTheme/ git@github.com:gohugoio/gohugoioTheme.git master --squash
Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

+4
View File
@@ -0,0 +1,4 @@
src/node_modules
node_modules
.DS_Store
*.log
+1
View File
@@ -0,0 +1 @@
Theme for gohugo.io sites. More info to come.
+13
View File
@@ -0,0 +1,13 @@
---
linktitle: ""
description: ""
godocref: ""
publishdate: ""
lastmod: ""
categories: []
tags: []
weight: 00
slug: ""
aliases: []
toc: false
---
+17
View File
@@ -0,0 +1,17 @@
---
linktitle: ""
description: ""
godocref: ""
publishdate: ""
lastmod: ""
categories: [functions]
tags: []
ns: ""
signature: []
workson: []
hugoversion: ""
aliases: []
relatedfuncs: []
toc: false
deprecated: false
---
+13
View File
@@ -0,0 +1,13 @@
---
description: ""
lastmod: ""
license: ""
licenseLink: ""
sitelink: ""
sourcelink: ""
categories: [showcase]
tags: []
image: ""
toc: false
notesforauthors: "Go to gohugo.io/contribute/documentation for more info"
---
+16
View File
@@ -0,0 +1,16 @@
---
linktitle: ""
description: ""
godocref: ""
publishdate: ""
lastmod: ""
categories: [tutorials]
tags: []
author: ""
authorurl: ""
originalurl: ""
draft: false
aliases: []
notesforauthors: "Go to gohugo.io/contribute/documentation for more info."
---
+10
View File
@@ -0,0 +1,10 @@
{{ define "main" }}
<main class="cf pa5 pa4-l f4 tc center measure-wide lh-copy gray">
<h1 class="f3 f2-ns">The page you're looking for doesn't exist. Perhaps you'd like to gopher something else? Sorry.</h1>
<div class="h6">
{{ partial "svg/gopher-hero.svg" . }}
</div>
{{ .Content }}
</main>
{{ end }}
+51
View File
@@ -0,0 +1,51 @@
<!DOCTYPE html>
<html class="no-js" lang="{{ with $.Site.LanguageCode }}{{ . }}{{ else }}en-us{{ end }}">
<head>
<meta charset="utf-8">
{{/* https://www.zachleat.com/web/preload/ */}}
<link rel="preload" href="{{ "files/muli-latin-200.woff2" | absURL }}" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="{{ "files/muli-latin-400.woff2" | absURL }}" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="{{ "files/muli-latin-800.woff2" | absURL }}" as="font" type="font/woff2" crossorigin>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
{{/* NOTE: the Site's title, and if there is a page title, that is set too */}}
<title>{{ block "title" . }}{{ .Site.Title }} {{ with .Title }} | {{ . }}{{ end }}{{ end }}</title>
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width,minimum-scale=1">
{{ .Hugo.Generator }}
{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }}
<META NAME="ROBOTS" CONTENT="INDEX, FOLLOW">
{{ else }}
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
{{ end }}
<link href='{{ "dist/main.css" | relURL }}' rel='stylesheet' type="text/css" />
{{- partial "head-additions.html" . -}}
{{- template "_internal/opengraph.html" . -}}
{{- template "_internal/google_news.html" . -}}
{{- template "_internal/schema.html" . -}}
{{- partial "twitter_cards.html" . -}}
{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }}
{{ template "_internal/google_analytics_async.html" . }}
{{ end }}
</head>
<body class="ma0 sans-serif bg-primary-color-light{{ with getenv "HUGO_ENV" }} {{ . }}{{ end }}">
{{ block "nav" . }}{{ partial "site-nav.html" . }}{{ end }}
{{ block "header" . }}{{ end }}
<main role="main" class="content-with-sidebar min-vh-100 pb7 pb0-ns">
{{ block "main" . }}{{ end }}
</main>
{{ block "footer" . }}{{ partial "site-footer.html" . }}{{ end }}
{{ block "scripts" . }}{{- partial "site-scripts.html" . -}}{{ end }}
</body>
</html>
+4
View File
@@ -0,0 +1,4 @@
{{ define "main" }}
{{ $section_to_display := .Sections | default .Paginator.Pages }}
{{ partial "pagelayout.html" (dict "context" . "section_to_display" $section_to_display ) }}
{{ end }}
+37
View File
@@ -0,0 +1,37 @@
<header class="flex-none w-100">
{{ if .Params.categories }}
{{ range .Params.categories }}
<a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}" class="f6 fw8 mb0 link mid-gray dim mr3">
{{ humanize . | upper }}
</a>
{{ end }}
{{end}}
<h1 class="lh-title mb3 mv0 pt3 primary-color-dark">
{{- if eq .Section "functions" -}}
{{ .LinkTitle }}
{{- else -}}
{{ .Title }}
{{- end -}}
</h1>
</header>
<aside class="bt bw1 pt3 mt2 mid-gray b--mid-gray fn w-100">
{{ with .Params.description }}
<div class="f4 fw4 lh-copy">
{{ . | markdownify }}
</div>
{{ end }}
<!--
NOTE: Removed to test builds without it.
partial "components/author-github-data" (dict "context" . "size" "110") -->
</aside>
{{ with .Params.featured_image_path }}
<img src="{{ . }}" alt="Featured Image for {{ $.Title }}" class="mw-100">
{{ end }}
<div class="prose" id="prose">
{{- partial "docs/functions-signature.html" . -}}
{{ .Content }}
</div>
+30
View File
@@ -0,0 +1,30 @@
{{ define "main" }}
<article class="w-100 ph4 pb5 pb6-ns pt1 pt5-ns">
<div class="flex-l">
<div class="order-2 w-100 w-20-l ph5-m ph0-l mb4 sticky">
{{- partial "toc.html" . -}}
</div>
<div class="order-1 w-60-l mw7 ph0 ph5-ns mid-gray nested-copy-line-height no-underline nested-links nested-img nested-copy-seperator nested-blockquote mt0-ns" style="flex-grow:1;">
<div class="documentation-copy center measure-wide-l">
<div id="readout" class="fixed right-0 bottom-0">
</div>
{{ .Render "page" }}
</div>
</div>
<div class="order-0 w-20 dn db-l">
{{ partial "nav-links-docs.html" . }}
</div>
</div>
</article>
<div class="w-100 bg-light-gray">
<div class="mw7 pa4 center nested-lh-copy lh-copy">
{{ partial "docs/page-meta-data.html" . }}
{{ partial "page-edit.html" . }}
{{ partial "tags.html" . }}
</div>
</div>
{{ end }}
@@ -0,0 +1,4 @@
{{ define "main" }}
{{ $section_to_display := .Data.Pages }}
{{ partial "pagelayout.html" (dict "context" . "section_to_display" $section_to_display ) }}
{{ end }}
+49
View File
@@ -0,0 +1,49 @@
{{/* {{ define "header" }}{{ partial "page-header" . }}{{ end }} */}}
{{ define "main" }}
{{ $section_to_display := .Data.Pages }}
<div class="w-100 ph4 pb5 pb6-ns pt1 pt3-ns">
<div class="flex">
<div class="dn db-l w-20">
{{ partial "nav-links-docs.html" . }}
</div>
<div class="w-100 w-80-l ph0 ph4-l">
<article class="w-100 nested-copy-line-height nested-links nested-img">
<h1 class="primary-color-dark f2">
{{ .Title }}
</h1>
</article>
<div class="pa3 pa4-ns w-100 v-top column-count-3-l column-gap-1-l">
{{ range $key, $value := .Data.Terms }}
<div class="break-inside-avoid-l nested-copy-line-height mb5">
<h2 class="f3">
<a href="{{ "/" | relLangURL }}{{ $.Data.Plural | urlize }}/{{ $key | urlize }}" class="link black hover-blue">
{{ $key }} <span class="f6 gray"> &#8599;</span>
</a>
</h2>
{{ range $value.Pages }}
<h3>
<a href="{{ .Permalink }}" class="link blue">
{{ .Title }}
</a>
</h3>
{{ end }}
</div>
{{ end }}
</div>
</div>
</div>
</div>
{{ end }}
+8
View File
@@ -0,0 +1,8 @@
/*
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Referrer-Policy: origin-when-cross-origin
*/
Link: <{{ "dist/app.bundle.js" | relURL }}>; rel=preload; as=script
Link: <{{ "dist/main.css" | relURL }}>; rel=preload; as=style
+23
View File
@@ -0,0 +1,23 @@
{{ define "header" }}
{{ partial "hero" . }}
{{ partial "boxes-small-news" . }}
{{ end }}
{{ define "main" }}
<section class="w-100 ph4 ph5-ns pv4">
{{- partial "home-page-sections/features-icons" . -}}
</section>
{{- partial "home-page-sections/features-single" . -}}
<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>
<section class="w-100 ph4 ph5-ns pv4 pv6-ns mid-gray bg-accent-color-dark">
{{- partial "home-page-sections/tweets" . -}}
</section>
<section class="w-100 ph4 ph5-ns pt4 pb5 mid-gray bg-primary-color-light bb bt b--light-gray ">
{{- partial "home-page-sections/open-source-involvement" . -}}
</section>
{{ end }}
+6
View File
@@ -0,0 +1,6 @@
# Netlify redirects. See https://www.netlify.com/docs/redirects/
{{ range $p := .Site.Pages -}}
{{ range .Aliases }}
{{ . | printf "%-35s" }} {{ $p.RelPermalink -}}
{{ end -}}
{{- end -}}
+42
View File
@@ -0,0 +1,42 @@
{{/* TODO: think about adding these tags back in, but they need to be limited to news
{{ define "header" }}{{ partial "page-header" . }}{{ end }} */}}
{{ define "main" }}
<div class="w-100 ph4 ph5-ns pb5 pb6-ns pt1 pt3-ns ">
<article class="cf pa3 pa4-m pa4-l nested-copy-line-height nested-img">
<h1 class="primary-color-dark">
{{ .Title }}
</h1>
<div class="nested-copy-line-height">
{{ .Content }}
</div>
</article>
<!-- TODO: May be a good idea in this case to add monthly archives -->
<div class="flex flex-wrap">
{{/* [wip] add archive lists
<div class="w-100 w-20-ns dn">
<ul>
<li>
<a href="#">
archive section
</a>
</li>
</ul>
</div> */}}
{{ $interior_classes := $.Site.Params.flex_box_interior_classes }}
<section class="flex-ns flex-wrap justify-between w-100 w-80-nsTK v-top">
{{ range .Paginator.Pages }}
{{ partial "boxes-section-summaries" (dict "context" . "classes" $interior_classes "fullcontent" false) }}
{{ end }}
</section>
</div>
<div class="nested-list-reset nested-links">
{{/* pagination.html: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/template_embedded.go#L117 */}}
{{ template "_internal/pagination.html" . }}
</div>
</div>
{{ end }}
+83
View File
@@ -0,0 +1,83 @@
{{ define "main" }}
{{ $currentPageUrl := .URL }}
<article class="cf ph4 pv3 pv5-ns">
<!-- header spans the full width -->
<header class="flex-none w-100 pb3">
{{ if .Params.categories }}
{{ range .Params.categories }}
<a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}" class="f6 fw8 mb0 link mid-gray dim mr3">
{{ humanize . | upper }}
</a>
{{ end }}
{{end}}
<h1 class="lh-title fw9 mb7 mv0 pt3">
<a href="{{ .URL }}" class="link primary-color dim">
{{ .Title }}
</a>
</h1>
</header>
<div class="flex-l">
<aside class="mid-gray fn w-100 w-25-l">
{{ with .Params.description }}
<h2 class="f3 lh-title">
{{ . | markdownify }}
</h2>
{{ end }}
<time class="f6 mt2 db ttu tracked" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
{{ .Date.Format "January 2, 2006" }}
</time>
{{ if in .Params.categories "Releases" }}
<p>
Go to <a href="https://github.com/gohugoio/hugo/releases" class="link primary-color dim">Hugo Releases</a> for the release downloads.
</p>
{{ end }}
<!--
NOTE: Removed to test builds without it.
partial "components/author-github-data" (dict "context" . "size" "110") -->
<div class="nested-links mt4">
{{- partial "previous-next-links-in-section.html" . -}}
</div>
</aside>
<div class="fn pl5-l pt3 mid-gray w-100 w-two-third-l sans-serif nested-copy-line-height no-underline nested-links nested-img nested-copy-seperator nested-blockquote measure-wide-l"><!-- TODO: Can the content top and the description top line up more precisely, or is just winging it with padding the best we've got? -->
{{ with .Params.featured_image_path }}
<img src="{{ . }}" alt="Featured Image for {{ $.Title }}" class="mw-100">
{{ end }}
{{ .Content }}
</div>
</div>
{{ if and .Params.tags .Site.Taxonomies.tags }}
<div class="mt5 f6 gray nested-lh-copy bg-light-gray ph3 pv2 measure-wide-l">
{{ $name := index .Params.tags 0 }}
{{ $name := $name | urlize }}
{{ $tags := index .Site.Taxonomies.tags $name }}
<ul class="list dib nested-links ml0 pl0">
<li class="dib mb2 mr2">Related:</li>
{{ range $tags.Pages }}
{{ if ne .URL $currentPageUrl }}
<li class="mb2 mr3">
<a href="{{ .URL }}" class="link">
{{ .LinkTitle }}
</a>
</li>
{{ end }}
{{end}}
</ul>
</div>
{{end}}
<div class="gray f6 mv6">
Last Update: {{ .Lastmod.Format "January 2, 2006" }} <br>
{{ partial "page-edit.html" . }}
</div>
</article>
{{ end }}
@@ -0,0 +1,4 @@
{{ define "main" }}
{{ $section_to_display := (.Site.Taxonomies.categories.fundamentals).Pages }}
{{ partial "pagelayout.html" (dict "context" . "section_to_display" $section_to_display ) }}
{{ end }}
@@ -0,0 +1,35 @@
<div class="relative {{ .classes }} weight-{{ .context.Weight }}">
<div class="bg-white mb2 pa3 pa4-l gray">
{{ if eq .context.Section "news" }}
<date class="f6 db" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
{{ .context.Date.Format "January 2, 2006" }}
</date>
{{ end }}
<h1 class="near-black f3">
<a href="{{ .context.URL }}" class="link primary-color dim">
{{- if eq .context.Section "functions" -}}
{{ .context.LinkTitle }}
{{- else -}}
{{ .context.Title }}
{{- end -}}
</a>
</h1>
<div class="lh-copy links">
{{ if .context.Params.description }}
{{ .context.Params.description | markdownify }}
{{ else }}
{{ .context.Summary }}
{{ end }}
<a href="{{ .context.RelPermalink }}" class="f6 mt2 db link primary-color dim">
Read More &raquo;
</a>
</div>
</div>
</div>
+18
View File
@@ -0,0 +1,18 @@
<section class="relative w-100 bg-black white">
<div class="flex flex-wrap w-90-l center center mw9">
<!-- <a href="/news/" class="link accent-color tr-ns f6 w-100 w-50-m w-10-l bg-animate hover-bg-accent-color hover-white pv3 pv4-l ph3 ph4-l dib">
Latest News:
</a> -->
{{ range first 4 ( sort (where .Data.Pages "Section" "news") "Date" "desc" ) }}
<!-- only show 2 boxes on mobile -->
{{ $.Scratch.Add "i" 1 }}{{ $i := $.Scratch.Get "i" }}
<a href="{{ .URL }}" class="link lh-copy light-gray f6 w-100 w-50-m w-25-l bg-animate hover-bg-accent-color hover-white pv3 pv4-ns ph3 ph4-ns{{ if ge $i 3 }} dn dib-l{{ else }} dib{{ end }}">
<span class="f6 gray pb1 db">
{{ .Date.Format "January 2, 2006" }}
</span>
{{ .Params.description | markdownify | truncate 100 "…"}}
</a>
{{ end }}
</div>
</section>
@@ -0,0 +1,33 @@
{{ $author := .context.Params.author }}
{{ if $author }}
<aside class="mw5 center bg-white br3 pa3 pa4-ns mv3 ba b--black-10 nested-links">
{{ $urlPre := "https://api.github.com" }}
{{ $user_json := getJSON $urlPre "/users/" $author }}
<div class="tc">
{{ if $user_json.avatar_url }}
<a href="{{ $user_json.html_url }}" class="link hover-bg-light-gray pa1 br-100">
<img src="{{ $user_json.avatar_url }}&size={{ .size }}" alt="" class="br-100 ba b--light-gray">
</a>
{{ end }}
{{ if $user_json.name }}
<h3 class="f4">
<a href="{{ $user_json.html_url }}" class="link dim">
{{ $user_json.name }}
</a>
</h3>
<hr class="mw3 bb bw1 b--black-10">
{{ end }}
{{ if $user_json.bio }}
<p class="lh-copy measure center f6 black-70">
{{ $user_json.bio }}
</p>
{{ end }}
</div>
</aside>
{{ end }}
@@ -0,0 +1,21 @@
{{ $author := .context.Params.author }}
{{ if $author }}
<aside class="mw5 br3 mv3 nested-links">
{{ $urlPre := "https://api.github.com" }}
{{ $user_json := getJSON $urlPre "/users/" $author }}
{{ if $user_json.name }}
<h3 class="f4 dib">
{{ $user_json.name | htmlEscape }}
</h3>
{{ end }}
{{ if $user_json.bio }}
<p class="lh-copy measure center mt0 f6 black-60">
{{ $user_json.bio | htmlEscape }}
</p>
{{ end }}
<a href="{{ $user_json.html_url }}" class="link dim v-mid dib">
{{ partial "svg/github-squared.svg" (dict "fill" "gray" "width" "16" "height" "18") }}
</a>
</aside>
{{ end }}
@@ -0,0 +1,11 @@
{{ if isset .Params "signature" -}}
{{- with .Params.signature }}
<h2 class="minor mb1 pt4 primary-color-dark">Syntax</h2>
{{- range . }}
<pre class="f5 mb4 ph3 pv2 bg-light-gray" style="border-left:4px solid #0594CB;">
{{- . -}}
</pre>
{{- end }}
{{- end -}}
{{ end }}
{{/* The inline style overrides `pre` styling defaults */}}
@@ -0,0 +1,6 @@
<h6 class="f4 dark-gray mb2">
<a href="{{ .Permalink }}" class="hide-child link primary-color">
<span class="nl3 child">{{ partial "svg/link-permalink.svg" (dict "size" "14px") }}</span>
“{{ .Title }}”
</a> was last updated: {{ .Lastmod.Format "January 2, 2006" }}{{ with .GitInfo }}: <a class="hide-child link primary-color" href="{{$.Site.Params.ghrepo}}/commit/{{ .Hash }}">{{ .Subject }} ({{ .AbbreviatedHash }})</a>{{end }}
</h6>
@@ -0,0 +1,13 @@
<div class="relative w-100 mb4 bg-white nested-copy-line-height">
<div class="bg-white mb3 pa4 gray overflow-hidden">
<span class="f6 db">{{ humanize .Section }}</span>
<h1 class="f3 near-black">
<a href="{{ .URL }}" class="link black dim">
{{ .Title }}
</a>
</h1>
<div class="nested-links f5 lh-copy nested-copy-line-height">
{{ .Summary }}
</div>
</div>
</div>
+18
View File
@@ -0,0 +1,18 @@
<header class="bg-primary-color-dark ph4 tc" role="banner">
<section class="center pb4 pb5-l ph4-l pt3 pt5-ns w-90 w-60-l">
<div class="center w-100 w-50-ns">
{{ partial "svg/hugo-logo-wide.svg" . }}
</div>
{{ with .Site.Params.description }}
<h2 class="f3 f1-l fw4 white-90 m0 lh-title pt2 pb3 pv0-ns">
{{ . }}
</h2>
{{ end }}
<div class="lh-copy f4 w-90-ns center fw2 silver tc tc-ns">
{{ .Content }}
</div>
<div class="w4 mv4 center">
<a class="f5 db link grow tc v-mid bg-blue white ba b--blue ph3 pv2 br1" href="/getting-started/quick-start/">Quick Start</a>
</div>
</section>
</header>
@@ -0,0 +1,34 @@
<div class="w-90-l center">
{{ if .Params.features }}
<div class=" flex-ns flex-wrap justify-center center mw9">
{{ $features := .Params.features }}
{{ range $i, $e := $features }}
{{ $features_count := $e | len }}
<div class="w-100{{ if and (eq $i $features_count) (ne (modBool $features_count 2) true) }} w-70-ns {{ else }} w-50-ns {{ end }}ph5-l pv5-l nested-copy-line-height">
<!-- NOTE: "if eq $i $features_count" makes the last item a bit wider for balance. If we use an even number of items, we'll want to remove this -->
<div class="flex-l flex-wrap justify-between">
<div class="flex-auto w-100 w-20-ns pt1 ">
{{ with .image_path }}
<img src="{{ . }}" alt="icon depicting {{ $e.heading }}" class="h3 o-80 v-mid center w-100">
{{ end }}
</div>
<div class="flex-auto tc tl-ns w-100 w-80-ns">
<h3 class="lh-title gray o-80 f4 f5-ns mb2 fw8 bmt1 mt0-l">
{{ .heading }}
</h3>
<div class="db v-mid w-100 gray measure-wide mb5 mb0-l">
<p class="f3 primary-color mt0 mb2">{{.tagline}}</p>
<div class="lh-copy">
{{ .copy }}
</div>
</div>
</div>
</div>
</div>
{{ end }}
</div>
{{ end }}
</div>
@@ -0,0 +1,32 @@
{{ if .Params.sections }}
{{ range .Params.sections }}
{{ $.Scratch.Add "i" 1 }}{{ $i := $.Scratch.Get "i" }}
<section class="w-100 ph4 ph5-ns pv4 pv6-ns mid-gray {{ .color_classes }}">
<div class="flex-ns flex-wrap center mw9">
<div class="w-100 w-50-l {{ if modBool $i 2 }}order-1{{ else }}order-0{{ end }}">
<div class="w-90-ns center">
<img src="{{ .image }}" alt="image depicting an example of {{ .heading }}" class="img shadow-5">
</div>
</div>
<div class="w-100 w-50-l">
<div class="w-80-ns center tc">
<h3 class="f1 fw4 black ma0 pt4 lh-title pt0-l">{{ .heading }}</h3>
<p class="f3 lh-copy">
{{ .copy }}
</p>
<p class="f4 lh-copy nested-linksTK">
<a href="{{ .link | absURL }}" class="link black dim">
{{ .cta }} {{ partial "svg/link-ext.svg" (dict "fill" "#333" "size" "14") }}
</a>
</p>
</div>
</div>
</div>
</section>
{{ end }}
{{ end }}
@@ -0,0 +1,39 @@
<div class="flex-ns flex-wrap center mw9">
<!-- LEFT -->
<div class="w-100 w-50-ns">
<div class="w-80 center tc nested-copy-line-height">
<h3 class="f2 black">Install in seconds, build in milliseconds.</h3>
<p class="f3">Hugo works on macOS, Windows, Linux, FreeBSD, and others.</p>
<p class="f3">Host on any server or your favorite CDN.</p>
</div>
</div>
<!-- RIGHT -->
<div class="w-100 w-50-ns tc">
<div class="h4">
{{ partial "svg/gopher-hero.svg" . }}
</div>
<p class="f6 mid-gray m0 p0 pt3">Mac OS</p>
<div class="code f6 bg-black light-green lh-copy pv3 ph3 br2 w-100 w-50-ns center mb2 tl">
$ brew install hugo <br />
</div>
<p class="f6 mid-gray">Windows</p>
<div class="code f6 bg-black light-green lh-copy pv3 ph3 br2 w-100 w-50-ns center tl">
$ choco install hugo -confirm <br />
</div>
<p class="f6 mid-gray">Linux</p>
<div class="code f6 bg-black light-green lh-copy pv3 ph3 br2 w-100 w-50-ns center tl">
$ snap install hugo <br />
</div>
<p class="f5 nested-links"><a href="{{ "getting-started/installing/" | absURL }}" class="link">See the Getting Started Guide for other methods. {{ partial "svg/link-ext.svg" (dict "fill" "#333" "size" "14") }}</a></p>
</div>
<!-- TODO: the install section should have a tab menu for selecting the preferred installation method, i.e. the binaries from GitHub or the commands for the installation via a package manager https://github.com/rdwatters/hugo-docs-concept/issues/3#issuecomment-287498412 -->
<!-- TODO: Animate the gopher https://github.com/rdwatters/hugo-docs-concept/issues/3#issuecomment-287194777 -->
</div>
@@ -0,0 +1,59 @@
<div class="w-100 center pt5">
<div class="w-100 w-40-l tc center">
<img src="/images/GitHub-Mark-64px.png" alt="Github Logo" class="tc center">
</div>
</div>
<div class="flex-ns flex-wrap center pb4 center mw9">
<!-- LEFT -->
<div class="w-100 tc w-third-l">
<h3 class="f3 mv3 accent-color-light">We welcome all contributions</h3>
<ul class="list ma0 pa0">
<li class="mb3 f4">
<a href="https://github.com/gohugoio/hugo/blob/master/CONTRIBUTING.md" class="link mid-gray dim">
Fork the repo and work on an issue {{ partial "svg/link-ext.svg" (dict "fill" "#333" "size" "14") }}
</a>
</li>
<li class="mb3 f4">
<a href="http://themes.gohugo.io" class="link mid-gray dim">
Design a theme {{ partial "svg/link-ext.svg" (dict "fill" "#333" "size" "14") }}
</a>
</li>
</ul>
</div>
<div class="w-100 w-third-l tc">
<div class="w-60-l center">
<p class="f4">Hugo is open-source and completely free.</p>
<p class="f4">Our hundreds of contributors make Hugo great.</p>
</div>
</div>
<div class="w-100 tc w-third-l">
<h3 class="f3 mv3 accent-color-light">More ways to contribute</h3>
<ul class="list ma0 pa0">
<li class="mb3 f4">
<a href="https://gohugo.io/overview/introduction/" class="link mid-gray dim">
Help improve the docs {{ partial "svg/link-ext.svg" (dict "fill" "#333" "size" "14") }}
</a>
</li>
<li class="mb3 f4">
<a href="https://discourse.gohugo.io/" class="link mid-gray dim">
Help others in the forums {{ partial "svg/link-ext.svg" (dict "fill" "#333" "size" "14") }}
</a>
</li>
</ul>
</div>
<!-- RIGHT -->
</div>
@@ -0,0 +1,25 @@
<div class="flex-ns flex-wrap center mw9">
{{ $interior_classes := $.Site.Params.flex_box_interior_classes }}
<h3 class="f2 fw4 white">See what others are saying about Hugo…</h3>
<div class="flex-ns flex-wrap justify-between">
{{ range first 4 (sort $.Site.Data.homepagetweets.tweet "date" "desc" ) }}
<div class="homepage-tweet relative {{ $interior_classes }} br1 mid-gray pv3 nested-links shadow-5">
<div class="absolute top-0 left-0 ma2 o-10">
{{ partial "svg/twitter.svg" . }}
</div>
<blockquote>
<p class="f4">
{{.quote | safeHTML}}
</p>
<cite class="homepage-tweet-attribution gray f6">&#9472; {{ .name }} ({{ .twitter_handle }}) <a href="{{ .link }}">
{{ dateFormat "January 2, 2006" .date }}</a>
</cite>
</blockquote>
</div>
{{ end }}
</div>
</div>
+1
View File
@@ -0,0 +1 @@
<a href="{{ .url }}" class="dim"><svg class="grow" fill="{{ .color }}" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" fill="none"/><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg></a>
+7
View File
@@ -0,0 +1,7 @@
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="/manifest.json">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#0594cb">
<meta name="theme-color" content="#ffffff">
@@ -0,0 +1,11 @@
{{ $currentPage := . }}
{{ $menu := .Site.Menus.docs.ByWeight }}
<ul class="list dib ph0 ma0 scrolling-touch tc">
{{ range $menu }}{{ $post := printf "%s" .Post }}
<li class="tl dib ma0 hover-bg-black w-100{{ if eq $post "break" }} mb2 bb b--mid-gray{{ end }}">
<a href="{{.URL}}" class="ttu f6 link primary-color-light hover-white db brand-font mb1 ma0 w-100 pv2 ph4{{if $currentPage.IsMenuCurrent "main" . }} bg-primary-color{{end}}">
{{ .Name }}
</a>
</li>
{{end}}
</ul>
@@ -0,0 +1,23 @@
{{ $currentPage := . }}
<nav role="navigation">
<ul class="list pa0 nl2">
{{ range .Site.Menus.docs.ByWeight }}
{{ $post := printf "%s" .Post }}
<li class="f5 w-100 hover-bg-light-gray hover-accent-color-light fw8{{ if eq $post "break" }} mb1 bb b--moon-gray{{ end }}">
<a href="{{ if .HasChildren }}javascript:void(0){{ else }}{{ .URL }}{{ end }}" class="js-toggle dib w-100 link mid-gray hover-accent-color-light pl2 pr2 pv2 {{if or ($currentPage.IsMenuCurrent "docs" .) ($currentPage.HasMenuCurrent "docs" .) }} primary-color{{end}}" data-target=".{{ .Name | urlize }}">{{ .Name }}</a>
{{ if .HasChildren }}
<ul class="{{ .Name | urlize }} desktopmenu animated fadeIn list pl0 bg-light-gray{{if $currentPage.HasMenuCurrent "docs" . }} db{{ else }} dn{{ end }}">
{{ range .Children }}
<li class="f6 fw4">
<a href="{{.URL}}" class="db link hover-bg-gray hover-white pl3 pr2 pv2 {{if $currentPage.IsMenuCurrent "docs" . }}primary-color {{ else }}black {{end}}">
{{ .Name }}
</a>
</li>
{{ end }}
</ul>
{{end}}
</li>
{{end}}
</ul>
</nav>
@@ -0,0 +1,11 @@
{{ $currentPage := . }}
{{ $menu := .Site.Menus.global }}
<ul class="list hidden dib ph0 ma0 scrolling-touch tc">
{{ range $menu }}
<li class="tl dib ma0 hover-bg-black w-100">
<a href="{{.URL}}" class="ttu f6 link primary-color-light overflow hover-white db brand-font ma0 w-100 pv3 ph4{{if $currentPage.IsMenuCurrent "main" . }} bg-primary-color{{end}}">
{{ .Name }}
</a>
</li>
{{end}}
</ul>
+37
View File
@@ -0,0 +1,37 @@
{{ $currentPage := . }}
{{ $.Scratch.Add "listlinkClasses" "f6 link primary-color-dark hover-white db brand-font ma0 w-100 pv3 ph4" }}
<!-- TODO: Not getting ismenucurrent -->
<ul class="list dib ph0 ma0 scrolling-touch tc">
{{ range .Site.Menus.main }}
<li class="tl-l dib ma0 hover-bg-black w-100{{ if .HasChildren }} dont-display-child-until-click{{end}}">
{{ if .HasChildren }}
<a href="#{{ .Name | urlize }}" class="ttu {{ $.Scratch.Get "listlinkClasses" }}{{if $currentPage.IsMenuCurrent "main" . }} o-50{{end}}">
{{ .Name }}
<!-- <img src="/images/ic_keyboard_arrow_down_white_24px.svg" alt="" class="static v-mid f6 ma0 pa0"> -->
</a>
<ul id="{{ .Name | urlize}}" class="list pa0 ma0">
<li class="ma0 pl3 brand-font">
<a href="{{.URL}}" class="{{ $.Scratch.Get "listlinkClasses" }}{{if $currentPage.IsMenuCurrent "main" . }} o-50{{end}}">
{{ .Name }} Overview
</a>
</li>
{{ range .Children }}
<li class="ma0 pl3 brand-font{{if $currentPage.IsMenuCurrent "main" . }} o-50{{end}}">
<a href="{{.URL}}" class="{{ $.Scratch.Get "listlinkClasses" }}">
{{ .Name }}
</a>
</li>
{{ end }}
</ul>
{{ else }}
<a href="{{.URL}}" class="ttu {{ $.Scratch.Get "listlinkClasses" }}{{if $currentPage.IsMenuCurrent "main" . }} bg-primary-color{{end}}">
{{ .Name }}
</a>
{{end}}
</li>
{{end}}
</ul>
@@ -0,0 +1,12 @@
<div class="globalmenu mobilemenu pb3 dn">
{{ partial "nav-links-global-mobile.html" . }}
</div>
<div class="docsmenu mobilemenu pb3 dn">
{{ 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>
<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>
</div>
+16
View File
@@ -0,0 +1,16 @@
{{ $currentPage := . }}
<header class="dn-lTK relative cf bg-primary-color-dark pl4 w-100 z-5">
<div class="flexTK items-centerTK dib ">
<a class="absolute top-0 left-0 ml4 w4 w4-ns ph3 mr3" href="/">
<img src="{{ .Site.Params.logo }}" alt="" class="w-100 shadow-2">
</a>
<a class="f4 f3-ns lh-solid brand-font fw7 link white hover-white no-underline dib mv0 ml6 pl3 mr5" href="/">
{{ .Site.Title | markdownify }}
</a>
</div>
{{ partial "nav-links" .}}
<div class="dn-l">
{{ partial "nav-button-open" .}}
</div>
</header>
+3
View File
@@ -0,0 +1,3 @@
<a href="{{.Site.Params.ghrepo}}edit/master/content/{{.File.Path}}" class="
f6 ph3 pv1 br2 dib tc ttu mv3 bg-primary-color white hover-bg-green link
">Improve this page</a>
@@ -0,0 +1,20 @@
{{ $currentPage := . }}
{{ $currentURL := .URL }}
<header class="ph4 flex pv4 bg-light-gray">
<ul class="list ma0 pa0 ">
<!-- TODO: Active classes -->
<li class="f5 dib mr3 mb3 mb0-ns v-top white">
<a href="/news/" class="link primary-color-dark dim">
News:
</a>
</li>
{{ range $name, $taxonomy := .Site.Taxonomies.categories }}
{{ $link := $name | printf "%s%s" "/categories/" | printf "%s/" }}
<li class="f5 dib mr3 v-top mr3 mb3 mb0-ns">
<a href="{{ $link }}" class="link {{ if eq $currentURL $link }} bg-primary-color-dark {{ else }} bg-primary-color-dark {{ end }} white ph3 pv1 br2 hover-bg-accent-color-light">
{{ $name | humanize }}
</a>
</li>
{{ end }}
</ul>
</header>
@@ -0,0 +1,34 @@
{{ $section_to_display := .section_to_display }}
<div class="w-100 ph4 pb5 pb6-ns pt1 mt4 pt3-ns">
<div class="flex">
<div class="dn db-l w-20">
{{ partial "nav-links-docs.html" .context }}
</div>
<div class="w-100 w-80-l ph0 ph4-l">
<article class="w-100 nested-copy-line-height nested-links nested-img">
<h1 class="primary-color-dark f2">
{{ with $.context.Data.Singular }}{{ . | humanize }}: {{ end }}{{ .context.Title }}
</h1>
<div class="{{ .Site.Params.copyClass }} mid-gray f5 f4-l">
{{ .context.Content }}
</div>
</article>
<!-- TODO: May be a good idea in this case to add monthly archives -->
<div class="flex flex-wrap">
{{ $interior_classes := .context.Site.Params.flex_box_interior_classes }}
<section class="flex-ns flex-wrap justify-between w-100">
{{ range $section_to_display }}
{{ partial "boxes-section-summaries" (dict "context" . "classes" $interior_classes "fullcontent" true) }}
{{ end }}
</section>
</div>
</div>
</div>
</div>
@@ -0,0 +1,16 @@
{{ if or .PrevInSection .NextInSection }}
{{/* this div holds these a tags as a unit for flex-box display */}}
<div date-pref>
{{if .NextInSection}}
<a href="{{.NextInSection.Permalink }}" class="dib f6 pl1 hover-bg-light-gray br-100" title="{{ .NextInSection.Title }} ">
{{ partial "svg/ic_chevron_left_black_24px.svg" (dict "fill" "#0594CB" "size" "30px") }}
</a>
{{end}}
{{if .PrevInSection}}
<a href="{{ .PrevInSection.Permalink }}" class="dib f6 pr1 hover-bg-light-gray br-100" title="{{ .PrevInSection.Title }}">
{{ partial "svg/ic_chevron_right_black_24px.svg" (dict "fill" "#0594CB" "size" "30px") }}
</a>
{{end}}
</div>
{{ end }}
@@ -0,0 +1,25 @@
{{if .Prev }}
<a href="{{ .Prev.Permalink }}" class="db-l f4 f3-ns link primary-color hover-black fw8">
<span class="v-mid dib">{{ partial "svg/ic_chevron_left_black_24px.svg" (dict "size" "30px") }}</span> {{ .Prev.Title }}
</a>
{{end}}
{{if .Next }}
<a href="{{.Next.Permalink }}" class="db-l f4 f3-ns link primary-color hover-black fw8">
{{ .Next.Title }} <span class="v-mid dib">{{ partial "svg/ic_chevron_right_black_24px.svg" (dict "size" "30px") }}</span>
</a>
{{end}}
<script>
document.body.onkeyup = function(e){
{{ if .Prev }}
if (e.keyCode == '37') { window.location = '{{ .Prev.Permalink }}'; }
{{ end }}
{{ if .Next }}
if (e.keyCode == '39') { window.location = '{{.Next.Permalink }}'; }
{{ end }}
};
</script>
+40
View File
@@ -0,0 +1,40 @@
<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">
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>
{{ 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>
{{- 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>
<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>
{{ partial "nav-mobile.html" . }}
</footer>
+36
View File
@@ -0,0 +1,36 @@
{{ $currentPage := . }}
<nav class="bg-primary-color-dark pv4 w-100" role="navigation">
<div class="center flex-ns flex-wrap items-center justify-start mw9">
<h1 class="dim f3 lh-solid ml0-ns mr0 mr4-l mv0 pl3 pl4-ns">
<a href="{{ .Site.BaseURL }}" class="link white">
HUGO
</a>
</h1>
<ul class="list ma0 pa0 dn dib-l">
{{ range .Site.Menus.global }}
<li class="f5 dib mr4" role="menuitem">
{{/* TODO: Create an "Global" active class to show which site one is currently at */}}
<a href="{{ .URL }}" class="dim link{{ if $currentPage.IsMenuCurrent "global" . }} gray {{else}} light-silver{{ end }}">
{{ .Name }}
{{/* using ".Post" from the menu system to determine if we should show an icon for external links */}}
{{ $post_status := printf "%s" .Post }}
{{ if eq $post_status "external" }}
{{ partial "svg/link-ext.svg" (dict "size" "10") }}
{{ end }}
</a>
</li>
{{ end }}
</ul>
<div class="db dib-ns pl3">
{{- partial "site-search.html" . -}}
</div>
<span class="absolute mt1 mt2-l pr3 right-0 top-0">
{{- partial "social-follow.html" . -}}
</span>
</div>
</nav>

Some files were not shown because too many files have changed in this diff Show More