Update filenames and sections for shorter URL structure
@@ -22,7 +22,7 @@ Hugo and other static site generators take caching a step further. All HTML file
|
||||
|
||||
Not running a website generator on your HTTP server has many benefits. The most noticeable is performance---HTTP servers are very good at sending files. So good that you can effectively serve the same number of pages with a fraction of the memory and CPU needed for a dynamic site.
|
||||
|
||||
## Resources on Static Site Generators
|
||||
## More Information on the Benefits of Static Site Generators
|
||||
|
||||
* ["An Introduction to Static Site Generators", David Walsh][]
|
||||
* ["Static Site Generators", O-Reilly][]
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Hugo Features
|
||||
linktitle:
|
||||
description: In addition to blistering speed, Hugo also includes a powerful templating language that makes it appropriate for websites of all sizes and types.
|
||||
linktitle: Hugo Features
|
||||
description: In addition to blistering speed, Hugo also includes robust content management features and a powerful templating language that make it appropriate for websites of all sizes and types.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
@@ -54,7 +54,7 @@ notesforauthors:
|
||||
See what's coming next in the [Hugo roadmap][].
|
||||
|
||||
[Ace]: /templates/ace-templating/
|
||||
[aliases]: /content-management/url-management/#aliases
|
||||
[aliases]: /content-management/urls/#aliases
|
||||
[Amber]: https://github.com/eknkc/amber
|
||||
[content summaries]: /content-management/content-summaries/
|
||||
[content types]: /content-management/content-types/
|
||||
@@ -73,16 +73,16 @@ See what's coming next in the [Hugo roadmap][].
|
||||
[Mac OSX]: /getting-started/install-of-pc/
|
||||
[organization for your projects]: /getting-started/directory-structure/
|
||||
[pagevars]: /variables/page-variables/
|
||||
[Permalink]: /content-management/url-management/#permalinks
|
||||
[Permalink]: /content-management/urls/#permalinks
|
||||
[Powerful theming]: /themes/
|
||||
[Pretty URLs]: /content-management/url-management/
|
||||
[Pretty URLs]: /content-management/urls/
|
||||
[Pygments]: http://pygments.org/
|
||||
[RSS]: /templates/rss-templates/
|
||||
[Shortcodes]: /content-management/shortcodes/
|
||||
[sort content]: /templates/
|
||||
[supported formats]: /content-management/supported-content-formats/
|
||||
[supported formats]: /content-management/formats/
|
||||
[Syntax highlighting]: /developer-tools/syntax-highlighting/
|
||||
[table of contents]: /content-management/table-of-contents/
|
||||
[taxonomies]: /content-management/taxonomies/
|
||||
[URLs]: /content-management/url-management/
|
||||
[URLs]: /content-management/urls/
|
||||
[Windows]: /getting-started/install-on-linux/
|
||||
@@ -5,13 +5,12 @@ description: Take a look at what's in the pipeline for future versions of the Hu
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
tags: []
|
||||
categories: [about hugo]
|
||||
tags: [about,contribute,roadmap]
|
||||
weight: 50
|
||||
draft: false
|
||||
slug:
|
||||
aliases: [/meta/roadmap]
|
||||
toc: false
|
||||
notesforauthors:
|
||||
---
|
||||
|
||||
In no particular order, here is what is currently being worked on for the Hugo project:
|
||||
@@ -33,8 +32,8 @@ Feel free to [contribute to Hugo's development][devcontribute], [improve Hugo's
|
||||
[#1014]: https://github.com/spf13/hugo/issues/1014
|
||||
[#1435]: https://github.com/spf13/hugo/issues/1435
|
||||
[#1436]: https://github.com/spf13/hugo/issues/1436
|
||||
[devcontribute]: /contribute/contribute-to-hugo-development/
|
||||
[doccontribute]: /contribute/contribute-to-the-hugo-docs/
|
||||
[devcontribute]: /contribute/development/
|
||||
[doccontribute]: /contribute/documentation/
|
||||
[hosting and deployment]: /hosting-and-deployment/
|
||||
[migrate]: /developer-tools/migrate-to-hugo/
|
||||
[newissue]: https://github.com/spf13/hugo/issues/
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: What is Hugo
|
||||
linktitle: What is Hugo
|
||||
description: Hugo is the world's fastest static site generator. The purpose of Hugo is to make making websites fun again.
|
||||
description: Hugo is the world's fastest static site generator, a powerful templating engine written in Golang, and an enthusiastic community of open-source developers. Most importantly, Hugo is here so that making websites can be fun again.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
@@ -51,5 +51,5 @@ Hugo is for people building a blog, a company site, a portfolio site, documentat
|
||||
[Middleman]: https://middlemanapp.com/
|
||||
[Nanoc]: http://nanoc.ws/
|
||||
[rackspace]: https://www.rackspace.com/cloud/files
|
||||
[static site generator]: /about-hugo/benefits-of-static/
|
||||
[static site generator]: /about-hugo/benefits/
|
||||
[Surge]: https://surge.sh
|
||||
@@ -89,7 +89,7 @@ The SSG developer has
|
||||
The themes end user has
|
||||
|
||||
* limited proficiency in the command line/prompt
|
||||
* proficiency in one of the [supported content formats](https://hugodocsconcept.netlify.com/content-management/supported-content-formats/)(specifically markdown)
|
||||
* proficiency in one of the [supported content formats](https://hugodocsconcept.netlify.com/content-management/formats/)(specifically markdown)
|
||||
* access to static hosting;
|
||||
* limited proficiency in deploying a static website
|
||||
|
||||
@@ -126,7 +126,7 @@ The following are high-level requirements for the documentation site.
|
||||
|
||||
- [ ] Basic style guide
|
||||
- The style guide should facilitate a more consistent UX for the site but not be so complex as to deter documentation contributors
|
||||
- [X] Contribution guidelines (see [WIP on live site](https://hugodocsconcept.netlify.com/contribute/contribute-to-the-hugo-docs/))
|
||||
- [X] Contribution guidelines (see [WIP on live site](https://hugodocsconcept.netlify.com/contribute/documentation/))
|
||||
- [X] Standardized content types (see [WIP archetypes in source](https://github.com/rdwatters/hugo-docs-concept/tree/master/themes/hugodocs/archetypes)
|
||||
- [X] New content model, including taxonomies ([see tags page][tagspage])
|
||||
- [ ] DRY. New shortcodes for repeat content (e.g., lists of aliases, page variables, site variables, and others)
|
||||
@@ -150,7 +150,7 @@ The following are high-level requirements for the documentation site.
|
||||
- [X] Copyable code blocks (via highlight.js, extended for hugo-specific keywords)
|
||||
- [X] Dual in-page navigation (i.e. site nav *and* in-page TOC)
|
||||
- [X] Smooth scrolling
|
||||
- [X] [RTD-style admonitions][admonitions] (see [example admonition shortcode](https://github.com/rdwatters/hugo-docs-concept/blob/master/layouts/shortcodes/note.html) and [examples on published site](/contribute/contribute-to-the-hugo-docs/#admonition-short-codes))
|
||||
- [X] [RTD-style admonitions][admonitions] (see [example admonition shortcode](https://github.com/rdwatters/hugo-docs-concept/blob/master/layouts/shortcodes/note.html) and [examples on published site](/contribute/documentation/#admonition-short-codes))
|
||||
- [ ] Share buttons: Reddit, Twitter, LinkedIn, and "Copy Page Url"; the last of these provides the strongest utility for docs references in the Hugo forums
|
||||
|
||||
## Author Experience (AX)
|
||||
@@ -195,7 +195,7 @@ This is no longer a site navigation link and is instead a button along with "Fil
|
||||
|
||||
### Site Showcase
|
||||
|
||||
* Site showcase has stayed more or less as is, including styling, etc. However, I did clean up the templating and all currently submitted showcase files. (E.g., changing "thumbnail" to "image" and not requiring a full path.) This will also be updated in the ["docs" page of the contribute section](/contribute/contribute-to-the-hugo-docs/)
|
||||
* Site showcase has stayed more or less as is, including styling, etc. However, I did clean up the templating and all currently submitted showcase files. (E.g., changing "thumbnail" to "image" and not requiring a full path.) This will also be updated in the ["docs" page of the contribute section](/contribute/documentation/)
|
||||
|
||||
### Press & Articles
|
||||
|
||||
@@ -228,7 +228,7 @@ This is no longer a site navigation link and is instead a button along with "Fil
|
||||
* This section no longer exists in the new documentation site
|
||||
* *Extras*, in the content world, is the equivalent of *miscellaneous* or *additional resources*. It's an area that's been tacked onto site navigation to accommodate a *seemingly* disparate set of new features. In other words, READ: "We don't have any idea of where to put this"
|
||||
* *Extras* pages:
|
||||
* **Aliases** Incorporated into [URL Management](/content-management/url-management/)
|
||||
* **Aliases** Incorporated into [URL Management](/content-management/urls/)
|
||||
* **Analytics** Incorporated into [built-in partials](/templates/partials/#using-hugos-built-in-partials)
|
||||
* **Builders** This has been removed completely since it has no real added value. The three "builders" mentioned (`new site`, `new theme`, and `new <content>`) are all well-delimited in their respective pages, which is where end users expect to find this type of information in the first place.
|
||||
* **Comments** Incorporated into [content management](/content-management/comments/) for content-related pieces and mentioned in [partials](/templates/partials/) for implementation.
|
||||
@@ -375,7 +375,7 @@ Apache License - 60
|
||||
2. **2017-03-01** Post in Discussion Forum for Feedback
|
||||
3. **2017-??-??** Add to Hugo repo for release with v19
|
||||
|
||||
[^1]: As this point, the URL structure has changed considerably. I've been fastidious about adding aliases wherever possible, but I'm not sure what negative effect this approach is going to take with our current search relevancy. The [current list of aliases is quite large](/contribute/contribute-to-the-hugo-docs/#be-mindful-of-aliases).
|
||||
[^1]: As this point, the URL structure has changed considerably. I've been fastidious about adding aliases wherever possible, but I'm not sure what negative effect this approach is going to take with our current search relevancy. The [current list of aliases is quite large](/contribute/documentation/#be-mindful-of-aliases).
|
||||
|
||||
|
||||
[admonitions]: http://docutils.sourceforge.net/docs/ref/rst/directives.html#admonitions
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Content Summaries
|
||||
linktitle:
|
||||
description:
|
||||
description: Hugo can generate summaries of your content to show snippets in summary views. You have the option to split these summaries yourself or let Hugo automatically generate them for you.
|
||||
date: 2017-01-10
|
||||
publishdate: 2017-01-10
|
||||
lastmod: 2017-01-10
|
||||
@@ -13,7 +13,7 @@ aliases: [/content/summaries/,/content-management/summaries]
|
||||
toc: true
|
||||
---
|
||||
|
||||
With the use of the `.Summary` [page variable][pagevariables], Hugo can generate summaries of content to show snippets in summary views. The summary view snippets are automatically generated by Hugo.
|
||||
With the use of the `.Summary` [page variable][pagevariables], Hugo can generate summaries of content to show snippets in summary views. The summary view snippets are automatically generated by Hugo and offer two splitting options.
|
||||
|
||||
## Summary Splitting Options
|
||||
|
||||
@@ -70,6 +70,6 @@ You can show content summaries with the following code. You could use the follow
|
||||
|
||||
Note how the `.Truncated` boolean valuable may be used to hide the "Read More..." link when the content is not truncated; i.e., when the summary contains the entire article.
|
||||
|
||||
[org]: /content-management/supported-content-formats/
|
||||
[org]: /content-management/formats/
|
||||
[pagevariables]: /variables/page-variables/
|
||||
[section template]: /templates/section-templates/
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Supported Content Formats
|
||||
linktitle: Content Formats
|
||||
description: Hugo uses the Blackfriday markdown parser for content files but also provides support for additional syntaxes (eg, Asciidoc) via external helpers.
|
||||
description: Markdown is natively supported in Hugo and is parsed by the feature-rich and incredibly speed Blackfriday parse. Hugo also provides support for additional syntaxes (eg, Asciidoc) via external helpers.
|
||||
date: 2017-01-10
|
||||
publishdate: 2017-01-10
|
||||
lastmod: 2017-01-10
|
||||
@@ -19,7 +19,7 @@ notesforauthors:
|
||||
Markdown is the native content format for Hugo and is rendered using the excellent [Blackfriday project][], a blazingly fast parser written in Golang.
|
||||
|
||||
{{% note "Deeply Nested Lists" %}}
|
||||
Blackfriday has a known issue [(#329)](https://github.com/russross/blackfriday/issues/329) with handling deeply nested lists. Luckily, there is a workaround. Use 4-spaces (i.e., <kbd>tab</kbd>) rather than 2-space indentations to delimit nesting of lists.
|
||||
Before you begin writing your content in markdown, Blackfriday has a known issue [(#329)](https://github.com/russross/blackfriday/issues/329) with handling deeply nested lists. Luckily, there is an easy workaround. Use 4-spaces (i.e., <kbd>tab</kbd>) rather than 2-space indentations to delimit nesting of lists in your content.
|
||||
{{% /note %}}
|
||||
|
||||
## Additional Content Formats
|
||||
@@ -100,7 +100,7 @@ There are a few predefined variables that Hugo is aware of and utilizes. The use
|
||||
* **url** The full path to the content from the web root. It makes no assumptions about the path of the content file. It also ignores any language prefixes of the multilingual feature.
|
||||
|
||||
{{% note "Hugo's Default URLs" %}}
|
||||
If neither `slug` nor `url` is present, and [permalinks are not configured otherwise](/content-management/url-management/#permalinks), the filename will be used to create the URL for a page.
|
||||
If neither `slug` nor `url` is present, and [permalinks are not configured otherwise](/content-management/urls/#permalinks), the filename will be used to create the URL for a page.
|
||||
{{% /note %}}
|
||||
|
||||
## Override Global Blackfriday Configuration
|
||||
@@ -123,7 +123,7 @@ See [site configuration][] for more information on setting up global Blackfriday
|
||||
* [YAML Spec][]
|
||||
* [JSON Spec][]
|
||||
|
||||
[aliases]: /content-management/url-management/#aliases/
|
||||
[aliases]: /content-management/urls/#aliases/
|
||||
[content type]: /content-management/content-types/
|
||||
[site configuration]: /project-organization/configuration/ "Hugo documentation for site configuration"
|
||||
[JSON Spec]: /documents/ecma-404-json-spec.pdf "Specification for JSON, JavaScript Object Notation"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Menus
|
||||
linktitle: Menus
|
||||
description:
|
||||
description: Hugo's simple yet powerful menu system allows you to add content to menus with a high level of control and low level of effort.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
@@ -14,7 +14,7 @@ toc: true
|
||||
needsreview: true
|
||||
---
|
||||
|
||||
Hugo has a simple yet powerful menu system that allows you to add content to menus with a high degree of control and a very low amount of effort on the part of content authors.
|
||||
Hugo's simple yet powerful menu system allows you to add content to menus with a high degree of control and a very low amount of effort on the part of content authors.
|
||||
|
||||
{{% note "Lazy Blogger"%}}
|
||||
If all you want is a simple menu for your sections, see the ["Section Menu for Lazy Bloggers" in Menu Templates](/templates/menu-templates/#section-menu-for-lazy-blogger).
|
||||
@@ -32,7 +32,7 @@ Hugo's robust menu features allow you to do the following:
|
||||
A **menu** is a named array of menu entries accessible by name via the [`.Site.Menus` site variable][sitevars]. For example, you can access your site's `main` menu via `.Site.Menus.main`.
|
||||
|
||||
{{% note "Menus on Multilingual Sites" %}}
|
||||
If you make use of the [multilingual feature](/content-management/multilingual-mode/), you can define language-independent menus.
|
||||
If you make use of the [multilingual feature](/content-management/multilingual/), you can define language-independent menus.
|
||||
{{% /note %}}
|
||||
|
||||
A menu entry has the following properties (i.e., variables) available to it:
|
||||
@@ -141,5 +141,5 @@ In this example, the top level of the menu is defined in your [site `config` fil
|
||||
See [Menu Templates](/templates/menu-templates/) for information on how to render your site menus.
|
||||
|
||||
[config]: /getting-started/configuration/
|
||||
[multilingual]: /content-management/multilingual-mode/
|
||||
[multilingual]: /content-management/multilingual/
|
||||
[sitevars]: /variables/
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Multilingual Mode
|
||||
linktitle:
|
||||
description:
|
||||
description: As of v0.17, Hugo supports the creation of websites with multiple languages side by side.
|
||||
date: 2017-01-10
|
||||
publishdate: 2017-01-10
|
||||
lastmod: 2017-01-10
|
||||
@@ -12,7 +12,6 @@ draft: false
|
||||
aliases: [/content/multilingual/,/content-management/multilingual/]
|
||||
toc: true
|
||||
needsreview: true
|
||||
notesforauthors:
|
||||
---
|
||||
|
||||
Hugo supports multiple languages side-by-side (added in `Hugo 0.17`). Define the available languages in a `Languages` section in your top-level `config.toml` (or equivalent).
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Content Organization
|
||||
linktitle: Content Organization
|
||||
description: Hugo assumes that the same structure that works to organize your source content is used to organize the rendered site, but
|
||||
description: Hugo assumes that the same structure that works to organize your source content is used to organize the rendered site.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
@@ -252,5 +252,5 @@ Hugo themes are designed to use the 'content' directory as the root of the websi
|
||||
|
||||
[front matter]: /content-management/front-matter/
|
||||
[section]: /content-management/section/
|
||||
[supported content formats]: /content-management/supported-content-formats/
|
||||
[URL management]: /content-management/url-management/
|
||||
[supported content formats]: /content-management/formats/
|
||||
[URL management]: /content-management/urls/
|
||||
@@ -397,7 +397,7 @@ Using the preceding `youtube` example (without `autoplay="true"`), the following
|
||||
|
||||
To learn more about creating your own shortcode templates, see the [shortcode template documentation][].
|
||||
|
||||
[contentmanagementsection]: /content-management/supported-content-formats/
|
||||
[contentmanagementsection]: /content-management/formats/
|
||||
[examplegist]: https://gist.github.com/spf13/7896402
|
||||
[figureelement]: http://html5doctor.com/the-figure-figcaption-elements/ "An article from HTML5 doctor discussing the fig and figcaption elements."
|
||||
[`figure` shortcode]: #figure
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Table of Contents
|
||||
linktitle:
|
||||
description:
|
||||
description: Hugo can automatically parse Markdown content and create a Table of Contents you can leverage in your templates to guide readers to sections of longer pages.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
@@ -9,23 +9,40 @@ categories: [content management]
|
||||
tags: [table of contents, toc]
|
||||
weight: 130
|
||||
draft: false
|
||||
aliases: [/extras/toc/]
|
||||
aliases: [/extras/toc/,/content-management/toc/]
|
||||
toc: false
|
||||
needsreview: true
|
||||
---
|
||||
|
||||
Hugo will automatically parse the Markdown for your content and create
|
||||
a Table of Contents you can use to guide readers to the sections within
|
||||
your content.
|
||||
Hugo can automatically parse Markdown content and create a Table of Contents you can leverage in your templates to guide readers to sections of longer pages.
|
||||
|
||||
{{% note "TOC Heading Levels are Fixed" %}}
|
||||
Currently, the {{.TableOfContents}} [page variable](/variables/page-variables/) is fixed in its behavior; i.e., you do not have the option to set the heading level at which the TOC renders. This is a [known issue (#1778)](https://github.com/spf13/hugo/issues/1778), and as always, [contributions are welcome](/contribute/development/).
|
||||
{{% /note %}}
|
||||
|
||||
## Usage
|
||||
|
||||
Simply create content like you normally would with the appropriate headers.
|
||||
Create your markdown the way you normally would with the appropriate headers. Here is some example content:
|
||||
|
||||
Hugo will take this Markdown and create a table of contents stored in the [content variable](/variables/page-variables/) `.TableOfContents`.
|
||||
```md
|
||||
<!-- Your front matter up here -->
|
||||
|
||||
## Introduction
|
||||
|
||||
One morning, when Gregor Samsa woke from troubled dreams, he found himself transformed in his bed into a horrible vermin.
|
||||
|
||||
## My Heading
|
||||
|
||||
He lay on his armour-like back, and if he lifted his head a little he could see his brown belly, slightly domed and divided by arches into stiff sections. The bedding was hardly able to cover it and seemed ready to slide off any moment.
|
||||
|
||||
His many legs, pitifully thin compared with the size of the rest of him, waved about helplessly as he looked. "What's happened to me? " he thought. It wasn't a dream. His room, a proper human room although a little too small, lay peacefully between its four familiar walls.
|
||||
|
||||
### My Subheading
|
||||
|
||||
A collection of textile samples lay spread out on the table - Samsa was a travelling salesman - and above it there hung a picture that he had recently cut out of an illustrated magazine and housed in a nice, gilded frame. It showed a lady fitted out with a fur hat and fur boa who sat upright, raising a heavy fur muff that covered the whole of her lower arm towards the viewer. Gregor then turned to look out the window at the dull weather. Drops
|
||||
```
|
||||
|
||||
Hugo will take this Markdown and create a table of contents from `## Introuduction`, `## My Heading`, and `### My Subheading`stored in the [content variable](/variables/page-variables/) `.TableOfContents`.
|
||||
|
||||
## Template Example
|
||||
|
||||
@@ -33,9 +50,9 @@ This is example code of a [single.html template](/templates/single-page-template
|
||||
|
||||
```golang
|
||||
{{ partial "header.html" . }}
|
||||
<div id="toc" class="well col-md-4 col-sm-6">
|
||||
<aside id="toc" class="well col-md-4 col-sm-6">
|
||||
{{ .TableOfContents }}
|
||||
</div>
|
||||
</aside>
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ .Content }}
|
||||
{{ partial "footer.html" . }}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Taxonomies
|
||||
linktitle:
|
||||
description:
|
||||
description: Hugo includes support for user-defined taxonomies to help you demonstrate logical relationships between content for the end users of your website.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
|
||||
@@ -9,7 +9,7 @@ tags: [aliases,redirects,permalinks,urls]
|
||||
categories: [content management]
|
||||
weight: 110
|
||||
draft: false
|
||||
aliases: [/extras/permalinks/,/extras/aliases/,/content-management/permalinks-and-redirects/,/extras/urls/,/doc/redirects/,/doc/alias/,/doc/aliases/]
|
||||
aliases: [/extras/permalinks/,/extras/aliases/,/extras/urls/,/doc/redirects/,/doc/alias/,/doc/aliases/]
|
||||
toc: true
|
||||
needsreview: true
|
||||
---
|
||||
@@ -230,6 +230,10 @@ Or, if you are on Windows and do not have `grep` installed:
|
||||
hugo config | FINDSTR /I canon
|
||||
```
|
||||
|
||||
## Overriding URLS in Front Matter
|
||||
|
||||
**Need explanation of *slug* and *url* here**
|
||||
|
||||
## Relative URLs
|
||||
|
||||
By default, all relative URLs are left unchanged by Hugo, which can be problematic when you want to make your site browsable from a local file system.
|
||||
@@ -239,9 +243,9 @@ Setting `relativeURLs` to `true` in your [site configuration][configuration] wil
|
||||
For example, if the `/post/first/` page contained a link to `/about/`, Hugo would rewrite that URL to `../../about/`.
|
||||
|
||||
[configuration]: /getting-started/configuration/
|
||||
[Content Organization]: /content-management/content-organization/
|
||||
[flag from the command line]: /getting-started/basic-usage/
|
||||
[Content Organization]: /content-management/organization/
|
||||
[flag from the command line]: /getting-started/usage/
|
||||
[front matter]: /content-management/front-matter/
|
||||
[multilingual]: /content-management/multilingual-mode/
|
||||
[multilingual]: /content-management/multilingual/
|
||||
[sections]: /content-management/sections/
|
||||
[site configuration]: /project-organization/configuration/
|
||||
@@ -1,50 +0,0 @@
|
||||
---
|
||||
title: Add Your Site to the Showcase
|
||||
linktitle: Add Your Site to the Showcase
|
||||
description: Proud of a site you built with Hugo? Add it to the Official Hugo Site Showcase.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [contribute to hugo]
|
||||
tags: [dev,showcase]
|
||||
weight: 30
|
||||
draft: true
|
||||
aliases: []
|
||||
toc: true
|
||||
notesforauthors:
|
||||
---
|
||||
|
||||
|
||||
If you've built a site with Hugo and would like to have it featured on the official Hugo site, you can add your website with a few steps to the [Site Showcase][].
|
||||
|
||||
|
||||
|
||||
## 2. Add Your Showcase File via the `showcase` Archetype
|
||||
|
||||
Let's create a new document that contains some metadata of your homepage. Replace `example` in the following examples with something unique like the name of your website. Inside the terminal enter the following commands:
|
||||
|
||||
```bash
|
||||
cd docs
|
||||
hugo new showcase/my-hugo-site-name.md
|
||||
```
|
||||
|
||||
You should find the new file at `content/showcase/your-site-name.md`. Open the file in your preferred text editor. The file should contain front matter with predefined variables like below:
|
||||
|
||||
```yaml
|
||||
---
|
||||
description: ""
|
||||
lastmod: ""
|
||||
license: ""
|
||||
licenseLink: ""
|
||||
sitelink: ""
|
||||
sourcelink: ""
|
||||
categories: [showcase]
|
||||
tags: []
|
||||
image: "yourimage.jpg"
|
||||
toc: false
|
||||
title: my hugo site name
|
||||
notesforauthors: "For the image, only include the file name *without* a directory/path, which is taken care of in the templating. See the showcase contribution page at gohugo.io/contribute/add-your-site-to-the-showcase/ for more details. As always, feel free to delete `notesforauthors` or modify for anyone in the future who may edit the content in this file."
|
||||
---
|
||||
```
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ tags: [dev,open source]
|
||||
authors: [digitalcraftsman]
|
||||
weight: 10
|
||||
draft: false
|
||||
aliases: [/contribute/contribute-to-hugo-development/]
|
||||
aliases: [/contribute/development/]
|
||||
toc: true
|
||||
needsreview: true
|
||||
notesforauthors:
|
||||
@@ -141,11 +141,11 @@ If you're not fimiliar with this term, GitHub's [help pages](https://help.github
|
||||
|
||||
Open the [Hugo repository](https://github.com/spf13/hugo) on Github and click on the "Fork" button in the top right.
|
||||
|
||||

|
||||

|
||||
|
||||
Now open your fork repository on GitHub and copy the remote url of your fork. You can choose between HTTPS and SSH as protocol that Git should use for the following operations. HTTPS works always [if you're not sure](https://help.github.com/articles/which-remote-url-should-i-use/).
|
||||
|
||||

|
||||

|
||||
|
||||
Switch back to the terminal and move into the directory of the cloned master repository from the last step.
|
||||
|
||||
@@ -350,7 +350,7 @@ We made a lot of progress. Good work. In this step we finally open a pull reques
|
||||
|
||||
You should find a green button labeld with "New pull request". But GitHub is clever and probably suggests you a pull request like in the beige box below:
|
||||
|
||||

|
||||

|
||||
|
||||
The new page summaries the most important information of your pull request. Scroll down and you find the additions of all your commits. Make sure everything looks as expected and click on "Create pull request".
|
||||
|
||||
@@ -358,13 +358,13 @@ The new page summaries the most important information of your pull request. Scro
|
||||
|
||||
Last but not least you should accept the contributor license agreement (CLA). A new comment should be added automatically to your pull request. Click on the yellow badge, accept the agreement and authenticate yourself with your GitHub account. It just takes a few clicks and only needs to be done once.
|
||||
|
||||

|
||||

|
||||
|
||||
### Automatic builds
|
||||
|
||||
We use the [Travis CI loop](https://travis-ci.org/spf13/hugo) (Linux and OS X) and [AppVeyor](https://ci.appveyor.com/project/spf13/hugo/branch/master) (Windows) to compile Hugo with your additions. This should ensure that everything works as expected before merging your pull request. This in most cases only relevant if you made changes to the codebase of Hugo.
|
||||
|
||||

|
||||

|
||||
|
||||
Above you can see that Travis wasn't able to compile the changes in this pull request. Click on "Details" and try to investigate why the build failed. But it doesn't have to be your fault. Mostly, the `master` branch that we used as foundation for your pull request should build without problems.
|
||||
|
||||
@@ -298,23 +298,34 @@ It's more important to contribute *some* documentation than no documentation at
|
||||
|
||||
The Hugo docs are not especially prescriptive in terms of grammar and usage. We encourage everyone to contribute regardless of your writing style. That said, here are a few gotchas when writing your documentation that, if observed, will create a more consistent documentation experience:
|
||||
|
||||
1. *Front matter* is two words.
|
||||
2. *Homepage* is one word.
|
||||
3. Be sure to add a `godocref` whenever possible to a new content file's front matter. We want to promote Hugo *and* Golang by demonstrating the inseparable wedding of the two.
|
||||
1. *Front matter* is two words, *Homepage* is one word, *file system* is two words.
|
||||
3. Be sure to add a value to the `godocref` in content files whenever possible. We want to promote Hugo *and* Golang by demonstrating the inseparable wedding of the two.
|
||||
|
||||
## Pages Needing Code Examples
|
||||
## Ask the Community for Code Examples
|
||||
|
||||
Examples
|
||||
Sometimes you want to contribute to the docs but don't have enough time to provide lengthy examples. If you want to flag a piece of content you feel needs more examples to be better understood by Hugo users, you can add the following field to a content file's front matter:
|
||||
|
||||
```
|
||||
needsexamples: true
|
||||
```
|
||||
|
||||
## Hugo Docs Examples Needed, Please Help!
|
||||
|
||||
The preceding `needsexamples` field generates the following list of files that we feel could benefit from some community-driven examples. The edit link will take you directly to the edit URL for the file if you're more comfortable making small changes in the GitHub interface rather than in your local text editor.
|
||||
|
||||
{{< needsexamples >}}
|
||||
|
||||
## How Content is Ordered in the Docs
|
||||
{{% note "Pull Requests and Branches" %}}
|
||||
Similar to [contributing to Hugo development](/contribute/contribute-to-hugo-development), the Hugo team expects you to create a separate branch/fork for your generous contributions to Hugo.
|
||||
{{% /note %}}
|
||||
|
||||
**IN DEVELOPMENT**
|
||||
## Ordering Content in the Hugo Docs
|
||||
|
||||
If you're contributing to the Hugo docs, do not worry about weight and ordering, especially in the case of a new content file. All Hugo doc sections have been ordered specifically to keep the docs website scalable and easy to use.
|
||||
|
||||
## Be Mindful of Aliases
|
||||
|
||||
Use aliases sparingly. The following table shows a list of all the aliases used in the Hugo Docs. If you need to use an alias in your new content file's front matter, be sure to check here first to prevent conflicts.
|
||||
Use aliases sparingly. The following table shows a list of all the aliases currently being used in the Hugo Docs. If you need to use an alias in your new content file's front matter, be sure to check here first to prevent conflicts.
|
||||
|
||||
{{< allaliases >}}
|
||||
|
||||
@@ -2,22 +2,21 @@
|
||||
title: chomp
|
||||
linktitle: chomp
|
||||
description:
|
||||
godocref:
|
||||
godocref: Removes any trailing newline characters.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
tags: []
|
||||
categories: [functions]
|
||||
toc:
|
||||
tags: [trim]
|
||||
signature:
|
||||
workson: []
|
||||
hugoversion:
|
||||
relatedfuncs: []
|
||||
relatedfuncs: [truncate]
|
||||
deprecated: false
|
||||
draft: false
|
||||
aliases: []
|
||||
---
|
||||
|
||||
## Example
|
||||
Removes any trailing newline characters. Useful in a pipeline to remove newlines added by other processing (e.g., [`markdownify`](/functions/markdownify/)).
|
||||
|
||||
## Advanced Example
|
||||
```golang
|
||||
{{chomp "<p>Blockhead</p>\n"}} → "<p>Blockhead</p>"
|
||||
```
|
||||
@@ -7,11 +7,16 @@ date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [functions]
|
||||
tags: [dates,time]
|
||||
tags: [dates,time,strings]
|
||||
signature:
|
||||
workson: []
|
||||
hugoversion:
|
||||
relatedfuncs: []
|
||||
deprecated: false
|
||||
aliases: []
|
||||
---
|
||||
---
|
||||
|
||||
`dateFormat` converts the textual representation of the `datetime` into the specified format or returns it as a Go `time.Time` type value. These are formatted with the layout string.
|
||||
|
||||
```
|
||||
{{ dateFormat "Monday, Jan 2, 2006" "2015-01-21" }} → "Wednesday, Jan 21, 2015"
|
||||
```
|
||||
@@ -6,19 +6,42 @@ godocref:
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
tags: []
|
||||
categories: [functions]
|
||||
toc:
|
||||
tags: [strings,emojis]
|
||||
signature:
|
||||
workson: []
|
||||
hugoversion:
|
||||
relatedfuncs: []
|
||||
deprecated: false
|
||||
draft: false
|
||||
aliases: []
|
||||
---
|
||||
|
||||
## Example
|
||||
Runs the string through the Emoji emoticons processor. The result will be declared as "safe" to prevent Go templates from filtering it.
|
||||
|
||||
## Advanced Example
|
||||
See the [Emoji cheat sheet][emojis] for available emoticons. The `emojify` function can be called in your templates but not content.
|
||||
|
||||
```
|
||||
{{ "I :heart: Hugo" | emojify }}
|
||||
```
|
||||
|
||||
However, emojis are most often seen inline. The following is a very simple [partial template][partials] you can use to add emojis directly to your content files. It is also the `emo` shortcode used for the Hugo docs.
|
||||
|
||||
{{% code file="layouts/shortcodes/emo.html" download="emo.html" %}}
|
||||
```golang
|
||||
{{< readfile file="layouts/shortcodes/emo.html" >}}
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
You can then call the shortcode directly in your content using the following:
|
||||
|
||||
{{% code file="content/functions/emojify.md" %}}
|
||||
```golang
|
||||
I {{</* emo ":heart:" */>}} Hugo!
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
The output of which is...
|
||||
|
||||
I {{< emo ":heart:" >}} Hugo!
|
||||
|
||||
[emojis]: http://www.emoji-cheat-sheet.com/
|
||||
[partials]: /templates/partials/
|
||||
@@ -6,19 +6,22 @@ godocref:
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
tags: []
|
||||
categories: [functions]
|
||||
toc:
|
||||
tags: []
|
||||
signature:
|
||||
workson: []
|
||||
hugoversion:
|
||||
relatedfuncs: []
|
||||
deprecated: false
|
||||
draft: false
|
||||
aliases: []
|
||||
---
|
||||
|
||||
## Example
|
||||
`highlight` takes a string of code and a language and then uses Pygments to return the syntax highlighted code in HTML.
|
||||
|
||||
## Advanced Example
|
||||
[`highlight` is used in Hugo's built-in `highlight` shortcode][highlight].
|
||||
|
||||
See [Installing Hugo][installpygments] for more information on Pygments or [Syntax Highlighting][syntax] for more options on how to add syntax highlighting to your code blocks with Hugo.
|
||||
|
||||
|
||||
[highlight]: /content-management/shortcodes/#highlight
|
||||
[installpygments]: /getting-started/installing/#installing-pygments-optional
|
||||
[syntax]: /developer-tools/syntax-highlighting/
|
||||
@@ -26,4 +26,4 @@ This translates a piece of content based on your `i18n/en-US.yaml` (and friends)
|
||||
`T` is an alias to `i18n`. E.g. `{{ T "translation_id" }}`.
|
||||
{{% /note %}}
|
||||
|
||||
For more information about string translations, see [Translation of strings](/content-management/multilingual-mode/#translation-of-strings).
|
||||
For more information about string translations, see [Translation of strings](/content-management/multilingual/#translation-of-strings).
|
||||
@@ -1,24 +1,28 @@
|
||||
---
|
||||
title: imageConfig
|
||||
linktitle:
|
||||
description:
|
||||
title: imageconfig
|
||||
linktitle: imageConfig
|
||||
description: Parses the image and returns the height, width, and color model.
|
||||
godocref:
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
tags: []
|
||||
categories: [functions]
|
||||
toc:
|
||||
tags: [images]
|
||||
signature:
|
||||
workson: []
|
||||
hugoversion:
|
||||
relatedfuncs: []
|
||||
deprecated: false
|
||||
draft: false
|
||||
aliases: []
|
||||
---
|
||||
|
||||
## Example
|
||||
{{% warning %}}
|
||||
`imageConfig` does not currently work in Hugo. See [the related `imageConfig` issue](https://github.com/spf13/hugo/issues/2806).
|
||||
{{% /warning %}}
|
||||
|
||||
## Advanced Example
|
||||
`imageConfig` parses the image and returns the height, width, and color model.
|
||||
|
||||
```golang
|
||||
{{ with (imageConfig "favicon.ico") }}
|
||||
favicon.ico: {{.Width}} x {{.Height}}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
@@ -1,24 +1,23 @@
|
||||
---
|
||||
title: int
|
||||
linktitle:
|
||||
description:
|
||||
linktitle: int
|
||||
description: Creates an `int` from the argument passed into the function.
|
||||
godocref:
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
tags: []
|
||||
categories: [functions]
|
||||
toc:
|
||||
tags: [strings,integers]
|
||||
signature:
|
||||
workson: []
|
||||
hugoversion:
|
||||
relatedfuncs: []
|
||||
deprecated: false
|
||||
draft: false
|
||||
aliases: []
|
||||
---
|
||||
|
||||
## Example
|
||||
|
||||
## Advanced Example
|
||||
Creates an integer (`int`) from the argument passed into the function. Useful for turning strings into numbers.
|
||||
|
||||
```
|
||||
{{ int "123" }} → 123
|
||||
```
|
||||
@@ -6,19 +6,23 @@ godocref: https://golang.org/pkg/fmt/
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
tags: []
|
||||
categories: [functions]
|
||||
toc:
|
||||
tags: []
|
||||
signature:
|
||||
workson: []
|
||||
hugoversion:
|
||||
relatedfuncs: []
|
||||
deprecated: false
|
||||
draft: false
|
||||
aliases: []
|
||||
needsexamples: true
|
||||
---
|
||||
|
||||
## Example
|
||||
Format a string using the standard `fmt.Sprintf` function. See [the go
|
||||
doc](https://golang.org/pkg/fmt/) for additional information.
|
||||
|
||||
## Advanced Example
|
||||
```golang
|
||||
{{ i18n ( printf "combined_%s" $var ) }}
|
||||
```
|
||||
|
||||
```
|
||||
{{ printf "formatted %.2f" 3.1416 }}
|
||||
```
|
||||
@@ -16,3 +16,28 @@ deprecated: false
|
||||
aliases: [/functions/readdir/,/functions/readfile/]
|
||||
---
|
||||
|
||||
## `readDir`
|
||||
|
||||
`readDir` gets a directory listing from a directory relative to the current project working directory.
|
||||
|
||||
If your current project working directory has a single file named `README.txt`:
|
||||
|
||||
```
|
||||
{{ range (readDir ".") }}{{ .Name }}{{ end }} → "README.txt"
|
||||
```
|
||||
|
||||
## `readFile`
|
||||
|
||||
Reads a file from disk and converts it into a string. Note that the filename must be relative to the current project working directory.
|
||||
|
||||
So, if you have a file with the name `README.txt` in the root of your project with the content `Hugo Rocks!`:
|
||||
|
||||
```
|
||||
{{readFile "README.txt"}} → "Hugo Rocks!"
|
||||
```
|
||||
|
||||
For more information on using `readDir` and `readFile` in your templates, see [Local File Templates][local].
|
||||
|
||||
|
||||
[local]: /templates/local-file-templates/
|
||||
|
||||
|
||||
@@ -1,24 +1,40 @@
|
||||
---
|
||||
title: safeHTML
|
||||
linktitle:
|
||||
description:
|
||||
godocref:
|
||||
description: Declares a provided string as a "safe" HTML document to avoid escaping by Go templates.
|
||||
godocref: https://golang.org/src/html/template/content.go?s=1374:1385#L25
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
tags: [strings]
|
||||
categories: [functions]
|
||||
toc:
|
||||
tags: [strings]
|
||||
signature:
|
||||
workson: []
|
||||
hugoversion:
|
||||
relatedfuncs: []
|
||||
deprecated: false
|
||||
draft: false
|
||||
aliases: []
|
||||
---
|
||||
|
||||
## Example
|
||||
`safeHTML` declares the provided string as a "safe" HTML document fragment
|
||||
so Go html/template will not filter it. It should not be used
|
||||
for HTML from a third-party, or HTML with unclosed tags or comments.
|
||||
|
||||
## Advanced Example
|
||||
Given a site-wide [`config.toml`][config] with the following `copyright` value:
|
||||
|
||||
```toml
|
||||
copyright = "© 2015 Jane Doe. <a href=\"http://creativecommons.org/licenses/by/4.0/\">Some rights reserved</a>."
|
||||
```
|
||||
|
||||
`{{ .Site.Copyright | safeHTML }}` in a template would then output:
|
||||
|
||||
```html
|
||||
© 2015 Jane Doe. <a href="http://creativecommons.org/licenses/by/4.0/">Some rights reserved</a>.
|
||||
```
|
||||
|
||||
However, without the `safeHTML` function, html/template assumes `.Site.Copyright` to be unsafe and therefore escapes all HTML tags and renders the whole string as plain text:
|
||||
|
||||
```html
|
||||
<p>© 2015 Jane Doe. <a href="http://creativecommons.org/licenses by/4.0/">Some rights reserved</a>.</p>
|
||||
```
|
||||
|
||||
[config]: /getting-started/configuration/
|
||||
@@ -6,18 +6,17 @@ godocref:
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
tags: []
|
||||
categories: [functions]
|
||||
toc:
|
||||
tags: [strings]
|
||||
signature:
|
||||
workson: []
|
||||
hugoversion:
|
||||
relatedfuncs: []
|
||||
deprecated: false
|
||||
draft: false
|
||||
aliases: []
|
||||
---
|
||||
|
||||
## Example
|
||||
Trim returns a slice of the string with all leading and trailing characters contained in cutset removed.
|
||||
|
||||
## Advanced Example
|
||||
```
|
||||
{{ trim "++Batman--" "+-" }} → "Batman"
|
||||
```
|
||||
@@ -1,29 +1,26 @@
|
||||
---
|
||||
title: truncate
|
||||
linktitle: truncate
|
||||
description:
|
||||
description: Truncates a text to a max length without cutting words or leaving unclosed HTML tags.
|
||||
godocref:
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [functions]
|
||||
tags: []
|
||||
toc:
|
||||
tags: [strings]
|
||||
signature:
|
||||
workson: []
|
||||
hugoversion:
|
||||
hugoversion: 19
|
||||
relatedfuncs: []
|
||||
deprecated: false
|
||||
draft: false
|
||||
aliases: []
|
||||
---
|
||||
|
||||
Truncate a text to a max length without cutting words or leaving unclosed HTML tags. Since Go templates are HTML-aware, `truncate` will intelligently handle normal strings vs HTML strings ((**INSERT EXAMPLE**)).
|
||||
Truncate a text to a max length without cutting words or leaving unclosed HTML tags. Since Go templates are HTML-aware, `truncate` will intelligently handle normal strings vs HTML strings:
|
||||
|
||||
```
|
||||
{{ "<em>Keep my HTML</em>" | safeHTML | truncate 10 }}` → <em>Keep my …</em>`
|
||||
```
|
||||
|
||||
{{% note %}}
|
||||
If you have a raw string that contains HTML tags you want to remain treated as HTML, you will need to convert the string to HTML using the [`safeHTML` template function](/functions/safehtml) before sending the value to truncate. Otherwise, the HTML tags will be escaped when passed through the `truncate` function.
|
||||
{{% /note %}}
|
||||
|
||||
## Examples of `truncate`
|
||||
|
||||
`{{ "<em>Keep my HTML</em>" | safeHTML | truncate 10 }}` → `<em>Keep my …</em>`
|
||||
{{% /note %}}
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: upper
|
||||
linktitle:
|
||||
description:
|
||||
linktitle: upper
|
||||
description: Converts all characters in a string to uppercase
|
||||
godocref:
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
@@ -18,7 +18,10 @@ draft: false
|
||||
aliases: []
|
||||
---
|
||||
|
||||
## Example
|
||||
`upper` converts all characters in string to uppercase. Note that `upper` can be applied in your templates in more than one way:
|
||||
|
||||
## Advanced Example
|
||||
```
|
||||
{{ upper "BatMan" }} → "BATMAN"
|
||||
{{ "BatMan" | upper }} → "BATMAN"
|
||||
```
|
||||
|
||||
|
||||
@@ -1,24 +1,100 @@
|
||||
---
|
||||
title: where
|
||||
linktitle:
|
||||
description:
|
||||
linktitle: where
|
||||
description: Filters an array to only the elements containing a matching value for a given field.
|
||||
godocref:
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
tags: []
|
||||
categories: [functions]
|
||||
toc:
|
||||
tags: [filtering]
|
||||
signature:
|
||||
workson: []
|
||||
workson: [lists,taxonomies,terms,groups]
|
||||
hugoversion:
|
||||
relatedfuncs: []
|
||||
relatedfuncs: [intersect,first]
|
||||
deprecated: false
|
||||
draft: false
|
||||
aliases: []
|
||||
toc: true
|
||||
needsexample: true
|
||||
---
|
||||
|
||||
## Example
|
||||
`where` filters an array to only the elements containing a matching value for a given field.
|
||||
|
||||
## Advanced Example
|
||||
```golang
|
||||
{{ range where .Data.Pages "Section" "post" }}
|
||||
{{ .Content }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
It can be used by dot-chaining the second argument to refer to a nested element of a value.
|
||||
|
||||
```toml
|
||||
+++
|
||||
series: golang
|
||||
+++
|
||||
```
|
||||
|
||||
```golang
|
||||
{{ range where .Site.Pages "Params.series" "golang" }}
|
||||
{{ .Content }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
It can also be used with the logical operators `!=`, `>=`, `in`, etc. Without an operator, `where` compares a given field with a matching value equivalent to `=`.
|
||||
|
||||
```golang
|
||||
{{ range where .Data.Pages "Section" "!=" "post" }}
|
||||
{{ .Content }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
The following logical operators are vailable with `where`:
|
||||
|
||||
* `=`, `==`, `eq`: True if a given field value equals a matching value
|
||||
* `!=`, `<>`, `ne`: True if a given field value doesn't equal a matching value
|
||||
* `>=`, `ge`: True if a given field value is greater than or equal to a matching value
|
||||
* `>`, `gt`: True if a given field value is greater than a matching value
|
||||
* `<=`, `le`: True if a given field value is lesser than or equal to a matching value
|
||||
* `<`, `lt`: True if a given field value is lesser than a matching value
|
||||
* `in`: True if a given field value is included in a matching value. A matching value must be an array or a slice
|
||||
* `not in`: True if a given field value isn't included in a matching value. A matching value must be an array or a slice
|
||||
* `intersect`: True if a given field value that is a slice / array of strings or integers contains elements in common with the matching value. It follows the same rules as the intersect function.
|
||||
|
||||
## Using `where` with `intersect`
|
||||
|
||||
```golang
|
||||
{{ range where .Site.Pages ".Params.tags" "intersect" .Params.tags }}
|
||||
{{ if ne .Permalink $.Permalink }}
|
||||
{{ .Render "summary" }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
## Using `where` with `first`
|
||||
|
||||
```golang
|
||||
{{ range first 5 (where .Data.Pages "Section" "post") }}
|
||||
{{ .Content }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
## Nesting `where` Clauses
|
||||
|
||||
**Needs Example**
|
||||
|
||||
## Unset Fields
|
||||
|
||||
Filtering only works for set fields. To check whether a field is set or exists, you can use the operand `nil`.
|
||||
|
||||
This can be useful to filter a small amount of pages from a large pool. Instead of set field on all pages, you can set field on required pages only.
|
||||
|
||||
Only the following operators are available for `nil`
|
||||
|
||||
* `=`, `==`, `eq`: True if the given field is not set.
|
||||
* `!=`, `<>`, `ne`: True if the given field is set.
|
||||
|
||||
```golang
|
||||
{{ range where .Data.Pages ".Params.specialpost" "!=" nil }}
|
||||
{{ .Content }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
|
||||
@@ -5,17 +5,15 @@ description: Quick start and guides for installing Hugo on your preferred operat
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: []
|
||||
categories: [getting started]
|
||||
tags: [usage,docs]
|
||||
weight: 01
|
||||
draft: false
|
||||
slug:
|
||||
aliases: []
|
||||
aliases: [/overview/introduction/]
|
||||
toc: false
|
||||
notesforauthors:
|
||||
---
|
||||
|
||||
The Hugo docs were completely reworked from the ground up in anticipation of v0.19. There are extensive code block examples throughout the documentation. If this is your first time using Hugo and you [already have Hugo installed on your machine][install], we recommend the [quick start][].
|
||||
The Hugo docs were completely reworked from the ground up in anticipation of v0.19. There are extensive code block examples throughout the documentation. If this is your first time using Hugo and you've [already installed Hugo on your machine][installed], we recommend the [quick start][].
|
||||
|
||||
[install]: /getting-started/installing/
|
||||
[installed]: /getting-started/installing/
|
||||
[quick start]: /getting-started/quick-start/
|
||||
@@ -35,9 +35,9 @@ Learn more about the different directories and what their purpose is:
|
||||
|
||||
* [config](/getting-started/configuration/)
|
||||
* [data](/templates/data-templates/)
|
||||
* [i18n](/content-management/multilingual-mode/)
|
||||
* [i18n](/content-management/multilingual/)
|
||||
* [archetypes](/content-management/archetypes/)
|
||||
* [content](/content-managemt/content-organization/)
|
||||
* [content](/content-managemt/organization/)
|
||||
* [layouts](/templates/)
|
||||
* [static](/themes/creating-a-theme/)
|
||||
* [themes](/themes/)
|
||||
|
||||
@@ -6,16 +6,15 @@ date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [getting started]
|
||||
tags: [usage,livereload,command line]
|
||||
tags: [usage,livereload,command line,flags]
|
||||
weight: 40
|
||||
draft: false
|
||||
aliases: [/overview/usage/,/extras/livereload/,/getting-started/using-hugo/,/doc/usage/]
|
||||
aliases: [/overview/usage/,/extras/livereload/,/doc/usage/]
|
||||
toc: true
|
||||
needsreview: true
|
||||
notesforauthors:
|
||||
---
|
||||
|
||||
## Testing Installation with Hugo Help
|
||||
## Testing Installation with `hugo help`
|
||||
|
||||
Once you have [installed Hugo][install], make sure it is in your `PATH`. You can test that Hugo has been installed correctly via the `help` command:
|
||||
|
||||
@@ -90,8 +89,11 @@ Additional help topics:
|
||||
Use "hugo [command] --help" for more information about a command.
|
||||
```
|
||||
|
||||
## Common Usage
|
||||
|
||||
The most common use is probably to run `hugo` with your current directory being the input directory:
|
||||
The most common usage is probably to run `hugo` with your current directory being the input directory.
|
||||
|
||||
This generates your website to the `public/` directory by default---although [this can be configured to your needs via `publishDir`][configdir]---ready to be deployed to your web server.
|
||||
|
||||
```bash
|
||||
hugo
|
||||
@@ -104,11 +106,9 @@ hugo
|
||||
in 120 ms
|
||||
```
|
||||
|
||||
This generates your website to the `public/` directory, ready to be deployed to your web server.
|
||||
## Instant Feedback During Development
|
||||
|
||||
## Instant feedback as you develop your web site
|
||||
|
||||
If you are working on things and want to see the changes immediately, by default Hugo will watch the filesystem for changes and rebuild your site as soon as a file is saved:
|
||||
If you are working on things and want to see the changes immediately, by default Hugo will watch the file system for changes and rebuild your site as soon as a file is saved:
|
||||
|
||||
```bash
|
||||
hugo -s ~/Code/hugo/docs
|
||||
@@ -254,6 +254,7 @@ Interested? Here are some great tutorials contributed by Hugo users:
|
||||
[Amazon S3]: http://aws.amazon.com/s3/
|
||||
[Apache]: http://httpd.apache.org/ "Apache HTTP Server"
|
||||
[CloudFront]: http://aws.amazon.com/cloudfront/ "Amazon CloudFront"
|
||||
[configdir]: /getting-started/configuration/
|
||||
[directorystructure]: /getting-started/directory-structure/
|
||||
[DreamHost]: http://www.dreamhost.com/
|
||||
[Firebase Hosting]: https://firebase.google.com/docs/hosting/
|
||||
@@ -47,4 +47,4 @@ Interested in helping us improve the Hugo docs?
|
||||
2. If you're not up for git and GitHub, start a thread on the ["docs" category in the Hugo Forums][hugodiscussion]
|
||||
|
||||
[hugodiscussion]: https://discuss.gohugo.io/c/feature
|
||||
[contributedocs]: /contribute/contribute-to-the-hugo-docs/
|
||||
[contributedocs]: /contribute/documentation/
|
||||
@@ -330,7 +330,7 @@ If you want to see an example of how you can deploy to S3 instead of GitHub page
|
||||
|
||||
|
||||
[accesstokenghhelp]: https://help.github.com/articles/creating-an-access-token-for-command-line-use/
|
||||
[basicusage]: /getting-started/basic-usage/
|
||||
[basicusage]: /getting-started/usage/
|
||||
[ghsignup]: https://github.com/join
|
||||
[gitbasics]: https://git-scm.com/book/en/v2/Getting-Started-Git-Basics
|
||||
[githubhelp]: https://help.github.com/articles/set-up-git/
|
||||
|
||||
@@ -9,7 +9,7 @@ categories: [hosting and deployment]
|
||||
tags: [netlify,hosting,deployment]
|
||||
authors: [Ryan Watters]
|
||||
weight: 20
|
||||
draft: false
|
||||
draft: true
|
||||
aliases: []
|
||||
toc: true
|
||||
needsreview:
|
||||
|
||||
@@ -15,7 +15,7 @@ aliases: [/site-showcase/]
|
||||
toc: false
|
||||
---
|
||||
|
||||
The following sites have been built with <i class="icon-love"></i> and Hugo. [Interested in adding your site to the showcase?][addshowcase]
|
||||
The following sites have been built with {{< emo ":heart:" >}} and Hugo. If you're interested in adding your site to the showcase, [see how to contribute][addshowcase].
|
||||
|
||||
|
||||
[addshowcase]: /contribute/add-your-site-to-the-showcase/
|
||||
[addshowcase]: /contribute/documentation/
|
||||
@@ -248,7 +248,7 @@ If you change any local file and the LiveReload is triggered, Hugo will read the
|
||||
[customize]: /themes/customizing/
|
||||
[lookup]: /templates/lookup-order/
|
||||
[json]: /documents/ecma-404-json-spec.pdf
|
||||
[LiveReload]: /getting-started/basic-usage/#livereload
|
||||
[LiveReload]: /getting-started/usage/#livereload
|
||||
[OAuth]: http://en.wikipedia.org/wiki/OAuth
|
||||
[partials]: /templates/partials/
|
||||
[themes]: /themes/
|
||||
|
||||
@@ -63,7 +63,7 @@ It makes use of [partial templates][partials] and uses a similar approach as a [
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
[contentorg]: /content-management/content-organization/
|
||||
[contentorg]: /content-management/organization/
|
||||
[lists]: /templates/lists/
|
||||
[lookup]: /templates/lookup-order/
|
||||
[pagevars]: /variables/page-variables/
|
||||
|
||||
@@ -60,7 +60,7 @@ The following is an example:
|
||||
```
|
||||
|
||||
{{% note "`absLangURL` and `relLangURL`" %}}
|
||||
Use the `absLangURL` or `relLangURL` if your theme makes use of the [multilingual feature](/content-management/multilingual-mode/). In contrast to `absURL` and `relURL`, these two functions add the correct language prefix to the url. Read more on the [`absLangUrl`](/functions/abslangurl) and [`relLangUrl`](/functions/rellangurl) functions.
|
||||
Use the `absLangURL` or `relLangURL` if your theme makes use of the [multilingual feature](/content-management/multilingual/). In contrast to `absURL` and `relURL`, these two functions add the correct language prefix to the url. Read more on the [`absLangUrl`](/functions/abslangurl) and [`relLangUrl`](/functions/rellangurl) functions.
|
||||
{{% /note %}}
|
||||
|
||||
## Section Menu for Lazy Bloggers
|
||||
|
||||
@@ -17,7 +17,7 @@ needsreview: true
|
||||
Section page templates are lists and therefore have all the variables and methods available to [list pages][lists].
|
||||
|
||||
{{% warning "Section Pages Pull Content from `_index.md`" %}}
|
||||
To effectively leverage section page templates, you should first understand the Hugo [content organization](/content-management/content-organization/), and specifically the purpose of `_index.md`.
|
||||
To effectively leverage section page templates, you should first understand the Hugo [content organization](/content-management/organization/), and specifically the purpose of `_index.md`.
|
||||
{{% /warning %}}
|
||||
|
||||
### Section Template Lookup Order
|
||||
|
||||
@@ -254,7 +254,7 @@ The preceding shortcode makes use of a Hugo-specific template function called `h
|
||||
|
||||
More shortcode examples can be found in the [shortcodes directory for spf13.com][spf13shortcodes] and the [shortcodes directory for the Hugo docs][docsshortcodes].
|
||||
|
||||
[basic content files]: /content-management/supported-content-formats/ "See how Hugo leverages markdown--and other supported formats--to create content for your website."
|
||||
[basic content files]: /content-management/formats/ "See how Hugo leverages markdown--and other supported formats--to create content for your website."
|
||||
[built-in shortcode]: /content-management/shortcodes/
|
||||
[source organization]: /getting-started/directory-structure/ "Learn how Hugo scaffolds new sites and what it expects to find in each of your directories."
|
||||
[docsshortcodes]: https://github.com/spf13/hugo/tree/master/docs/layouts/shortcodes "See the shortcode source directory for the documentation site you're currently reading."
|
||||
|
||||
@@ -98,6 +98,6 @@ The `themename` in the above examples must match the name of the specific theme
|
||||
{{% /note %}}
|
||||
|
||||
[customizethemes]: /themes/customizing-a-theme/
|
||||
[flag]: /getting-started/basic-usage/ "See the full list of flags in Hugo's basic usage."
|
||||
[flag]: /getting-started/usage/ "See the full list of flags in Hugo's basic usage."
|
||||
[configuration]: /project-organization/configuration/ "Learn how to customize your Hugo website configuration file in yaml, toml, or json."
|
||||
[themesrepo]: https://github.com/spf13/hugoThemes
|
||||
@@ -16,7 +16,7 @@ needsreview: true
|
||||
---
|
||||
|
||||
{{% note %}}
|
||||
Since v0.17, Hugo has built-in support for the creation of multilingual websites. Read the [multilingual documentation](/content-management/multilingual-mode/) for more information.
|
||||
Since v0.17, Hugo has built-in support for the creation of multilingual websites. Read the [multilingual documentation](/content-management/multilingual/) for more information.
|
||||
{{% /note %}}
|
||||
|
||||
## Introduction
|
||||
|
||||
@@ -44,4 +44,4 @@ The `.File` object contains the following fields:
|
||||
`.File.Dir`
|
||||
: Given the path `content/posts/dir1/dir2/`, the relative directory path of the content file will be returned (e.g., `posts/dir1/dir2/`)
|
||||
|
||||
[Multilingual]: /content-management/multilingual-mode/
|
||||
[Multilingual]: /content-management/multilingual/
|
||||
@@ -86,7 +86,7 @@ See [`.Scratch`](/functions/scratch/) for page-scoped writable variables.
|
||||
: a collection of associated pages. This value will be `nil` for regular content pages. `.Pages` is an alias for `.Data.Pages`.
|
||||
|
||||
`.Permalink`
|
||||
: the Permanent link for this page; see [Permalinks](/content-management/url-management/)
|
||||
: the Permanent link for this page; see [Permalinks](/content-management/urls/)
|
||||
|
||||
`.Prev`
|
||||
: Pointer to the previous content (based on `publishdate` in front matter).
|
||||
@@ -133,7 +133,7 @@ http://remarkjs.com)
|
||||
: the title for this page.
|
||||
|
||||
`.Translations`
|
||||
: a list of translated versions of the current page. See [Multilingual Mode](/content-management/multilingual-mode/) for more information.
|
||||
: a list of translated versions of the current page. See [Multilingual Mode](/content-management/multilingual/) for more information.
|
||||
|
||||
`.Truncated`
|
||||
: a boolean, `true` if the `.Summary` is truncated. Useful for showing a "Read more..." link only when necessary. See [Summaries](/content-management/content-summaries/) for more information.
|
||||
@@ -197,7 +197,7 @@ Two common situations where this type of front matter field could be introduced
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
This template would render as follows, assuming you've set [`uglyURLs`](/content-management/url-management/) to `false` in your [site `config`](/getting-started/configuration/):
|
||||
This template would render as follows, assuming you've set [`uglyURLs`](/content-management/urls/) to `false` in your [site `config`](/getting-started/configuration/):
|
||||
|
||||
{{% output file="yourbaseurl/review/book01/index.html" %}}
|
||||
```html
|
||||
|
||||
@@ -46,7 +46,7 @@ The following is a list of site-level variables (aka "global"). Many of these va
|
||||
: a string representing your tracking code for Google Analytics as defined in the site configuration.
|
||||
|
||||
`.Site.IsMultiLingual`
|
||||
: whether there are more than one language in this site. See [Multilingual](/content-management/multilingual-mode/) for more information.
|
||||
: whether there are more than one language in this site. See [Multilingual](/content-management/multilingual/) for more information.
|
||||
|
||||
`.Site.Language.Lang`
|
||||
: the language code of the current locale (e.g., `en`).
|
||||
@@ -79,7 +79,7 @@ The following is a list of site-level variables (aka "global"). Many of these va
|
||||
: array of all content ordered by Date with the newest first. `.Site.Pages` replaced the deprecated `.Site.Recent` as of Hugo v0.13. This array contains only the pages in the current language.
|
||||
|
||||
`.Site.Permalinks`
|
||||
: a string to override the default [permalink](/content-management/url-management/) format as defined in the site configuration.
|
||||
: a string to override the default [permalink](/content-management/urls/) format as defined in the site configuration.
|
||||
|
||||
`.Site.RegularPages`
|
||||
: a shortcut to the *regular* page collection. `.Site.RegularPages` is equivalents to `where .Site.Pages "Kind" "page"`.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{{ .Get 0 | emojify }}
|
||||
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 122 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 59 KiB |
@@ -8,7 +8,7 @@
|
||||
<a {{with .Params.sitelink }}href="{{.}} "target="_blank"{{else}}href="{{.Permalink}}"{{end}}>
|
||||
<section class="contents-list {{$kind}}">
|
||||
<header>
|
||||
<h3 class="list-icon {{.Section}}">{{- partial "list-icon.html" . -}}{{with .LinkTitle}}{{. | markdownify}}{{else}}{{.Title | markdownify}}{{end}}{{with .Params.sitelink }} <i class="fa fa-external-link" aria-hidden="true"></i>{{end}}</h3>
|
||||
<h3 class="list-icon {{.Section}}">{{- partial "list-icon.html" . -}}{{.Title | markdownify}}{{with .Params.sitelink }} <i class="fa fa-external-link" aria-hidden="true"></i>{{end}}</h3>
|
||||
</header>
|
||||
<p>{{.Description | markdownify }}</p>
|
||||
</section>
|
||||
|
||||
@@ -3,6 +3,9 @@ main.showcase-list {
|
||||
max-width: $XL;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
@include MQ(XL) {
|
||||
margin-left: 5%;
|
||||
}
|
||||
}
|
||||
|
||||
#showcase {
|
||||
@@ -65,9 +68,9 @@ main.showcase-list {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.showcase-title {
|
||||
font-weight:bold;
|
||||
font-weight: bold;
|
||||
a {
|
||||
font-weight:bold;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||