mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
[Docs] Copyediting
* Add meta author, description and generator tags * Add Hugo version beside the logo and in the footer * Suggest the user to run `go get -u -v` to update dependencies * Requires Go 1.3+ rather than Go 1.1+ * Improve rendering/formatting in some places * Add trailing slash to URLs where appropriate * GitHub redirects all http requests to https, update accordingly
This commit is contained in:
parent
82d4b8ab40
commit
ba44e860a3
62 changed files with 318 additions and 294 deletions
19
README.md
19
README.md
|
@ -1,6 +1,6 @@
|
|||
# Hugo
|
||||
A Fast and Flexible Static Site Generator built with love by [spf13](http://spf13.com)
|
||||
and [friends](http://github.com/spf13/hugo/graphs/contributors) in Go.
|
||||
A Fast and Flexible Static Site Generator built with love by [spf13](http://spf13.com/)
|
||||
and [friends](https://github.com/spf13/hugo/graphs/contributors) in Go.
|
||||
|
||||
[![Build Status](https://travis-ci.org/spf13/hugo.png)](https://travis-ci.org/spf13/hugo)
|
||||
[![wercker status](https://app.wercker.com/status/1a0de7d703ce3b80527f00f675e1eb32 "wercker status")](https://app.wercker.com/project/bykey/1a0de7d703ce3b80527f00f675e1eb32)
|
||||
|
@ -21,7 +21,7 @@ takes around 1 millisecond for each piece of content.
|
|||
It is written to work well with any
|
||||
kind of website including blogs, tumbles and docs.
|
||||
|
||||
**Complete documentation is available at [Hugo Documentation](http://gohugo.io).**
|
||||
**Complete documentation is available at [Hugo Documentation](http://gohugo.io/).**
|
||||
|
||||
# Getting Started
|
||||
|
||||
|
@ -51,7 +51,7 @@ is the most probable location.
|
|||
#### Dependencies
|
||||
|
||||
* Git
|
||||
* Go 1.1+ (Go 1.4+ on Windows, see Go [Issue #8090](https://code.google.com/p/go/issues/detail?id=8090))
|
||||
* Go 1.3+ (Go 1.4+ on Windows, see Go [Issue #8090](https://code.google.com/p/go/issues/detail?id=8090))
|
||||
* Mercurial
|
||||
* Bazaar
|
||||
|
||||
|
@ -69,10 +69,17 @@ it's helpful to symlink the project to one of the following paths:
|
|||
|
||||
#### Get directly from GitHub:
|
||||
|
||||
If you only want to build from source, it's even easier.
|
||||
If you only want to build from source, it's even easier:
|
||||
|
||||
go get -v github.com/spf13/hugo
|
||||
|
||||
Once completed, your may find your new `hugo` (or `hugo.exe`) executable
|
||||
sitting inside `$GOPATH/bin/`.
|
||||
|
||||
You may also run `go get` with the `-u` option to update Hugo’s dependencies:
|
||||
|
||||
go get -u -v github.com/spf13/hugo
|
||||
|
||||
#### Building Hugo
|
||||
|
||||
cd /path/to/hugo
|
||||
|
@ -124,7 +131,7 @@ We welcome your contributions. To make the process as seamless as possible, we
|
|||
* Squash your commits into a single commit. `git rebase -i`. It's okay to force update your pull request.
|
||||
* Make sure `go test ./...` passes, and `go build` completes. Our Travis CI loop will catch most things that are missing. The exception: Windows. We run on Windows from time to time, but if you have access, please check on a Windows machine too.
|
||||
|
||||
**Complete documentation is available at [Hugo Documentation](http://gohugo.io).**
|
||||
**Complete documentation is available at [Hugo Documentation](http://gohugo.io/).**
|
||||
|
||||
[![Analytics](https://ga-beacon.appspot.com/UA-7131036-6/hugo/readme)](https://github.com/igrigorik/ga-beacon)
|
||||
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/spf13/hugo/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
|
||||
|
|
|
@ -3,8 +3,8 @@ date: 2013-07-01T07:32:00Z
|
|||
description: ""
|
||||
license: ""
|
||||
licenseLink: ""
|
||||
sitelink: http://spf13.com
|
||||
sourceLink: http://github.com/spf13/spf13.com
|
||||
sitelink: http://spf13.com/
|
||||
sourceLink: https://github.com/spf13/spf13.com
|
||||
tags:
|
||||
- personal
|
||||
- blog
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
baseurl = "http://gohugo.io/"
|
||||
MetaDataFormat = "yaml"
|
||||
|
||||
[params]
|
||||
description = "Documentation of Hugo, a fast and flexible static site generator built with love by spf13 and friends in Go"
|
||||
author = "Steve Francia (spf13) and friends"
|
||||
|
||||
[indexes]
|
||||
tag = "tags"
|
||||
group = "groups"
|
||||
|
@ -18,7 +22,7 @@ MetaDataFormat = "yaml"
|
|||
[[menu.main]]
|
||||
name = "Discuss Hugo"
|
||||
pre = "<i class='fa fa-comments'></i>"
|
||||
url = "http://discuss.gohugo.io"
|
||||
url = "http://discuss.gohugo.io/"
|
||||
weight = -150
|
||||
[[menu.main]]
|
||||
name = "About Hugo"
|
||||
|
|
|
@ -13,7 +13,7 @@ weight: 30
|
|||
---
|
||||
|
||||
All contributions to Hugo are welcome. Whether you want to scratch an itch, or simply contribute to the project, feel free to pick something from the roadmap
|
||||
or contact [spf13](http://spf13.com) about what may make sense
|
||||
or contact [spf13](http://spf13.com/) about what may make sense
|
||||
to do next.
|
||||
|
||||
You should fork the project and make your changes. *We encourage pull requests to discuss code changes.*
|
||||
|
|
|
@ -11,7 +11,7 @@ weight: 10
|
|||
|
||||
## Discussion Forum
|
||||
|
||||
Hugo has its own [discussion forum](http://discuss.gohugo.io) powered by [Discourse](http://www.discourse.org/).
|
||||
Hugo has its own [discussion forum](http://discuss.gohugo.io/) powered by [Discourse](http://www.discourse.org/).
|
||||
|
||||
Please use this for all discussions, questions, etc.
|
||||
|
||||
|
@ -26,7 +26,7 @@ https://groups.google.com/forum/#!forum/hugo-announce
|
|||
|
||||
### Discussion (Archive)
|
||||
|
||||
**This has been replaced with the [Hugo discussion forum](http://discuss.gohugo.io).**
|
||||
**This has been replaced with the [Hugo discussion forum](http://discuss.gohugo.io/).**
|
||||
|
||||
It is available for archival purposes.
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ Hugo provides you with all the flexibility you need to organize how your content
|
|||
By default, content is ordered by weight, then by date with the most
|
||||
recent date first, but alternative sorting (by `title` and `linktitle`) is
|
||||
also available. The order the content would appear is specified in
|
||||
the [list template](/templates/list).
|
||||
the [list template](/templates/list/).
|
||||
|
||||
_Both the `date` and `weight` fields are optional._
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ in the front matter.
|
|||
In Hugo, the content should be arranged in the same way they are intended for
|
||||
the rendered website. Without any additional configuration, the following will
|
||||
just work. Hugo supports content nested at any level. The top level is special
|
||||
in Hugo and is used as the [section](/content/sections).
|
||||
in Hugo and is used as the [section](/content/sections/).
|
||||
|
||||
.
|
||||
└── content
|
||||
|
@ -72,16 +72,16 @@ destination.
|
|||
|
||||
### filepath
|
||||
The actual path to the file on disk. Destination will create the destination
|
||||
with the same path. Includes [section](/content/sections).
|
||||
with the same path. Includes [section](/content/sections/).
|
||||
|
||||
### section
|
||||
section can be provided in the front matter overriding the section derived from
|
||||
the source content location on disk. See [section](/content/sections).
|
||||
the source content location on disk. See [section](/content/sections/).
|
||||
|
||||
### path
|
||||
path can be provided in the front matter. This will replace the actual
|
||||
path to the file on disk. Destination will create the destination with the same
|
||||
path. Includes [section](/content/sections).
|
||||
path. Includes [section](/content/sections/).
|
||||
|
||||
### url
|
||||
A complete URL can be provided. This will override all the above as it pertains
|
||||
|
|
|
@ -12,7 +12,7 @@ weight: 30
|
|||
|
||||
Hugo believes that you organize your content with a purpose. The same structure
|
||||
that works to organize your source content is used to organize the rendered
|
||||
site (see [Organization](/content/organization)). Following this pattern Hugo
|
||||
site (see [Organization](/content/organization/)). Following this pattern Hugo
|
||||
uses the top level of your content organization as **the Section**.
|
||||
|
||||
The following example site uses two sections, "post" and "quote".
|
||||
|
@ -32,7 +32,7 @@ The following example site uses two sections, "post" and "quote".
|
|||
## Section Lists
|
||||
|
||||
Hugo will automatically create pages for each section root that list all
|
||||
of the content in that section. See [List Templates](/templates/list)
|
||||
of the content in that section. See [List Templates](/templates/list/)
|
||||
for details on customizing the way they appear.
|
||||
|
||||
## Sections and Types
|
||||
|
|
|
@ -23,7 +23,7 @@ By default, Hugo automatically takes the first 70 words of your content as its s
|
|||
|
||||
## User-defined: manual summary split:
|
||||
|
||||
Alternatively, you may adding the <code><!--more--></code> summary divider[^1] where you want to split the article. Content prior to the summary divider will be used as that content's summary, and stored into the `.Summary` variable with all HTML formatting intact.
|
||||
Alternatively, you may add the <code><!--more--></code> summary divider[^1] where you want to split the article. Content prior to the summary divider will be used as that content's summary, and stored into the `.Summary` variable with all HTML formatting intact.
|
||||
|
||||
[^1]: The **summary divider** is also called "more tag", "excerpt separator", etc. in other literature.
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ weight: 40
|
|||
|
||||
Hugo has full support for different types of content. A content type can have a
|
||||
unique set of meta data, template and can be automatically created by the new
|
||||
command through using content [archetypes](/content/archetypes).
|
||||
command through using content [archetypes](/content/archetypes/).
|
||||
|
||||
A good example of when multiple types are needed is to look at [Tumblr](https://www.tumblr.com/). A piece
|
||||
of content could be a photo, quote or post, each with different meta data and
|
||||
|
@ -20,7 +20,7 @@ rendered differently.
|
|||
|
||||
## Assigning a content type
|
||||
|
||||
Hugo assumes that your site will be organized into [sections](/content/sections)
|
||||
Hugo assumes that your site will be organized into [sections](/content/sections/)
|
||||
and each section will use the corresponding type. If you are taking advantage of
|
||||
this, then each new piece of content you place into a section will automatically
|
||||
inherit the type.
|
||||
|
@ -32,7 +32,7 @@ Alternatively, you can set the type in the meta data under the key "`type`".
|
|||
|
||||
Hugo has the ability to create a new content file and populate the front matter
|
||||
with the data set corresponding to that type. Hugo does this by utilizing
|
||||
[archetypes](/content/archetypes).
|
||||
[archetypes](/content/archetypes/).
|
||||
|
||||
To create a new piece of content, use:
|
||||
|
||||
|
@ -73,4 +73,4 @@ that a template exists in each layouts/`TYPE` directory with the same name.
|
|||
|
||||
Create a file called <code><em>type</em>.md</code> in the `/archetypes` directory. *E.g. `/archetypes/post.md`*.
|
||||
|
||||
More details about archetypes can be found at the [archetypes docs](/content/archetypes).
|
||||
More details about archetypes can be found at the [archetypes docs](/content/archetypes/).
|
||||
|
|
|
@ -22,16 +22,13 @@ Luckily, this can be handled easily with aliases in Hugo.
|
|||
**content/posts/my-awesome-blog-post.md**
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>YAML</th><th>TOML</th>
|
||||
<th>TOML</th><th>YAML</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr valign="top">
|
||||
<td><pre><code>---
|
||||
aliases:
|
||||
- /posts/my-original-url/
|
||||
- /2010/even-earlier-url.html
|
||||
---
|
||||
</code></pre></td>
|
||||
<td><pre><code>+++
|
||||
aliases = [
|
||||
"/posts/my-original-url/",
|
||||
|
@ -39,7 +36,14 @@ aliases = [
|
|||
]
|
||||
+++
|
||||
</code></pre></td>
|
||||
<td><pre><code>---
|
||||
aliases:
|
||||
- /posts/my-original-url/
|
||||
- /2010/even-earlier-url.html
|
||||
---
|
||||
</code></pre></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Now when you go to any of the aliases locations, they
|
||||
|
|
|
@ -24,7 +24,7 @@ Hugo will create all the needed directories and files to get started
|
|||
quickly.
|
||||
|
||||
Hugo will only touch the files and create the directories (in the right
|
||||
places), [configuration](/overview/configuration) and content are up to
|
||||
places), [configuration](/overview/configuration/) and content are up to
|
||||
you... but luckily we have builders for content (see below).
|
||||
|
||||
## New Theme
|
||||
|
@ -37,7 +37,7 @@ Run from your working directory, this will create a new theme with all
|
|||
the needed files in your themes directory. Hugo will provide you with a
|
||||
license and theme.toml file with most of the work done for you.
|
||||
|
||||
Follow the [Theme Creation Guide](/themes/creation) once the builder is
|
||||
Follow the [Theme Creation Guide](/themes/creation/) once the builder is
|
||||
done.
|
||||
|
||||
## New Content
|
||||
|
@ -45,7 +45,7 @@ done.
|
|||
You will use this builder the most of all. Every time you want to create
|
||||
a new piece of content, the content builder will get you started right.
|
||||
|
||||
Leveraging [content archetypes](/content/archetypes) the content builder
|
||||
Leveraging [content archetypes](/content/archetypes/) the content builder
|
||||
will not only insert the current date and appropriate metadata, but it
|
||||
will pre-populate values based on the content type.
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ As Hugo is a static site generator, the content produced is static and
|
|||
doesn’t interact with the users. The most common interaction people ask
|
||||
for is comment capability.
|
||||
|
||||
Hugo ships with support for [Disqus](https://disqus.com), a third-party
|
||||
Hugo ships with support for [Disqus](https://disqus.com/), a third-party
|
||||
service that provides comment and community capabilities to website via
|
||||
JavaScript.
|
||||
|
||||
|
@ -66,7 +66,7 @@ Users have noticed that enabling Disqus comments when running the Hugo web serve
|
|||
})();
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
||||
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
|
||||
<a href="http://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
|
||||
```
|
||||
|
||||
Notice that there is a simple `if` statement that detects when you are running on localhost and skips the initialization of the Disqus comment injection.
|
||||
|
@ -78,17 +78,17 @@ Now, reference the partial template from your page template:
|
|||
|
||||
# Alternatives
|
||||
|
||||
A few alternatives exist to [Disqus](https://disqus.com):
|
||||
A few alternatives exist to [Disqus](https://disqus.com/):
|
||||
|
||||
* [IntenseDebate](http://intensedebate.com/)
|
||||
* [Livefyre](http://livefyre.com/)
|
||||
* [Muut](http://muut.com)
|
||||
* [Muut](http://muut.com/)
|
||||
* [多说](http://duoshuo.com/) ([Duoshuo](http://duoshuo.com/), popular in China)
|
||||
* [Kaiju](http://github.com/spf13/kaiju)
|
||||
* [Kaiju](https://github.com/spf13/kaiju)
|
||||
|
||||
|
||||
[Kaiju](http://github.com/spf13/kaiju) is an open-source project started
|
||||
by [spf13](http://spf13.com) (Hugo’s author) to bring easy and fast real
|
||||
[Kaiju](https://github.com/spf13/kaiju) is an open-source project started
|
||||
by [spf13](http://spf13.com/) (Hugo’s author) to bring easy and fast real
|
||||
time discussions to the web.
|
||||
|
||||
Written using Go, Socket.io and MongoDB, it is very fast and easy to
|
||||
|
|
|
@ -20,7 +20,7 @@ it doesn’t cost anything when building your site and some of the highlighting
|
|||
scripts available cover more languages than Pygments does.
|
||||
|
||||
For the pre-processed approach, Highlighting is performed by an external
|
||||
Python-based program called [Pygments](http://pygments.org) and is triggered
|
||||
Python-based program called [Pygments](http://pygments.org/) and is triggered
|
||||
via an embedded shortcode. If Pygments is absent from the path, it will
|
||||
silently simply pass the content along unhighlighted.
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ available.
|
|||
## Adding (non-content) entries to a menu
|
||||
|
||||
You can also add entries to menus that aren’t attached to a piece of
|
||||
content. This takes place in the sitewide [config file](/overview/configuration).
|
||||
content. This takes place in the sitewide [config file](/overview/configuration/).
|
||||
|
||||
Here’s an example `config.toml`:
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ title: Pagination
|
|||
weight: 80
|
||||
---
|
||||
|
||||
Hugo supports pagination for the home page, sections and taxonomies. It's built to be easy use, but with loads of flexibility when needed. The real power shines when you combine it with [`where`](/templates/functions), with its SQL-like operators, `first` and others -- you can even [order the content](/templates/list) the way you've become used to with Hugo.
|
||||
Hugo supports pagination for the home page, sections and taxonomies. It's built to be easy use, but with loads of flexibility when needed. The real power shines when you combine it with [`where`](/templates/functions/), with its SQL-like operators, `first` and others --- you can even [order the content](/templates/list/) the way you've become used to with Hugo.
|
||||
|
||||
## Configuration
|
||||
|
||||
|
@ -20,7 +20,7 @@ Pagination can be configured in the site configuration (e.g. `config.toml`):
|
|||
* `Paginate` (default `10`)
|
||||
* `PaginatePath` (default `page`)
|
||||
|
||||
Setting `Paginate` to a positive value will split the list pages for the home page, sections and taxonomies into chunks of that size. But note that the generation of the pagination pages for sections, taxonomies and home page is *lazy* -- the pages will not be created if not referenced by a `.Paginator` (see below).
|
||||
Setting `Paginate` to a positive value will split the list pages for the home page, sections and taxonomies into chunks of that size. But note that the generation of the pagination pages for sections, taxonomies and home page is *lazy* --- the pages will not be created if not referenced by a `.Paginator` (see below).
|
||||
|
||||
`PaginatePath` is used to adapt the `Url` to the pages in the paginator (the default setting will produce urls on the form `/page/1/`.
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ title: Shortcodes
|
|||
weight: 80
|
||||
---
|
||||
|
||||
Hugo uses Markdown for its simple content format. However, there’s a lot
|
||||
Hugo uses Markdown for its simple content format. However, there are a lot
|
||||
of things that Markdown doesn’t support well.
|
||||
|
||||
We are unwilling to accept being constrained by our simple format. Also
|
||||
|
@ -25,7 +25,7 @@ To avoid both of these limitations, Hugo created shortcodes.
|
|||
A shortcode is a simple snippet inside a content file that Hugo will render
|
||||
using a predefined template. Note that shortcodes will not work in template
|
||||
files---if you need a functionality like that in a template, you most likely
|
||||
want a [partial template](/templates/partials) instead.
|
||||
want a [partial template](/templates/partials/) instead.
|
||||
|
||||
## Using a shortcode
|
||||
|
||||
|
@ -69,7 +69,7 @@ Hugo ships with a set of predefined shortcodes.
|
|||
### highlight
|
||||
|
||||
This shortcode will convert the source code provided into syntax highlighted
|
||||
HTML. Read more on [highlighting](/extras/highlighting).
|
||||
HTML. Read more on [highlighting](/extras/highlighting/).
|
||||
|
||||
#### Usage
|
||||
`highlight` takes exactly one required parameter of _language_ and requires a
|
||||
|
|
|
@ -19,12 +19,12 @@ Simply create content like you normally would with the appropriate
|
|||
headers.
|
||||
|
||||
Hugo will take this Markdown and create a table of contents stored in the
|
||||
[content variable](/layout/variables) `.TableOfContents`
|
||||
[content variable](/layout/variables/) `.TableOfContents`
|
||||
|
||||
|
||||
## Template Example
|
||||
|
||||
This is example code of a [single.html template](/layout/content).
|
||||
This is example code of a [single.html template](/layout/content/).
|
||||
|
||||
{{ partial "header.html" . }}
|
||||
<div id="toc" class="well col-md-4 col-sm-6">
|
||||
|
|
|
@ -15,12 +15,12 @@ weight: 10
|
|||
A lot has happened since Hugo v0.12.0 was released.
|
||||
|
||||
* Changes to docs:
|
||||
* A new [Troubleshooting](/troubleshooting/overview) section is added
|
||||
* A new [Troubleshooting](/troubleshooting/overview/) section is added
|
||||
* It's now searchable through Google Custom Search ([#753][])
|
||||
* Some new great tutorials:
|
||||
* [Automated deployments with Wercker](/tutorials/automated-deployments)
|
||||
* [Creating a new theme](/tutorials/creating-a-new-theme)
|
||||
* Several improvements to the [template functions](/templates/functions):
|
||||
* [Automated deployments with Wercker](/tutorials/automated-deployments/)
|
||||
* [Creating a new theme](/tutorials/creating-a-new-theme/)
|
||||
* Several improvements to the [template functions](/templates/functions/):
|
||||
* `where` is now even more powerful and accepts SQL-like syntax with the operators `==`, `eq`; `!=`, `<>`, `ne`; `>=`, `ge`; `>`, `gt`; `<=`, `le`; `<`, `lt`; `in`, `not in`
|
||||
* `where` template function now also accepts dot chaining key argument (e.g. `"Params.foo.bar"`)
|
||||
* New template functions:
|
||||
|
@ -39,10 +39,10 @@ A lot has happened since Hugo v0.12.0 was released.
|
|||
* `GroupByPublishDate(format, order)`
|
||||
* `GroupByParam(key, order)`
|
||||
* `GroupByParamDate(key, format, order)`
|
||||
* The [shortcode](/extras/shortcodes) handling is rewritten for speed and better error messages. Noticeable functional change is the distinction between `{{</* */>}}` (typically raw HTML) and `{{%/* */%}}` (Markdown)
|
||||
* Support for [cross-references](/extras/crossreferences)
|
||||
* A new, generic Next/Prev functionality is added to all lists of pages (sections, taxonomies, etc)
|
||||
* Add in-section [Next/Prev](/templates/variables) content pointers
|
||||
* The [shortcode](/extras/shortcodes/) handling is rewritten for speed and better error messages. Noticeable functional change is the distinction between `{{</* */>}}` (typically raw HTML) and `{{%/* */%}}` (Markdown)
|
||||
* Support for [cross-references](/extras/crossreferences/)
|
||||
* A new, generic Next/Prev functionality is added to all lists of pages (sections, taxonomies, etc.)
|
||||
* Add in-section [Next/Prev](/templates/variables/) content pointers
|
||||
* Several [configurable improvements related to Markdown rendering](/overview/configuration/#configure-blackfriday-rendering:a66b35d20295cb764719ac8bd35837ec):
|
||||
* Configuration of footnote rendering
|
||||
* Optional support for smart angled quotes, e.g. `"Hugo"` → «Hugo»
|
||||
|
@ -51,7 +51,7 @@ A lot has happened since Hugo v0.12.0 was released.
|
|||
* Improved unit test coverage
|
||||
* Hugo has undergone a major refactoring, with a new handler system and a generic file system. This sounds and is technical, but will pave the way for new features and make Hugo even speedier
|
||||
* [Ace](http://ace.yoss.si/) template engine support ([#541][])
|
||||
* Add [pagination support](/extras/pagination) for home page, sections and taxonomies ([#750][])
|
||||
* Add [pagination support](/extras/pagination/) for home page, sections and taxonomies ([#750][])
|
||||
* Fixed a lot of Windows-related path issues
|
||||
* Improved error messages for template and rendering errors
|
||||
* Enabled soft LiveReload of CSS and images ([#490][])
|
||||
|
@ -78,79 +78,79 @@ templates.
|
|||
This release represents over 90 code commits from 28 different contributors.
|
||||
|
||||
* 10 [new themes](https://github.com/spf13/hugoThemes) created by the community
|
||||
* Fully themable [Partials](/templates/partials)
|
||||
* Fully themable [Partials](/templates/partials/)
|
||||
* [404 template](/templates/404/) support in themes
|
||||
* [Shortcode](/extras/shortcodes/) support in themes
|
||||
* [Views](/templates/views/) support in themes
|
||||
* Inner [shortcode](/extras/shortcodes/) content now treated as Markdown
|
||||
* Support for header ids in Markdown (# Header {#myid})
|
||||
* [Where](/templates/list) template function to filter lists of content, taxonomies, etc
|
||||
* [GroupBy](/templates/list) & [GroupByDate](/templates/list) methods to group pages
|
||||
* [Where](/templates/list/) template function to filter lists of content, taxonomies, etc.
|
||||
* [GroupBy](/templates/list/) & [GroupByDate](/templates/list/) methods to group pages
|
||||
* Taxonomy [pages list](/taxonomies/methods/) now sortable, filterable, limitable & groupable
|
||||
* General cleanup to taxonomies & documentation to make it more clear and consistent
|
||||
* [Showcase](/showcase/) returned and has been expanded
|
||||
* Pretty links now always have trailing slashes
|
||||
* [BaseUrl](/overview/configuration/) can now include a subdirectory
|
||||
* Better feedback about draft & future post rendering
|
||||
* A variety of improvements to [the website](http://gohugo.io)
|
||||
* A variety of improvements to [the website](http://gohugo.io/)
|
||||
|
||||
## **0.11.0** May 28, 2014
|
||||
|
||||
This release represents over 110 code commits from 29 different contributors.
|
||||
|
||||
* Considerably faster... about 3 - 4x faster on average
|
||||
* [LiveReload](/extras/livereload). Hugo will automatically reload the browser when the build is complete
|
||||
* Theme engine w/[Theme Repository](http://github.com/spf13/hugoThemes)
|
||||
* [Menu system](/extras/menus) with support for active page
|
||||
* [Builders](/extras/builders) to quickly create a new site, content or theme
|
||||
* [XML sitemap](/templates/sitemap) generation
|
||||
* [Integrated Disqus](/extras/comments) support
|
||||
* Streamlined [template organization](/templates/overview)
|
||||
* [Brand new docs site](http://gohugo.io)
|
||||
* [LiveReload](/extras/livereload/). Hugo will automatically reload the browser when the build is complete
|
||||
* Theme engine w/[Theme Repository](https://github.com/spf13/hugoThemes)
|
||||
* [Menu system](/extras/menus/) with support for active page
|
||||
* [Builders](/extras/builders/) to quickly create a new site, content or theme
|
||||
* [XML sitemap](/templates/sitemap/) generation
|
||||
* [Integrated Disqus](/extras/comments/) support
|
||||
* Streamlined [template organization](/templates/overview/)
|
||||
* [Brand new docs site](http://gohugo.io/)
|
||||
* Support for publishDate which allows for posts to be dated in the future
|
||||
* More [sort](/content/ordering) options
|
||||
* More [sort](/content/ordering/) options
|
||||
* Logging support
|
||||
* Much better error handling
|
||||
* More informative verbose output
|
||||
* Renamed Indexes > [Taxonomies](/taxonomies/overview)
|
||||
* Renamed Chrome > [Partials](/templates/partials)
|
||||
* Renamed Indexes > [Taxonomies](/taxonomies/overview/)
|
||||
* Renamed Chrome > [Partials](/templates/partials/)
|
||||
|
||||
## **0.10.0** March 1, 2014
|
||||
|
||||
This release represents over 110 code commits from 29 different contributors.
|
||||
|
||||
* [Syntax highlighting](/extras/highlighting) powered by pygments (**slow**)
|
||||
* Ability to [sort content](/content/ordering) many more ways
|
||||
* Automatic [table of contents](/extras/toc) generation
|
||||
* Support for unicode urls, aliases and indexes
|
||||
* Configurable per-section [permalink](/extras/permalinks) pattern support
|
||||
* Support for [paired shortcodes](/extras/shortcodes)
|
||||
* Shipping with some [shortcodes](/extras/shortcodes) (highlight & figure)
|
||||
* Adding [canonify](/extras/urls) option to keep urls relative
|
||||
* A bunch of [additional template functions](/layout/functions)
|
||||
* Watching very large sites now works on mac
|
||||
* RSS generation improved. Limited to 50 items by default, can limit further in [template](/layout/rss)
|
||||
* Boolean params now supported in [frontmatter](/content/front-matter)
|
||||
* Launched website [showcase](/showcase). Show off your own hugo site!
|
||||
* [Syntax highlighting](/extras/highlighting/) powered by pygments (**slow**)
|
||||
* Ability to [sort content](/content/ordering/) many more ways
|
||||
* Automatic [table of contents](/extras/toc/) generation
|
||||
* Support for Unicode URLs, aliases and indexes
|
||||
* Configurable per-section [permalink](/extras/permalinks/) pattern support
|
||||
* Support for [paired shortcodes](/extras/shortcodes/)
|
||||
* Shipping with some [shortcodes](/extras/shortcodes/) (highlight & figure)
|
||||
* Adding [canonify](/extras/urls/) option to keep urls relative
|
||||
* A bunch of [additional template functions](/layout/functions/)
|
||||
* Watching very large sites now works on Mac
|
||||
* RSS generation improved. Limited to 50 items by default, can limit further in [template](/layout/rss/)
|
||||
* Boolean params now supported in [frontmatter](/content/front-matter/)
|
||||
* Launched website [showcase](/showcase/). Show off your own hugo site!
|
||||
* A bunch of [bug fixes](https://github.com/spf13/hugo/commits/master)
|
||||
|
||||
## **0.9.0** November 15, 2013
|
||||
|
||||
This release represents over 220 code commits from 22 different contributors.
|
||||
|
||||
* New [command based interface](/overview/usage) similar to git (hugo server -s ./ )
|
||||
* New [command based interface](/overview/usage/) similar to git (`hugo server -s ./`)
|
||||
* Amber template support
|
||||
* [Aliases](/extras/aliases) (redirects)
|
||||
* [Aliases](/extras/aliases/) (redirects)
|
||||
* Support for top level pages (in addition to homepage)
|
||||
* Complete overhaul of the documentation site
|
||||
* Full Windows support
|
||||
* Better index support including [ordering by content weight](/content/ordering)
|
||||
* Better index support including [ordering by content weight](/content/ordering/)
|
||||
* Add params to site config, available in .Site.Params from templates
|
||||
* Friendlier json support
|
||||
* Support for html & xml content (with frontmatter support)
|
||||
* Support for [summary](/content/summaries) content divider (<!–more–>)
|
||||
* HTML in [summary](/content/summaries) (when using divider)
|
||||
* Added ["Minutes to Read"](/layout/variables) functionality
|
||||
* Support for [summary](/content/summaries/) content divider (<code><!--more--></code>)
|
||||
* HTML in [summary](/content/summaries/) (when using divider)
|
||||
* Added ["Minutes to Read"](/layout/variables/) functionality
|
||||
* Support for a custom 404 page
|
||||
* Cleanup of how content organization is handled
|
||||
* Loads of unit and performance tests
|
||||
|
@ -160,10 +160,10 @@ This release represents over 220 code commits from 22 different contributors.
|
|||
* Fixed watching being triggered multiple times for the same event
|
||||
* Watch now ignores temp files (as created by Vim)
|
||||
* Configurable number of posts on [homepage](/layout/homepage/)
|
||||
* [Front matter](/content/front-matter) supports multiple types (int, string, date, float)
|
||||
* [Front matter](/content/front-matter/) supports multiple types (int, string, date, float)
|
||||
* Indexes can now use a default template
|
||||
* Addition of truncated bool to content to determine if should show 'more' link
|
||||
* Support for [linkTitles](/layout/variables)
|
||||
* Support for [linkTitles](/layout/variables/)
|
||||
* Better handling of most errors with directions on how to resolve
|
||||
* Support for more date / time formats
|
||||
* Support for go 1.2
|
||||
|
|
|
@ -132,9 +132,12 @@ but only these three.</small></td>
|
|||
**Note** that these flags must be grouped under the `blackfriday` key and can be set on **both site and page level**. If set on page, it will override the site setting. Example:
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>TOML</th><th>YAML</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><pre><code>[blackfriday]
|
||||
angledQuotes = true
|
||||
|
@ -150,10 +153,11 @@ but only these three.</small></td>
|
|||
- hardLineBreak
|
||||
</code></pre></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## Notes
|
||||
|
||||
Config changes are not reflected with [LiveReload](/extras/livereload).
|
||||
Config changes are not reflected with [LiveReload](/extras/livereload/).
|
||||
|
||||
Please restart `hugo server --watch` whenever you make a config change.
|
||||
|
|
|
@ -31,15 +31,15 @@ where you don't have a privileged account.
|
|||
Ideally, you should install it somewhere in your `PATH` for easy use.
|
||||
`/usr/local/bin` is the most probable location.
|
||||
|
||||
On OS X, if you have [Homebrew](http://brew.sh), installation is even
|
||||
On OS X, if you have [Homebrew](http://brew.sh/), installation is even
|
||||
easier: just run `brew install hugo`.
|
||||
|
||||
### Installing Pygments (optional)
|
||||
|
||||
The Hugo executable has one *optional* external dependency for source code highlighting (Pygments).
|
||||
|
||||
If you want to have source code highlighting using the [highlight shortcode](/extras/highlighting),
|
||||
you need to install the Python-based Pygments program. The procedure is outlined on the [Pygments home page](http://pygments.org).
|
||||
If you want to have source code highlighting using the [highlight shortcode](/extras/highlighting/),
|
||||
you need to install the Python-based Pygments program. The procedure is outlined on the [Pygments home page](http://pygments.org/).
|
||||
|
||||
## Upgrading Hugo
|
||||
|
||||
|
@ -64,8 +64,12 @@ placed in your `PATH`.
|
|||
`go get` will then fetch Hugo and all its dependent libraries to your
|
||||
`$GOPATH/src` directory, and compile everything into the final `hugo`
|
||||
(or `hugo.exe`) executable, which you will find sitting in the
|
||||
`$GOPATH/bin/hugo` directory, all ready to go!
|
||||
`$GOPATH/bin/` directory, all ready to go!
|
||||
|
||||
You may run `go get` with the `-u` option to update Hugo's dependencies:
|
||||
|
||||
$ go get -u -v github.com/spf13/hugo
|
||||
|
||||
## Contributing
|
||||
|
||||
Please see the [contributing guide](/doc/contributing).
|
||||
Please see the [contributing guide](/doc/contributing/).
|
||||
|
|
|
@ -52,43 +52,43 @@ Hugo boasts the following features:
|
|||
|
||||
* Extremely fast build times (~1 ms per page)
|
||||
* Completely cross platform: Runs on <i class="fa fa-apple"></i> Mac OS X, <i class="fa fa-linux"></i> Linux, <i class="fa fa-windows"></i> Windows, and more!
|
||||
* Easy [installation](/overview/installing)
|
||||
* Render changes [on the fly](/overview/usage) with [LiveReload](/extras/livereload) as you develop
|
||||
* Easy [installation](/overview/installing/)
|
||||
* Render changes [on the fly](/overview/usage/) with [LiveReload](/extras/livereload/) as you develop
|
||||
* Complete theme support
|
||||
* Host your site anywhere
|
||||
|
||||
### Organization
|
||||
|
||||
* Straightforward [organization](/content/organization)
|
||||
* Support for [website sections](/content/sections)
|
||||
* Completely customizable [URLs](/extras/urls)
|
||||
* Support for configurable [taxonomies](/indexes/overview) which includes categories and tags. Create your own custom organization of content
|
||||
* Ability to [sort content](/content/ordering) as you desire
|
||||
* Automatic [table of contents](/extras/toc) generation
|
||||
* Straightforward [organization](/content/organization/)
|
||||
* Support for [website sections](/content/sections/)
|
||||
* Completely customizable [URLs](/extras/urls/)
|
||||
* Support for configurable [taxonomies](/taxonomies/overview/) which includes categories and tags. Create your own custom organization of content
|
||||
* Ability to [sort content](/content/ordering/) as you desire
|
||||
* Automatic [table of contents](/extras/toc/) generation
|
||||
* Dynamic menu creation
|
||||
* [Pretty URLs](/extras/urls) support
|
||||
* [Permalink](/extras/permalinks) pattern support
|
||||
* [Aliases](/extras/aliases) (redirects)
|
||||
* [Pretty URLs](/extras/urls/) support
|
||||
* [Permalink](/extras/permalinks/) pattern support
|
||||
* [Aliases](/extras/aliases/) (redirects)
|
||||
|
||||
### Content
|
||||
|
||||
* Content written in [Markdown](/content/example)
|
||||
* Support for TOML, YAML and JSON metadata in [frontmatter](/content/front-matter)
|
||||
* Completely [customizable homepage](/layout/homepage)
|
||||
* Support for multiple [content types](/content/types)
|
||||
* Automatic and user defined [summaries](/content/summaries)
|
||||
* [Shortcodes](/extras/shortcodes) to enable rich content inside of Markdown
|
||||
* ["Minutes to Read"](/layout/variables) functionality
|
||||
* ["Wordcount"](/layout/variables) functionality
|
||||
* Content written in [Markdown](/content/example/)
|
||||
* Support for TOML, YAML and JSON metadata in [frontmatter](/content/front-matter/)
|
||||
* Completely [customizable homepage](/layout/homepage/)
|
||||
* Support for multiple [content types](/content/types/)
|
||||
* Automatic and user defined [summaries](/content/summaries/)
|
||||
* [Shortcodes](/extras/shortcodes/) to enable rich content inside of Markdown
|
||||
* ["Minutes to Read"](/layout/variables/) functionality
|
||||
* ["Wordcount"](/layout/variables/) functionality
|
||||
|
||||
### Additional Features
|
||||
|
||||
* Integrated [Disqus](https://disqus.com/) comment support
|
||||
* Automatic [RSS](/layout/rss) creation
|
||||
* Automatic [RSS](/layout/rss/) creation
|
||||
* Support for [Go](http://golang.org/pkg/html/template/), [Amber](https://github.com/eknkc/amber) and [Ace](http://ace.yoss.si/) HTML templates
|
||||
* Syntax [highlighting](/extras/highlighting) powered by [Pygments](http://pygments.org/)
|
||||
* Syntax [highlighting](/extras/highlighting/) powered by [Pygments](http://pygments.org/)
|
||||
|
||||
See what's coming next in the [roadmap](/meta/roadmap).
|
||||
See what's coming next in the [roadmap](/meta/roadmap/).
|
||||
|
||||
## Who should use Hugo?
|
||||
|
||||
|
@ -135,9 +135,9 @@ as I have writing it.
|
|||
|
||||
## Next Steps
|
||||
|
||||
* [Install Hugo](/overview/installing)
|
||||
* [Quick start](/overview/quickstart)
|
||||
* [Join the Mailing List](/community/mailing-list)
|
||||
* [Star us on GitHub](http://github.com/spf13/hugo)
|
||||
* [Discussion Forum](http://discuss.gohugo.io)
|
||||
* [Install Hugo](/overview/installing/)
|
||||
* [Quick start](/overview/quickstart/)
|
||||
* [Join the Mailing List](/community/mailing-list/)
|
||||
* [Star us on GitHub](https://github.com/spf13/hugo)
|
||||
* [Discussion Forum](http://discuss.gohugo.io/)
|
||||
|
||||
|
|
|
@ -135,7 +135,7 @@ Stop the Hugo process by hitting <kbd>Ctrl</kbd>+<kbd>C</kbd>. Then run the foll
|
|||
Web Server is available at http://localhost:1313
|
||||
Press ctrl+c to stop
|
||||
|
||||
Open your [favorite editor](http://vim.spf13.com), edit and save your content, and watch as Hugo rebuilds and reloads automatically.
|
||||
Open your [favorite editor](http://vim.spf13.com/), edit and save your content, and watch as Hugo rebuilds and reloads automatically.
|
||||
|
||||
It’s especially productive to leave a browser open on a second monitor
|
||||
and just glance at it whenever you save. You don’t even need to tab to
|
||||
|
|
|
@ -27,12 +27,12 @@ The top level of a source directory will typically have the following elements:
|
|||
|
||||
Learn more about the different directories and what their purpose is:
|
||||
|
||||
* [config](/overview/configuration)
|
||||
* [archetypes](/content/archetypes)
|
||||
* [content](/content/organization)
|
||||
* [layouts](/layout/overview)
|
||||
* [config](/overview/configuration/)
|
||||
* [archetypes](/content/archetypes/)
|
||||
* [content](/content/organization/)
|
||||
* [layouts](/layout/overview/)
|
||||
* [static](/themes/creation#toc_4)
|
||||
* [themes](/themes/overview)
|
||||
* [themes](/themes/overview/)
|
||||
|
||||
|
||||
## Example
|
||||
|
|
|
@ -74,7 +74,7 @@ is saved.
|
|||
Press ctrl+c to stop
|
||||
|
||||
Hugo can even run a server and create your site at the same time! Hugo
|
||||
implements [LiveReload](/extras/livereload) technology to automatically reload any open pages in
|
||||
implements [LiveReload](/extras/livereload/) technology to automatically reload any open pages in
|
||||
all browsers (including mobile).
|
||||
|
||||
$ hugo server -ws ~/mysite
|
||||
|
|
|
@ -3,8 +3,8 @@ date: 2014-02-03T20:00:00Z
|
|||
description: Ant Zucaro's Blog
|
||||
license: GPL
|
||||
licenseLink: ""
|
||||
sitelink: http://antzucaro.com
|
||||
sourceLink: http://github.com/antzucaro/az.com
|
||||
sitelink: http://antzucaro.com/
|
||||
sourceLink: https://github.com/antzucaro/az.com
|
||||
tags:
|
||||
- personal
|
||||
- blog
|
||||
|
|
|
@ -3,7 +3,7 @@ date: 2014-01-22T07:32:00Z
|
|||
description: ""
|
||||
license: CC-BY-SA
|
||||
licenseLink: ""
|
||||
sitelink: http://andrewcodispoti.com
|
||||
sitelink: http://andrewcodispoti.com/
|
||||
sourceLink: https://gitlab.com/acodispo/andrewcodispoti-com
|
||||
tags:
|
||||
- personal
|
||||
|
|
|
@ -3,7 +3,7 @@ date: 2013-10-02T07:32:00Z
|
|||
description: ""
|
||||
license: CC-SA
|
||||
licenseLink: ""
|
||||
sitelink: http://chimeraarts.org
|
||||
sitelink: http://chimeraarts.org/
|
||||
sourceLink: https://github.com/chimera/chimeraarts.org
|
||||
tags:
|
||||
- company
|
||||
|
|
|
@ -3,7 +3,7 @@ date: 2014-03-27T09:45:00Z
|
|||
description: CloudShark Appliance homepage and documentation
|
||||
license: ""
|
||||
licenseLink: ""
|
||||
sitelink: https://appliance.cloudshark.org
|
||||
sitelink: https://appliance.cloudshark.org/
|
||||
tags:
|
||||
- company
|
||||
- documentation
|
||||
|
|
|
@ -3,7 +3,7 @@ date: 2014-03-09T06:00:00Z
|
|||
description: ""
|
||||
license: MIT
|
||||
licenseLink: ""
|
||||
sitelink: http://heyitsalex.net
|
||||
sitelink: http://heyitsalex.net/
|
||||
sourceLink: https://github.com/alexandre-normand/alexandre-normand
|
||||
tags:
|
||||
- personal
|
||||
|
|
|
@ -3,8 +3,8 @@ date: 2013-07-01T07:32:00Z
|
|||
description: This site
|
||||
license: Simpl
|
||||
licenseLink: ""
|
||||
sitelink: http://gohugo.io
|
||||
sourceLink: http://github.com/spf13/hugo/tree/master/docs
|
||||
sitelink: http://gohugo.io/
|
||||
sourceLink: https://github.com/spf13/hugo/tree/master/docs
|
||||
tags:
|
||||
- documentation
|
||||
- bootstrap
|
||||
|
|
|
@ -3,8 +3,7 @@ date: 2013-11-02T07:32:00Z
|
|||
description: ""
|
||||
license: MIT
|
||||
licenseLink: ""
|
||||
sitelink: http://ifup.org
|
||||
sourceLink: http://www.ifup.org
|
||||
sitelink: http://ifup.org/
|
||||
tags:
|
||||
- personal
|
||||
- blog
|
||||
|
|
|
@ -3,8 +3,8 @@ date: 2014-02-27T20:35:00Z
|
|||
description: Kieran Healy's Website
|
||||
license: ""
|
||||
licenseLink: ""
|
||||
sitelink: http://kieranhealy.org
|
||||
sourceLink: http://github.com/kjhealy/kieranhealy.hugo
|
||||
sitelink: http://kieranhealy.org/
|
||||
sourceLink: https://github.com/kjhealy/kieranhealy.hugo
|
||||
tags:
|
||||
- personal
|
||||
- blog
|
||||
|
|
|
@ -3,7 +3,7 @@ date: 2014-11-01T07:32:00Z
|
|||
description: Corporate Site for Launchcode Software Studios
|
||||
license: Copyright Launchcode Software Studios
|
||||
licenseLink: ""
|
||||
sitelink: http://www.launchcode5.com
|
||||
sitelink: http://www.launchcode5.com/
|
||||
sourceLink: https://github.com/Launchcode5/launchcode5.com
|
||||
tags:
|
||||
- bootstrap
|
||||
|
|
|
@ -3,7 +3,7 @@ date: 2014-08-21T12:21:18-04:00
|
|||
description: ""
|
||||
license: ""
|
||||
licenseLink: ""
|
||||
sitelink: http://npf.io
|
||||
sitelink: http://npf.io/
|
||||
sourceLink: https://github.com/natefinch/npf
|
||||
tags:
|
||||
- personal
|
||||
|
|
|
@ -3,8 +3,8 @@ date: 2013-07-01T07:32:00Z
|
|||
description: The first Hugo powered website.
|
||||
license: MIT
|
||||
licenseLink: ""
|
||||
sitelink: http://spf13.com
|
||||
sourceLink: http://github.com/spf13/spf13.com
|
||||
sitelink: http://spf13.com/
|
||||
sourceLink: https://github.com/spf13/spf13.com
|
||||
tags:
|
||||
- personal
|
||||
- blog
|
||||
|
|
|
@ -3,8 +3,8 @@ date: 2014-11-23T01:28:16+07:00
|
|||
description: "Rasmus Stougaard"
|
||||
license: ""
|
||||
licenseLink: ""
|
||||
sitelink: http://stou.dk
|
||||
sourceLink: "http://github.com/stou/stou.github.io"
|
||||
sitelink: http://stou.dk/
|
||||
sourceLink: "https://github.com/stou/stou.github.io"
|
||||
tags:
|
||||
- personal
|
||||
- blog
|
||||
|
|
|
@ -3,7 +3,7 @@ date: 2014-05-22T19:54:00Z
|
|||
description: Tech Coaching site
|
||||
license: ""
|
||||
licenseLink: ""
|
||||
sitelink: http://techmadeplain.com
|
||||
sitelink: http://techmadeplain.com/
|
||||
tags:
|
||||
- personal
|
||||
- blog
|
||||
|
|
|
@ -3,7 +3,7 @@ date: 2014-12-27T20:00:00+07:00
|
|||
description: "Tom Helmer Hansen"
|
||||
license: ""
|
||||
licenseLink: ""
|
||||
sitelink: http://www.thehome.dk
|
||||
sitelink: http://www.thehome.dk/
|
||||
sourceLink: "https://github.com/tomhelmer/website-source"
|
||||
tags:
|
||||
- personal
|
||||
|
|
|
@ -14,7 +14,7 @@ weight: 20
|
|||
|
||||
There are four common ways you can display the data in your
|
||||
taxonomies in addition to the automatic taxonomy pages created by hugo
|
||||
using the [list templates](/templates/list):
|
||||
using the [list templates](/templates/list/):
|
||||
|
||||
1. For a given piece of content, you can list the terms attached
|
||||
2. For a given piece of content, you can list other content with the same
|
||||
|
|
|
@ -48,7 +48,7 @@ and assign all terms you want to apply to this content.
|
|||
categories = [ "Development" ]
|
||||
series = [ "Go Web Dev" ]
|
||||
slug = "hugo"
|
||||
project_url = "http://github.com/spf13/hugo"
|
||||
project_url = "https://github.com/spf13/hugo"
|
||||
+++
|
||||
|
||||
### Front Matter Example (in JSON)
|
||||
|
@ -68,5 +68,5 @@ and assign all terms you want to apply to this content.
|
|||
"Go Web Dev"
|
||||
],
|
||||
"slug": "hugo",
|
||||
"project_url": "http://github.com/spf13/hugo"
|
||||
"project_url": "https://github.com/spf13/hugo"
|
||||
}
|
||||
|
|
|
@ -23,10 +23,10 @@ rendering a specific page.
|
|||
Hugo will use the following prioritized list. If a file isn’t present,
|
||||
then the next one in the list will be used. This enables you to craft
|
||||
specific layouts when you want to without creating more templates
|
||||
than necessary. For most sites only the \_default file at the end of
|
||||
than necessary. For most sites, only the `_default` file at the end of
|
||||
the list will be needed.
|
||||
|
||||
Users can specify the `type` and `layout` in the [front-matter](/content/front-matter). `Section`
|
||||
Users can specify the `type` and `layout` in the [front-matter](/content/front-matter/). `Section`
|
||||
is determined based on the content file’s location. If `type` is provide,
|
||||
it will be used instead of `section`.
|
||||
|
||||
|
@ -62,8 +62,8 @@ same as the other types, but the directory must be called "\_default".
|
|||
|
||||
|
||||
## post/single.html
|
||||
This content template is used for [spf13.com](http://spf13.com).
|
||||
It makes use of [partial templates](/layout/partials)
|
||||
This content template is used for [spf13.com](http://spf13.com/).
|
||||
It makes use of [partial templates](/layout/partials/)
|
||||
|
||||
{{ partial "header.html" . }}
|
||||
{{ partial "subheader.html" . }}
|
||||
|
@ -110,8 +110,8 @@ It makes use of [partial templates](/layout/partials)
|
|||
|
||||
|
||||
## project/single.html
|
||||
This content template is used for [spf13.com](http://spf13.com).
|
||||
It makes use of [partial templates](/layout/partials)
|
||||
This content template is used for [spf13.com](http://spf13.com/).
|
||||
It makes use of [partial templates](/layout/partials/)
|
||||
|
||||
|
||||
{{ partial "header.html" . }}
|
||||
|
@ -158,4 +158,4 @@ Notice how the project/single.html template uses an additional parameter unique
|
|||
to this template. This doesn't need to be defined ahead of time. If the key is
|
||||
present in the front matter than it can be used in the template. To
|
||||
easily generate new content of this type with these keys ready use
|
||||
[content archetypes](/content/archetypes).
|
||||
[content archetypes](/content/archetypes/).
|
||||
|
|
|
@ -397,7 +397,7 @@ Converts the textual representation of the datetime into the other form or retur
|
|||
e.g. `{{ dateFormat "Monday, Jan 2, 2006" "2015-01-21" }}` →"Wednesday, Jan 21, 2015"
|
||||
|
||||
### highlight
|
||||
Take a string of code and a language, uses Pygments to return the syntax highlighted code in HTML. Used in the [highlight shortcode](/extras/highlighting).
|
||||
Take a string of code and a language, uses Pygments to return the syntax highlighted code in HTML. Used in the [highlight shortcode](/extras/highlighting/).
|
||||
|
||||
### ref, relref
|
||||
Looks up a content page by relative path or logical name to return the permalink (`ref`) or relative permalink (`relref`). Requires a Node or Page object (usually satisfied with `.`). Used in the [`ref` and `relref` shortcodes]({{% ref "extras/crossreferences.md" %}}).
|
||||
|
|
|
@ -65,7 +65,7 @@ Accessing the Page Parameter "bar"
|
|||
Each Go template has a struct (object) made available to it. In Hugo, each
|
||||
template is passed either a page or a node struct depending on which type of
|
||||
page you are rendering. More details are available on the
|
||||
[variables](/layout/variables) page.
|
||||
[variables](/layout/variables/) page.
|
||||
|
||||
A variable is accessed by referencing the variable name.
|
||||
|
||||
|
@ -82,7 +82,7 @@ Variables can also be defined and referenced.
|
|||
Go template ships with a few functions which provide basic functionality. The Go
|
||||
template system also provides a mechanism for applications to extend the
|
||||
available functions with their own. [Hugo template
|
||||
functions](/layout/functions) provide some additional functionality we believe
|
||||
functions](/layout/functions/) provide some additional functionality we believe
|
||||
are useful for building websites. Functions are called by using their name
|
||||
followed by the required parameters separated by spaces. Template
|
||||
functions cannot be added without recompiling Hugo.
|
||||
|
@ -303,7 +303,7 @@ you want to inside of your templates.
|
|||
## Using Content (page) Parameters
|
||||
|
||||
In each piece of content, you can provide variables to be used by the
|
||||
templates. This happens in the [front matter](/content/front-matter).
|
||||
templates. This happens in the [front matter](/content/front-matter/).
|
||||
|
||||
An example of this is used in this documentation site. Most of the pages
|
||||
benefit from having the table of contents provided. Sometimes the TOC just
|
||||
|
|
|
@ -45,9 +45,9 @@ the list will be needed.
|
|||
* /themes/`THEME`/layouts/\_default/single.html
|
||||
|
||||
## Example index.html
|
||||
This content template is used for [spf13.com](http://spf13.com).
|
||||
This content template is used for [spf13.com](http://spf13.com/).
|
||||
|
||||
It makes use of [partial templates](/templates/partials) and uses a similar approach as a [List](/templates/list/).
|
||||
It makes use of [partial templates](/templates/partials/) and uses a similar approach as a [List](/templates/list/).
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html class="no-js" lang="en-US" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#">
|
||||
|
|
|
@ -13,7 +13,7 @@ weight: 40
|
|||
---
|
||||
|
||||
A list template is any template that will be used to render multiple pieces of
|
||||
content in a single HTML page (with the exception of the [homepage](/layout/homepage) which has a
|
||||
content in a single HTML page (with the exception of the [homepage](/layout/homepage/) which has a
|
||||
dedicated template).
|
||||
|
||||
We are using the term list in its truest sense, a sequential arrangement
|
||||
|
@ -102,8 +102,8 @@ Taxonomy pages will additionally have:
|
|||
## Example List Template Pages
|
||||
|
||||
### Example section template (post.html)
|
||||
This content template is used for [spf13.com](http://spf13.com).
|
||||
It makes use of [partial templates](/templates/partials). All examples use a
|
||||
This content template is used for [spf13.com](http://spf13.com/).
|
||||
It makes use of [partial templates](/templates/partials/). All examples use a
|
||||
[view](/templates/views/) called either "li" or "summary" which this example site
|
||||
defined.
|
||||
|
||||
|
@ -124,8 +124,8 @@ defined.
|
|||
{{ partial "footer.html" . }}
|
||||
|
||||
### Example taxonomy template (tag.html)
|
||||
This content template is used for [spf13.com](http://spf13.com).
|
||||
It makes use of [partial templates](/templates/partials). All examples use a
|
||||
This content template is used for [spf13.com](http://spf13.com/).
|
||||
It makes use of [partial templates](/templates/partials/). All examples use a
|
||||
[view](/templates/views/) called either "li" or "summary" which this example site
|
||||
defined.
|
||||
|
||||
|
@ -146,7 +146,7 @@ defined.
|
|||
## Ordering Content
|
||||
|
||||
In the case of Hugo each list will render the content based on metadata provided in the [front
|
||||
matter](/content/front-matter). See [ordering content](/content/ordering) for more information.
|
||||
matter](/content/front-matter/). See [ordering content](/content/ordering/) for more information.
|
||||
|
||||
Here are a variety of different ways you can order the content items in
|
||||
your list templates:
|
||||
|
|
|
@ -23,23 +23,23 @@ While Hugo has a number of different template roles, most complete
|
|||
websites can be built using just a small number of template files.
|
||||
Please don’t be afraid of the variety of different template roles. They
|
||||
enable Hugo to build very complicated sites. Most sites will only
|
||||
need to create a [/layouts/\_default/single.html](/templates/content) & [/layouts/\_default/list.html](/templates/list)
|
||||
need to create a [/layouts/\_default/single.html](/templates/content/) & [/layouts/\_default/list.html](/templates/list/)
|
||||
|
||||
If you are new to Go's templates, the [Go Template Primer](/layout/go-templates)
|
||||
If you are new to Go's templates, the [Go Template Primer](/layout/go-templates/)
|
||||
is a great place to start.
|
||||
|
||||
If you are familiar with Go’s templates, Hugo provides some [additional
|
||||
template functions](/templates/functions) and [variables](/templates/variables) you will want to be familiar
|
||||
template functions](/templates/functions/) and [variables](/templates/variables/) you will want to be familiar
|
||||
with.
|
||||
|
||||
## Primary Template roles
|
||||
|
||||
There are 3 primary kinds of templates that Hugo works with.
|
||||
|
||||
### [Single](/templates/content)
|
||||
### [Single](/templates/content/)
|
||||
Render a single piece of content
|
||||
|
||||
### [List](/templates/list)
|
||||
### [List](/templates/list/)
|
||||
Page that list multiple pieces of content
|
||||
|
||||
### [Homepage](/templates/homepage/)
|
||||
|
@ -49,13 +49,13 @@ The homepage of your site
|
|||
|
||||
Hugo also has additional kinds of templates all of which are optional
|
||||
|
||||
### [Partial Templates](/templates/partials)
|
||||
### [Partial Templates](/templates/partials/)
|
||||
Common page parts to be included in the above mentioned templates
|
||||
|
||||
### [Content Views](/templates/views)
|
||||
### [Content Views](/templates/views/)
|
||||
Different ways of rendering a (single) content type
|
||||
|
||||
### [Taxonomy Terms](/templates/terms)
|
||||
### [Taxonomy Terms](/templates/terms/)
|
||||
A list of the terms used for a specific taxonomy, e.g. a Tag cloud
|
||||
|
||||
## Other Templates (generally unnecessary)
|
||||
|
@ -66,7 +66,7 @@ Used to render all rss documents
|
|||
### [Sitemap](/templates/sitemap/)
|
||||
Used to render the XML sitemap
|
||||
|
||||
### [404](/templates/404)
|
||||
### [404](/templates/404/)
|
||||
This template will create a 404.html page used when hosting on GitHub Pages
|
||||
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ the “partial/” path). The old approach would still work, but wouldn’t bene
|
|||
the ability to have users override the partial theme file with local layouts.
|
||||
|
||||
## Example header.html
|
||||
This header template is used for [spf13.com](http://spf13.com):
|
||||
This header template is used for [spf13.com](http://spf13.com/):
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html class="no-js" lang="en-US" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#">
|
||||
|
@ -70,7 +70,7 @@ This header template is used for [spf13.com](http://spf13.com):
|
|||
<body lang="en">
|
||||
|
||||
## Example footer.html
|
||||
This footer template is used for [spf13.com](http://spf13.com):
|
||||
This footer template is used for [spf13.com](http://spf13.com/):
|
||||
|
||||
<footer>
|
||||
<div>
|
||||
|
@ -100,4 +100,4 @@ This footer template is used for [spf13.com](http://spf13.com):
|
|||
</html>
|
||||
|
||||
**For examples of referencing these templates, see [single content
|
||||
templates](/templates/content), [list templates](/templates/list) and [homepage templates](/templates/homepage).**
|
||||
templates](/templates/content/), [list templates](/templates/list/) and [homepage templates](/templates/homepage/).**
|
||||
|
|
|
@ -25,7 +25,7 @@ rendering a specific page.
|
|||
Hugo will use the following prioritized list. If a file isn’t present,
|
||||
then the next one in the list will be used. This enables you to craft
|
||||
specific layouts when you want to without creating more templates
|
||||
than necessary. For most sites only the \_default file at the end of
|
||||
than necessary. For most sites, only the `_default` file at the end of
|
||||
the list will be needed.
|
||||
|
||||
A Taxonomy Terms List will be rendered at /`PLURAL`/
|
||||
|
@ -34,16 +34,18 @@ A Taxonomy Terms List will be rendered at /`PLURAL`/
|
|||
* /layouts/\_default/terms.html
|
||||
|
||||
If that neither file is found in either the /layouts or /theme/layouts
|
||||
directory than hugo will not render the taxonomy terms pages. It is also
|
||||
directory, then Hugo will not render the taxonomy terms pages. It is also
|
||||
common for people to render taxonomy terms lists on other pages such as
|
||||
the homepage or the sidebar (such as a tag cloud) and not have a
|
||||
dedicated page for the terms.
|
||||
|
||||
|
||||
## Variables
|
||||
|
||||
Taxonomy Terms pages are of the type "node" and have all the [node
|
||||
variables](/templates/variables/) and [site
|
||||
variables](/templates/variables/) available to use in the templates.
|
||||
Taxonomy Terms pages are of the type "node" and have all the
|
||||
[node variables](/templates/variables/) and
|
||||
[site variables](/templates/variables/)
|
||||
available to use in the templates.
|
||||
|
||||
Taxonomy Terms pages will additionally have:
|
||||
|
||||
|
@ -53,19 +55,20 @@ Taxonomy Terms pages will additionally have:
|
|||
* **.Data.Terms.Alphabetical** The Terms alphabetized
|
||||
* **.Data.Terms.ByCount** The Terms ordered by popularity
|
||||
|
||||
## Example terms.html file
|
||||
### Example terms.html files
|
||||
|
||||
List pages are of the type "node" and have all the [node
|
||||
variables](/templates/variables/) and [site
|
||||
variables](/templates/variables/) available to use in the templates.
|
||||
List pages are of the type "node" and have all the
|
||||
[node variables](/templates/variables/) and
|
||||
[site variables](/templates/variables/)
|
||||
available to use in the templates.
|
||||
|
||||
This content template is used for [spf13.com](http://spf13.com).
|
||||
It makes use of [partial templates](/templates/partials). The list of indexes
|
||||
templates cannot use a [content view](/templates/views) as they don't display the content, but
|
||||
This content template is used for [spf13.com](http://spf13.com/).
|
||||
It makes use of [partial templates](/templates/partials/). The list of indexes
|
||||
templates cannot use a [content view](/templates/views/) as they don't display the content, but
|
||||
rather information about the content.
|
||||
|
||||
This particular template lists all of the Tags used on
|
||||
[spf13.com](http://spf13.com) and provides a count for the number of pieces of
|
||||
[spf13.com](http://spf13.com/) and provides a count for the number of pieces of
|
||||
content tagged with each tag.
|
||||
|
||||
`.Data.Terms` is an map of terms ⇒ [contents]
|
||||
|
@ -75,12 +78,12 @@ content tagged with each tag.
|
|||
|
||||
<section id="main">
|
||||
<div>
|
||||
<h1 id="title">{{ .Title }}</h1>
|
||||
<h1 id="title">{{ .Title }}</h1>
|
||||
|
||||
<ul>
|
||||
{{ $data := .Data }}
|
||||
<ul>
|
||||
{{ $data := .Data }}
|
||||
{{ range $key, $value := .Data.Terms }}
|
||||
<li><a href="{{ $data.Plural }}/{{ $key | urlize }}"> {{ $key }} </a> {{ len $value }} </li>
|
||||
<li><a href="{{ $data.Plural }}/{{ $key | urlize }}">{{ $key }}</a> {{ len $value }}</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -89,25 +92,22 @@ content tagged with each tag.
|
|||
{{ partial "footer.html" }}
|
||||
|
||||
|
||||
Another example listing the content for each term (ordered by Date)
|
||||
|
||||
Another example listing the content for each term (ordered by Date):
|
||||
|
||||
{{ partial "header.html" . }}
|
||||
{{ partial "subheader.html" . }}
|
||||
|
||||
<section id="main">
|
||||
<div>
|
||||
<h1 id="title">{{ .Title }}</h1>
|
||||
<h1 id="title">{{ .Title }}</h1>
|
||||
|
||||
{{ $data := .Data }}
|
||||
{{ range $key,$value := .Data.Terms.ByCount }}
|
||||
<h2><a href="{{ $data.Plural }}/{{ $value.Name | urlize }}"> {{ $value.Name }} </a> {{ $value.Count }} </h2>
|
||||
<h2><a href="{{ $data.Plural }}/{{ $value.Name | urlize }}">{{ $value.Name }}</a> {{ $value.Count }}</h2>
|
||||
<ul>
|
||||
{{ range $value.Pages.ByDate }}
|
||||
<li>
|
||||
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ range $value.Pages.ByDate }}
|
||||
<li><a href="{{ .Permalink }}">{{ .Title }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
@ -115,46 +115,47 @@ Another example listing the content for each term (ordered by Date)
|
|||
|
||||
{{ partial "footer.html" }}
|
||||
|
||||
|
||||
## Ordering
|
||||
|
||||
Hugo can order the meta data in two different ways. It can be ordered by the
|
||||
number of content assigned to that key or alphabetically.
|
||||
Hugo can order the meta data in two different ways. It can be ordered:
|
||||
|
||||
* by the number of contents assigned to that key, or
|
||||
* alphabetically.
|
||||
|
||||
## Example indexes.html file (alphabetical)
|
||||
### Example terms.html file (alphabetical)
|
||||
|
||||
{{ partial "header.html" . }}
|
||||
{{ partial "subheader.html" . }}
|
||||
|
||||
<section id="main">
|
||||
<div>
|
||||
<h1 id="title">{{ .Title }}</h1>
|
||||
<ul>
|
||||
{{ $data := .Data }}
|
||||
<h1 id="title">{{ .Title }}</h1>
|
||||
<ul>
|
||||
{{ $data := .Data }}
|
||||
{{ range $key, $value := .Data.Terms.Alphabetical }}
|
||||
<li><a href="{{ $data.Plural }}/{{ $value.Name | urlize }}"> {{ $value.Name }} </a> {{ $value.Count }} </li>
|
||||
<li><a href="{{ $data.Plural }}/{{ $value.Name | urlize }}">{{ $value.Name }}</a> {{ $value.Count }}</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
{{ partial "footer.html" }}
|
||||
|
||||
## Example indexes.html file (ordered)
|
||||
### Example terms.html file (ordered by popularity)
|
||||
|
||||
{{ partial "header.html" . }}
|
||||
{{ partial "subheader.html" . }}
|
||||
|
||||
<section id="main">
|
||||
<div>
|
||||
<h1 id="title">{{ .Title }}</h1>
|
||||
<ul>
|
||||
{{ $data := .Data }}
|
||||
<h1 id="title">{{ .Title }}</h1>
|
||||
<ul>
|
||||
{{ $data := .Data }}
|
||||
{{ range $key, $value := .Data.Terms.ByCount }}
|
||||
<li><a href="{{ $data.Plural }}/{{ $value.Name | urlize }}"> {{ $value.Name }} </a> {{ $value.Count }} </li>
|
||||
<li><a href="{{ $data.Plural }}/{{ $value.Name | urlize }}">{{ $value.Name }}</a> {{ $value.Count }}</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{{ partial "footer.html" }}
|
||||
|
||||
|
|
|
@ -34,9 +34,9 @@ matter, content or derived from file location.
|
|||
**.Section** The [section](/content/sections/) this content belongs to.<br>
|
||||
**.Permalink** The Permanent link for this page.<br>
|
||||
**.RelPermalink** The Relative permanent link for this page.<br>
|
||||
**.LinkTitle** Access when creating links to this content. Will use linktitle if set in front-matter, else title.<br>
|
||||
**.LinkTitle** Access when creating links to this content. Will use `linktitle` if set in front matter, else `title`.<br>
|
||||
**.Taxonomies** These will use the field name of the plural form of the index (see tags and categories above).<br>
|
||||
**.RSSLink** Link to the indexes' rss link.<br>
|
||||
**.RSSLink** Link to the indexes' RSS link.<br>
|
||||
**.TableOfContents** The rendered table of contents for this content.<br>
|
||||
**.Prev** Pointer to the previous content (based on pub date).<br>
|
||||
**.Next** Pointer to the following content (based on pub date).<br>
|
||||
|
@ -48,35 +48,35 @@ matter, content or derived from file location.
|
|||
**.Weight** Assigned weight (in the front matter) to this content, used in sorting.<br>
|
||||
**.IsNode** Always false for pages.<br>
|
||||
**.IsPage** Always true for page.<br>
|
||||
**.Site** See site variables below.<br>
|
||||
**.Hugo** See Hugo variables below<br>
|
||||
**.Site** See [Site Variables]({{< relref "#site-variables" >}}) below.<br>
|
||||
**.Hugo** See [Hugo Variables]({{< relref "#hugo-variables" >}}) below.<br>
|
||||
|
||||
## Page Params
|
||||
|
||||
Any other value defined in the front matter, including indexes will be made available under `.Params`.
|
||||
Take for example I'm using tags and categories as my indexes. The following would be how I would access them:
|
||||
|
||||
**.Params.tags** <br>
|
||||
**.Params.categories** <br>
|
||||
<br>
|
||||
**All Params are only accessible using all lowercase characters**<br>
|
||||
* **.Params.tags**
|
||||
* **.Params.categories**
|
||||
|
||||
**All Params are only accessible using all lowercase characters.**
|
||||
|
||||
## Node Variables
|
||||
In Hugo a node is any page not rendered directly by a content file. This
|
||||
In Hugo, a node is any page not rendered directly by a content file. This
|
||||
includes indexes, lists and the homepage.
|
||||
|
||||
**.Title** The title for the content.<br>
|
||||
**.Date** The date the content is published on.<br>
|
||||
**.Permalink** The Permanent link for this node<br>
|
||||
**.Url** The relative url for this node.<br>
|
||||
**.Url** The relative URL for this node.<br>
|
||||
**.Ref(ref)** Returns the permalink for `ref`. See [cross-references]({{% ref "extras/crossreferences.md" %}}). Does not handle in-page fragments correctly.<br>
|
||||
**.RelRef(ref)** Returns the relative permalink for `ref`. See [cross-references]({{% ref "extras/crossreferences.md" %}}). Does not handle in-page fragments correctly.<br>
|
||||
**.RSSLink** Link to the indexes' rss link <br>
|
||||
**.RSSLink** Link to the indexes' RSS link.<br>
|
||||
**.Data** The data specific to this type of node.<br>
|
||||
**.IsNode** Always true for nodes.<br>
|
||||
**.IsPage** Always false for nodes.<br>
|
||||
**.Site** See site variables below<br>
|
||||
**.Hugo** See site variables below<br>
|
||||
**.Site** See [Site Variables]({{< relref "#site-variables" >}}) below.<br>
|
||||
**.Hugo** See [Hugo Variables]({{< relref "#hugo-variables" >}}) below.<br>
|
||||
|
||||
## Site Variables
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ weight: 70
|
|||
---
|
||||
|
||||
In addition to the [single content template](/templates/content/), Hugo can render alternative views of
|
||||
your content. These are especially useful in [list templates](/templates/list).
|
||||
your content. These are especially useful in [list templates](/templates/list/).
|
||||
|
||||
For example you may want content of every type to be shown on the
|
||||
homepage, but only a summary view of it there. Perhaps on a taxonomy
|
||||
|
@ -27,7 +27,7 @@ To create a new view, simply create a template in each of your different
|
|||
content type directories with the view name. In the following example, we
|
||||
have created a "li" view and a "summary" view for our two content types
|
||||
of post and project. As you can see, these sit next to the [single
|
||||
content view](/templates/content) template "single.html". You can even
|
||||
content view](/templates/content/) 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.
|
||||
|
||||
|
@ -75,7 +75,7 @@ the list will be needed.
|
|||
### rendering view inside of a list
|
||||
|
||||
Using the summary view (defined below) inside of a ([list
|
||||
templates](/templates/list)).
|
||||
templates](/templates/list/)).
|
||||
|
||||
<section id="main">
|
||||
<div>
|
||||
|
@ -96,9 +96,9 @@ change the render line to `{{ .Render "li" }}`.
|
|||
### li.html
|
||||
|
||||
Hugo will pass the entire page object to the view template. See [page
|
||||
variables](/templates/variables) for a complete list.
|
||||
variables](/templates/variables/) for a complete list.
|
||||
|
||||
This content template is used for [spf13.com](http://spf13.com).
|
||||
This content template is used for [spf13.com](http://spf13.com/).
|
||||
|
||||
<li>
|
||||
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
|
@ -108,9 +108,9 @@ This content template is used for [spf13.com](http://spf13.com).
|
|||
### summary.html
|
||||
|
||||
Hugo will pass the entire page object to the view template. See [page
|
||||
variables](/templates/variables) for a complete list.
|
||||
variables](/templates/variables/) for a complete list.
|
||||
|
||||
This content template is used for [spf13.com](http://spf13.com).
|
||||
This content template is used for [spf13.com](http://spf13.com/).
|
||||
|
||||
<article class="post">
|
||||
<header>
|
||||
|
|
|
@ -21,7 +21,7 @@ to Go, the [Go template primer](/layout/go-templates/) will help you get started
|
|||
## Theme Components
|
||||
|
||||
A theme consists of templates and static assets such as javascript and css
|
||||
files. Themes can also optionally provide [archetypes](/content/archetypes)
|
||||
files. Themes can also optionally provide [archetypes](/content/archetypes/)
|
||||
which are archetypal content types used by the `hugo new` command.
|
||||
|
||||
### Layouts
|
||||
|
@ -43,7 +43,7 @@ The default list file layout is located at `layouts/_default/list.html`.
|
|||
|
||||
### Partial Templates
|
||||
|
||||
Theme creators should liberally use [partial templates](/templates/partials)
|
||||
Theme creators should liberally use [partial templates](/templates/partials/)
|
||||
throughout their theme files. Not only is a good DRY practice to include shared
|
||||
code, but partials are a special template type that enables the themes end user
|
||||
to be able to overwrite just a small piece of a file or inject code into the
|
||||
|
@ -66,7 +66,7 @@ The actual structure is entirely up to you, the theme creator, on how you would
|
|||
|
||||
### Archetypes
|
||||
|
||||
If your theme makes use of specific keys in the front matter it is a good idea
|
||||
If your theme makes use of specific keys in the front matter, it is a good idea
|
||||
to provide an archetype for each content type you have. Archetypes follow the
|
||||
[guidelines provided](/content/archetypes).
|
||||
[guidelines provided](/content/archetypes/).
|
||||
|
||||
|
|
|
@ -26,12 +26,12 @@ in the same relative path `/static/js/jquery.min.js`.
|
|||
Anytime Hugo looks for a matching template, it will first check the
|
||||
working directory before looking in the theme directory. If you would
|
||||
like to modify a template, simply create that template in your local
|
||||
`layouts` directory. In the [template documentation](/templates/overview)
|
||||
`layouts` directory. In the [template documentation](/templates/overview/)
|
||||
each different template type explains the rules it uses to determine
|
||||
which template to use.
|
||||
|
||||
This is especially helpful when the theme creator used [partial
|
||||
templates](/templates/partials). These partial templates are perfect for easy
|
||||
templates](/templates/partials/). These partial templates are perfect for easy
|
||||
injection into the theme with minimal maintenance to ensure future
|
||||
compatibility.
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ weight: 20
|
|||
---
|
||||
|
||||
Hugo themes are located in a centralized GitHub repository. The [Hugo Themes
|
||||
Repo](http://github.com/spf13/hugoThemes) itself is really a meta
|
||||
Repo](https://github.com/spf13/hugoThemes) itself is really a meta
|
||||
repository which contains pointers to set of contributed themes.
|
||||
|
||||
## Installing all themes
|
||||
|
|
|
@ -18,7 +18,7 @@ site.
|
|||
Hugo themes have been designed to be the perfect balance between
|
||||
simplicity and functionality. Hugo themes are powered by the excellent
|
||||
Go template library. If you are new to Go templates, see our [primer on
|
||||
Go templates](/templates/go-templates).
|
||||
Go templates](/templates/go-templates/).
|
||||
|
||||
Hugo themes support all modern features you come to expect. They are
|
||||
structured in such a way to eliminate code duplication. Themes are also
|
||||
|
|
|
@ -19,4 +19,4 @@ To use a theme for a site:
|
|||
The *ThemeName* must match the name of the directory inside `/themes`.
|
||||
|
||||
Hugo will then apply the theme first, then apply anything that is in the local
|
||||
directory. To learn more, go to [customizing themes](/themes/customizing).
|
||||
directory. To learn more, go to [customizing themes](/themes/customizing/).
|
||||
|
|
|
@ -29,7 +29,7 @@ As our goal is to host a website using GitHub Pages, it is natural for us to hos
|
|||
|
||||
### Write a `config.yaml` File
|
||||
|
||||
The very first step in creating a new Hugo site is to [write the config file](/overview/configuration). This config file is important for at least two reasons: (1) this is where site-wide settings (like the websites `baseurl`) go and (2) the config file dictates to some extent how Hugo will generate the website. For the example website I created a file `config.yaml` with the following contents
|
||||
The very first step in creating a new Hugo site is to [write the config file](/overview/configuration/). This config file is important for at least two reasons: (1) this is where site-wide settings (like the websites `baseurl`) go, and (2) the config file dictates to some extent how Hugo will generate the website. For the example website I created a file `config.yaml` with the following contents
|
||||
|
||||
---
|
||||
contentdir: "content"
|
||||
|
@ -63,7 +63,7 @@ Hugo assumes that you organize the content of your site in a meaningful way and
|
|||
|
||||
### Create HTML Templates
|
||||
|
||||
The next step is to define the look and feel of your new website. Because Hugo will generate the site using HTML templates written by the user (you), this step is very subjective. I will merely present one possible theme that could be used to generate a blog. I decided to base the example project on a Jekyll theme called [Lanyon](http://lanyon.getpoole.com). The Lanyon theme is pure CSS and a slightly modified version of the CSS is in the `/static/css` directory of the example repository. If you are following along, you should grab the `static` folder from the example repository and put it alongside the `content` folder you just created.
|
||||
The next step is to define the look and feel of your new website. Because Hugo will generate the site using HTML templates written by the user (you), this step is very subjective. I will merely present one possible theme that could be used to generate a blog. I decided to base the example project on a Jekyll theme called [Lanyon](http://lanyon.getpoole.com/). The Lanyon theme is pure CSS and a slightly modified version of the CSS is in the `/static/css` directory of the example repository. If you are following along, you should grab the `static` folder from the example repository and put it alongside the `content` folder you just created.
|
||||
|
||||
Because there are so many files needed to fully compose a complete website, I will not be able to go through each of them here. I will, however, show what the directory structure should look like when all is said and done:
|
||||
|
||||
|
@ -95,7 +95,7 @@ Each of the files in the example repository is well commented with a description
|
|||
|
||||
### Add Some Content
|
||||
|
||||
The final step in creating the blog is to add some actual blog posts. To do this, simply create one Markdown file (with extension `.md`) for each new blog post. At the top of each file you should include a metadata section that tells Hugo some things about the post (see [docs](/content/front-matter)). For example, consider the yaml metadata section from the top of the file `/content/posts/newest.md` from the example repository:
|
||||
The final step in creating the blog is to add some actual blog posts. To do this, simply create one Markdown file (with extension `.md`) for each new blog post. At the top of each file you should include a metadata section that tells Hugo some things about the post (see [docs](/content/front-matter/)). For example, consider the yaml metadata section from the top of the file `/content/posts/newest.md` from the example repository:
|
||||
|
||||
---
|
||||
title: "Just another sample post"
|
||||
|
@ -171,7 +171,7 @@ Now, as you add new posts to your blog, you will follow steps that look somethin
|
|||
* Push the `master` branch
|
||||
* Push the public subtree to the remote `gh-pages` branch
|
||||
|
||||
The first two items in the previous list are simply a way to conveniently preview your content as you write. This is a dynamic and fairly streamlined process. All the remaining items, however, are the same every time you want to add new content to the website. To make this repetitive process easier, I have adapted a script from the source repository for the [Chimer Arts & Maker Space](https://github.com/chimera/chimeraarts.org) website that is highlighted in the [Hugo Showcase](/showcase). The script lives in a file called `deploy.sh` and has the following contents:
|
||||
The first two items in the previous list are simply a way to conveniently preview your content as you write. This is a dynamic and fairly streamlined process. All the remaining items, however, are the same every time you want to add new content to the website. To make this repetitive process easier, I have adapted a script from the source repository for the [Chimer Arts & Maker Space](https://github.com/chimera/chimeraarts.org) website that is highlighted in the [Hugo Showcase](/showcase/). The script lives in a file called `deploy.sh` and has the following contents:
|
||||
|
||||
**Note:**
|
||||
|
||||
|
@ -284,8 +284,8 @@ cd ..
|
|||
```
|
||||
7. `./deploy.sh "Your optional commit message"` to send changes to `<username>.github.io` (careful, you may also want to commit changes on the `<your-project>-hugo` repo).
|
||||
|
||||
That's it! Your personal page is running at [http://username.github.io](http://username.github.io) (after up to 10 minutes delay).
|
||||
That's it! Your personal page is running at [http://username.github.io/](http://username.github.io/) (after up to 10 minutes delay).
|
||||
|
||||
## Conclusion
|
||||
|
||||
Hopefully this tutorial helped you get your website off its feet and out into the open! If you have any further questions, feel free to contact the community through the [discussion forum](/community/mailing-list).
|
||||
Hopefully this tutorial helped you get your website off its feet and out into the open! If you have any further questions, feel free to contact the community through the [discussion forum](/community/mailing-list/).
|
||||
|
|
|
@ -10,7 +10,7 @@ weight: 10
|
|||
---
|
||||
|
||||
## Move static content to `static`
|
||||
Jekyll has a rule that any directory not starting with `_` will be copied as-is to the `_site` output. Hugo keeps all static content under `static`. You should therefore move it all there.
|
||||
Jekyll has a rule that any directory not starting with `_` will be copied as-is to the `_site` output. Hugo keeps all static content under `static`. You should therefore move it all there.
|
||||
With Jekyll, something that looked like
|
||||
|
||||
▾ <root>/
|
||||
|
@ -47,9 +47,9 @@ The default is for Jekyll to publish to `_site` and for Hugo to publish to `publ
|
|||
}
|
||||
|
||||
## Convert Jekyll templates to Hugo templates
|
||||
That's the bulk of the work right here. The documentation is your friend. You should refer to [Jekyll's template documentation](http://jekyllrb.com/docs/templates/) if you need to refresh your memory on how you built your blog and [Hugo's template](/layout/templates/) to learn Hugo's way.
|
||||
That's the bulk of the work right here. The documentation is your friend. You should refer to [Jekyll's template documentation](http://jekyllrb.com/docs/templates/) if you need to refresh your memory on how you built your blog and [Hugo's template](/layout/templates/) to learn Hugo's way.
|
||||
|
||||
As a single reference data point, converting my templates for [heyitsalex.net](http://heyitsalex.net) took me no more than a few hours.
|
||||
As a single reference data point, converting my templates for [heyitsalex.net](http://heyitsalex.net/) took me no more than a few hours.
|
||||
|
||||
## Convert Jekyll plugins to Hugo shortcodes
|
||||
Jekyll has [plugins](http://jekyllrb.com/docs/plugins/); Hugo has [shortcodes](/doc/shortcodes/). It's fairly trivial to do a port.
|
||||
|
@ -66,11 +66,11 @@ Jekyll's plugin:
|
|||
@class = nil
|
||||
@link = nil
|
||||
// Patterns
|
||||
IMAGE_URL_WITH_CLASS_AND_CAPTION =
|
||||
IMAGE_URL_WITH_CLASS_AND_CAPTION =
|
||||
IMAGE_URL_WITH_CLASS_AND_CAPTION_AND_LINK = /(\w+)(\s+)((https?:\/\/|\/)(\S+))(\s+)"(.*?)"(\s+)->((https?:\/\/|\/)(\S+))(\s*)/i
|
||||
IMAGE_URL_WITH_CAPTION = /((https?:\/\/|\/)(\S+))(\s+)"(.*?)"/i
|
||||
IMAGE_URL_WITH_CLASS = /(\w+)(\s+)((https?:\/\/|\/)(\S+))/i
|
||||
IMAGE_URL = /((https?:\/\/|\/)(\S+))/i
|
||||
IMAGE_URL = /((https?:\/\/|\/)(\S+))/i
|
||||
def initialize(tag_name, markup, tokens)
|
||||
super
|
||||
if markup =~ IMAGE_URL_WITH_CLASS_AND_CAPTION_AND_LINK
|
||||
|
@ -89,7 +89,7 @@ Jekyll's plugin:
|
|||
@class = $1
|
||||
@url = $3
|
||||
elsif markup =~ IMAGE_URL
|
||||
@url = $1
|
||||
@url = $1
|
||||
end
|
||||
end
|
||||
def render(context)
|
||||
|
@ -98,11 +98,11 @@ Jekyll's plugin:
|
|||
else
|
||||
source = "<figure>"
|
||||
end
|
||||
if @link
|
||||
if @link
|
||||
source += "<a href=\"#{@link}\">"
|
||||
end
|
||||
source += "<img src=\"#{@url}\">"
|
||||
if @link
|
||||
if @link
|
||||
source += "</a>"
|
||||
end
|
||||
source += "<figcaption>#{@caption}</figcaption>" if @caption
|
||||
|
@ -143,14 +143,14 @@ to this (this example uses a slightly extended version named `fig`, different th
|
|||
|
||||
{{%/* fig class="full" src="http://farm5.staticflickr.com/4136/4829260124_57712e570a_o_d.jpg" title="One of my favorite touristy-type photos. I secretly waited for the good light while we were having fun and took this. Only regret: a stupid pole in the top-left corner of the frame I had to clumsily get rid of at post-processing." link="http://www.flickr.com/photos/alexnormand/4829260124/in/set-72157624547713078/" */%}}
|
||||
|
||||
As a bonus, the shortcode named parameters are, arguably, more readable.
|
||||
As a bonus, the shortcode named parameters are, arguably, more readable.
|
||||
|
||||
## Finishing touches
|
||||
## Finishing touches
|
||||
### Fix content
|
||||
Depending on the amount of customization that was done with each post with Jekyll, this step will require more or less effort. There are no hard and fast rules here except that `hugo server --watch` is your friend. Test your changes and fix errors as needed.
|
||||
Depending on the amount of customization that was done with each post with Jekyll, this step will require more or less effort. There are no hard and fast rules here except that `hugo server --watch` is your friend. Test your changes and fix errors as needed.
|
||||
|
||||
### Clean up
|
||||
You'll want to remove the Jekyll configuration at this point. If you have anything else that isn't used, delete it.
|
||||
You'll want to remove the Jekyll configuration at this point. If you have anything else that isn't used, delete it.
|
||||
|
||||
## A practical example in a diff
|
||||
[Hey, it's Alex](http://heyitsalex.net) was migrated in less than a _father-with-kids day_ from Jekyll to Hugo. You can see all the changes (and screw-ups) by looking at this [diff](https://github.com/alexandre-normand/alexandre-normand/compare/869d69435bd2665c3fbf5b5c78d4c22759d7613a...b7f6605b1265e83b4b81495423294208cc74d610).
|
||||
[Hey, it's Alex](http://heyitsalex.net/) was migrated in less than a _father-with-kids day_ from Jekyll to Hugo. You can see all the changes (and screw-ups) by looking at this [diff](https://github.com/alexandre-normand/alexandre-normand/compare/869d69435bd2665c3fbf5b5c78d4c22759d7613a...b7f6605b1265e83b4b81495423294208cc74d610).
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
<meta name="description" content="Hugo, a fast and flexible static site generator built with love by spf13 and friends in Go">
|
||||
<meta name="author" content="Steve Francia (spf13) and friends">
|
||||
|
||||
<title>Hugo :: A fast and modern static website engine</title>
|
||||
|
||||
|
@ -33,9 +33,9 @@
|
|||
<div class="vert-text">
|
||||
<a href="#intro"><img src="/img/hugo.png" class="logo" alt="Hugo logo"> </a>
|
||||
<div class="buttonbox">
|
||||
<a href="/overview/introduction" class="btn btn-primary btn-lg">Docs <i class="icon-idea"></i></a>
|
||||
<a href="/overview/introduction/" class="btn btn-primary btn-lg">Docs <i class="icon-idea"></i></a>
|
||||
<a href="#action" class="btn btn-success btn-lg">Install <i class="icon-arrow-down"></i></a>
|
||||
<a href="http://discuss.gohugo.io" class="btn btn-info btn-lg">Community <i class="icon-talking"></i></a>
|
||||
<a href="http://discuss.gohugo.io/" class="btn btn-info btn-lg">Community <i class="icon-talking"></i></a>
|
||||
<a href="https://github.com/spf13/hugo" class="btn btn-dark btn-lg">GitHub <i class="icon-circlestar"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -183,7 +183,7 @@
|
|||
<i class="lead-icon icon-octocat"></i>
|
||||
<h2>Open and Free</h2>
|
||||
<p class="lead">
|
||||
Hugo is <a href="http://github.com/spf13/hugo">open source</a> and completely free.
|
||||
Hugo is <a href="https://github.com/spf13/hugo">open source</a> and completely free.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -203,8 +203,8 @@
|
|||
<p class="lead">
|
||||
Hugo is developed with love by <a href="http://spf13.com">spf13</a> and friends.
|
||||
We welcome all contributions.
|
||||
New to go? Not a problem, we will help you.
|
||||
Not a developer? Help with <a href="/overview/introduction">docs</a>, testing and <a href="http://github.com/spf13/hugoThemes/">themes</a>.
|
||||
New to Go? Not a problem, we will help you.
|
||||
Not a developer? Help with <a href="/overview/introduction/">docs</a>, testing and <a href="https://github.com/spf13/hugoThemes/">themes</a>.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -219,7 +219,7 @@
|
|||
<div class="col-md-10 col-md-offset-1 text-center">
|
||||
<h1 style="padding-bottom:.5em;">Getting Started</h1>
|
||||
<a href="https://github.com/spf13/hugo/releases" class="btn btn-lg btn-primary">Download <i class="icon-arrow-down"></i></a>
|
||||
<a href="/overview/quickstart" style="color:white;font-weight:300;">Quickstart Guide</a>
|
||||
<a href="/overview/quickstart/" style="color:white;font-weight:300;">Quickstart Guide</a>
|
||||
<p> </p>
|
||||
<h4>Using Homebrew?</h4>
|
||||
<pre><code>brew install hugo</code></pre>
|
||||
|
@ -235,8 +235,8 @@
|
|||
<div class="row">
|
||||
<div class="col-md-6 col-md-offset-3 text-center">
|
||||
<ul class="list-inline">
|
||||
<li><a href="http://twitter.com/spf13" class="icon-twitter icon-2x"></a></li>
|
||||
<li><a href="http://github.com/spf13/hugo" class="icon-octocat icon-2x"></a></li>
|
||||
<li><a href="https://twitter.com/spf13" class="icon-twitter icon-2x"></a></li>
|
||||
<li><a href="https://github.com/spf13/hugo" class="icon-octocat icon-2x"></a></li>
|
||||
</ul>
|
||||
<hr>
|
||||
<p>Copyright © Steve Francia 2013–2015</p>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
|
||||
<hr style="margin: 2em auto 0.25em;">
|
||||
<div style="font-size: medium; font-style: italic; text-align: right;">Hugo v{{ .Hugo.Version }} documentation</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
<meta name="keyword" content="">
|
||||
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}">
|
||||
{{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }}
|
||||
{{ .Hugo.Generator }}
|
||||
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
|
||||
|
||||
<title>{{.Title}}</title>
|
||||
|
@ -30,7 +30,7 @@
|
|||
</div>
|
||||
|
||||
<!--logo start-->
|
||||
<a href="/" class="logo"><img src="/img/hugo-logo.png" style="height:40px;"></a>
|
||||
<a href="/" class="logo"><img src="/img/hugo-logo.png" style="height: 40px; vertical-align: bottom;"> <span style="font-size: small; text-transform: none;">v{{ .Hugo.Version }}</span></a>
|
||||
<!--logo end-->
|
||||
<div class="top-nav notification-row">
|
||||
<!-- notification dropdown end-->
|
||||
|
|
|
@ -41,7 +41,7 @@ Karl之前还写了[《The Little MongoDB Book》](http://openmymind.net/2011/3/
|
|||
### 最新版本
|
||||
|
||||
此书的最新有效资源在:
|
||||
<http://github.com/karlseguin/the-little-redis-book>
|
||||
<https://github.com/karlseguin/the-little-redis-book>
|
||||
|
||||
中文版是英文版的一个分支,最新的中文版本在:
|
||||
<https://github.com/JasonLai256/the-little-redis-book>
|
||||
|
|
Loading…
Reference in a new issue