mirror of
https://github.com/gohugoio/hugo.git
synced 2026-09-01 11:12:37 +00:00
Compare commits
51 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 01fdf6d26c | |||
| 828eb70fa6 | |||
| f4ea433984 | |||
| 457048634f | |||
| 58245a29df | |||
| 1b4319be62 | |||
| d2249c5099 | |||
| f4bf214137 | |||
| 0462c96a5a | |||
| 202510fdc9 | |||
| 573deca089 | |||
| eeb057f222 | |||
| 3b4f17bbc9 | |||
| 7d63a23b0c | |||
| 16c9127663 | |||
| f88fe312cb | |||
| d33563b5d7 | |||
| fc4a0d1704 | |||
| 7231d5a829 | |||
| 88e1bca92c | |||
| d000cf6050 | |||
| 29a2da0593 | |||
| 7674ad7382 | |||
| 08f48b91d6 | |||
| 2fc121ce23 | |||
| 2a2e690707 | |||
| a7555c5431 | |||
| c265c102ae | |||
| f0f49ed9b0 | |||
| 71ae9b4533 | |||
| 199816fddd | |||
| 919bc9210a | |||
| 07f6e1499c | |||
| e8468a9852 | |||
| 359af563a1 | |||
| 0019ce0024 | |||
| 33ae10b6ad | |||
| 2d1bd876cd | |||
| ec4e6f9df2 | |||
| a1900826b9 | |||
| d384c661fe | |||
| 9a2eb0f1d3 | |||
| 0373e43102 | |||
| ea2cc26b39 | |||
| 0f9f73cce5 | |||
| c8257f8b72 | |||
| 0abdeeef67 | |||
| e2f8664ef4 | |||
| 46ac745374 | |||
| 4b54fb0701 | |||
| 40d7d3baa8 |
@@ -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
|
||||
@@ -1,3 +0,0 @@
|
||||
[submodule "themes/gohugoioTheme"]
|
||||
path = docs/themes/gohugoioTheme
|
||||
url = https://github.com/gohugoio/gohugoioTheme.git
|
||||
+2
-2
@@ -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
|
||||
|
||||
@@ -67,18 +67,11 @@ To update Hugo’s 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).
|
||||
|
||||
@@ -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
@@ -347,7 +347,7 @@ description = ""
|
||||
homepage = "http://example.com/"
|
||||
tags = []
|
||||
features = []
|
||||
min_version = "0.26"
|
||||
min_version = "0.27"
|
||||
|
||||
[author]
|
||||
name = ""
|
||||
|
||||
+1
-4
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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}
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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 }}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
[submodule "themes/gohugoioTheme"]
|
||||
path = themes/gohugoioTheme
|
||||
url = https://github.com/gohugoio/gohugoioTheme.git
|
||||
|
||||
+2
-7
@@ -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
@@ -52,7 +52,7 @@ twitter = "GoHugoIO"
|
||||
[params]
|
||||
description = "The world’s 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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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/
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
```
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -31,35 +31,3 @@ There are 6 basic mathematical operators that can be used in Hugo templates:
|
||||
| `mul` | Multiplies two integers. | `{{mul 2 3}}` → 6 |
|
||||
| `sub` | Subtracts two integers. | `{{sub 3 2}}` → 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
|
||||
@@ -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/
|
||||
|
||||
@@ -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>cd example.com
|
||||
C:\Hugo\Sites\example.com>dir
|
||||
Directory of C:\hugo\sites\example.com
|
||||
|
||||
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 you’ve placed in your `PATH`.
|
||||
Upgrading Hugo is as easy as downloading and replacing the executable you’ve 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
|
||||
---
|
||||
|
||||

|
||||
|
||||
## 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
|
||||
```
|
||||
|
||||

|
||||
|
||||
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
|
||||
```
|
||||
|
||||

|
||||
|
||||
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.
|
||||
|
||||

|
||||
|
||||
### 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:
|
||||
|
||||

|
||||
|
||||
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:.
|
||||
|
||||

|
||||
|
||||
@@ -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`:
|
||||
|
||||
|
||||
|
||||
@@ -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 -}}
|
||||
|
||||
@@ -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 – (`–`), whereas `---` is translated into — (`—`). <br>
|
||||
However, *spaced* single hyphen between two words is translated into an en dash— 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 dash— e.g., "`12 June - 3 July`" becomes `12 June – 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
|
||||
|
||||
@@ -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`
|
||||
|
||||
|
||||
@@ -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/
|
||||
|
||||
@@ -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
|
||||
```
|
||||
|
||||
@@ -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/
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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/"
|
||||
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
git subtree pull --prefix=themes/gohugoioTheme/ git@github.com:gohugoio/gohugoioTheme.git master --squash
|
||||
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 68 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 121 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
Vendored
BIN
Binary file not shown.
|
After Width: | Height: | Size: 66 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 119 KiB |
Vendored
-1
Submodule docs/themes/gohugoioTheme deleted from ce4449747b
@@ -0,0 +1,4 @@
|
||||
src/node_modules
|
||||
node_modules
|
||||
.DS_Store
|
||||
*.log
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
Theme for gohugo.io sites. More info to come.
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
---
|
||||
linktitle: ""
|
||||
description: ""
|
||||
godocref: ""
|
||||
publishdate: ""
|
||||
lastmod: ""
|
||||
categories: []
|
||||
tags: []
|
||||
weight: 00
|
||||
slug: ""
|
||||
aliases: []
|
||||
toc: false
|
||||
---
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
linktitle: ""
|
||||
description: ""
|
||||
godocref: ""
|
||||
publishdate: ""
|
||||
lastmod: ""
|
||||
categories: [functions]
|
||||
tags: []
|
||||
ns: ""
|
||||
signature: []
|
||||
workson: []
|
||||
hugoversion: ""
|
||||
aliases: []
|
||||
relatedfuncs: []
|
||||
toc: false
|
||||
deprecated: false
|
||||
---
|
||||
@@ -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"
|
||||
---
|
||||
@@ -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
@@ -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
@@ -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
@@ -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 }}
|
||||
@@ -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
@@ -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 }}
|
||||
@@ -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"> ↗</span>
|
||||
</a>
|
||||
</h2>
|
||||
{{ range $value.Pages }}
|
||||
<h3>
|
||||
<a href="{{ .Permalink }}" class="link blue">
|
||||
{{ .Title }}
|
||||
</a>
|
||||
</h3>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
{{ end }}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
{{ end }}
|
||||
@@ -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
@@ -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 }}
|
||||
@@ -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 -}}
|
||||
@@ -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 }}
|
||||
@@ -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 »
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
+18
@@ -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>
|
||||
+33
@@ -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 }}
|
||||
+21
@@ -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>
|
||||
@@ -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>
|
||||
+34
@@ -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>
|
||||
+32
@@ -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 }}
|
||||
+39
@@ -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>
|
||||
+59
@@ -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">─ {{ .name }} ({{ .twitter_handle }}) <a href="{{ .link }}">
|
||||
{{ dateFormat "January 2, 2006" .date }}</a>
|
||||
</cite>
|
||||
</blockquote>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
+1
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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>
|
||||
+16
@@ -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
@@ -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
@@ -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
Reference in New Issue
Block a user