shithub: hugo

Download patch

ref: b59dd163ec268853e8aa136504cbc60ff1a1ab34
parent: 769ab9e22476f3ddfbffae62f9ece3a8f2213d38
author: Anthony Fok <[email protected]>
date: Fri Jan 16 19:45:53 EST 2015

[Docs] More copyediting

* Add link to https://travis-ci.org/spf13/hugo
* Correct heading levels in docs/content/community/mailing-list.md
* Mention RFC 3339 as the `date` format set by `hugo new`
* Mention that `hugo new` does not add `draft = true` when the user
  provides an archetype
* List short examples of TOML and YAML side by side
* Compact the Math template functions into a table
* Put some notes into a blockquote

--- a/docs/content/community/contributing.md
+++ b/docs/content/community/contributing.md
@@ -24,7 +24,7 @@
   * Have test cases for the new code.  If you have questions about how to do it, please ask in your pull request.
   * Run `go fmt`
   * 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.
+  * Make sure `go test ./...` passes, and `go build` completes.  Our [Travis CI loop](https://travis-ci.org/spf13/hugo) 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.
 
 ## Contribution Overview
 
--- a/docs/content/community/mailing-list.md
+++ b/docs/content/community/mailing-list.md
@@ -9,22 +9,22 @@
 weight: 10
 ---
 
-# Discussion Forum
+## Discussion Forum
 
 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.
 
-# Mailing List
+## Mailing List
 
 Hugo has two mailing lists:
 
-## Announcements
+### Announcements
 Very low traffic. Only releases will be emailed here.
 
 https://groups.google.com/forum/#!forum/hugo-announce
 
-## Discussion (Archive)
+### Discussion (Archive)
 
 **This has been replaced with the [Hugo discussion forum](http://discuss.gohugo.io).**
 
@@ -33,18 +33,18 @@
 https://groups.google.com/forum/#!forum/hugo-discuss
 
 
-# Other Resources
+## Other Resources
 
-## GoNuts
+### GoNuts
 
 For general Go questions or discussion please refer to the Go mailing list.
 
 https://groups.google.com/forum/#!forum/golang-nuts
 
-## GitHub Issues
+### GitHub Issues
 
 https://github.com/spf13/hugo/issues
 
-## Twitter
+### Twitter
 
 Hugo doesn't have its own Twitter handle, but feel free to tweet [@spf13](http://twitter.com/spf13).
--- a/docs/content/content/archetypes.md
+++ b/docs/content/content/archetypes.md
@@ -33,7 +33,7 @@
     categories = ["x", "y"]
     +++
 
-__CAVEAT:__  Some editors (e.g. Sublime, Emacs) do not insert an EOL (end-of-line) character at the end of the file (i.e. EOF).  If you get a [strange EOF error](/troubleshooting/strange-eof-error/) when using `hugo new`, please open each archetype file (i.e. `archetypes/*.md`) and press <kbd>Enter</kbd> to type a carriage return after the closing `+++` or `---` as necessary.
+> __CAVEAT:__  Some editors (e.g. Sublime, Emacs) do not insert an EOL (end-of-line) character at the end of the file (i.e. EOF).  If you get a [strange EOF error](/troubleshooting/strange-eof-error/) when using `hugo new`, please open each archetype file (i.e.&nbsp;`archetypes/*.md`) and press <kbd>Enter</kbd> to type a carriage return after the closing `+++` or `---` as necessary.
 
 
 ### Step 2. Using the archetype
@@ -80,8 +80,13 @@
 * If no archetype files are present, then the one that ships with Hugo will be used.
 
 Hugo provides a simple archetype which sets the `title` (based on the
-file name) and the `date` based on `now()`.
+file name) and the `date` in RFC&nbsp;3339 format based on
+[`now()`](http://golang.org/pkg/time/#Now), which returns the current time.
 
-Content type is automatically detected based on the path. You are welcome to declare which 
-type to create using the `--kind` flag during creation.
+> *Note: `hugo new` does not automatically add `draft = true` when the user
+> provides an archetype.  This is by design, rationale being that
+> the archetype should set its own value for all fields.
+> `title` and `date`, which are dynamic and unique for each piece of content,
+> are the sole exceptions.*
 
+Content type is automatically detected based on the path. You are welcome to declare which type to create using the `--kind` flag during creation.
--- a/docs/content/extras/aliases.md
+++ b/docs/content/extras/aliases.md
@@ -21,11 +21,26 @@
 ## Example
 **content/posts/my-awesome-blog-post.md**
 
-    ---
-    aliases:
-        - /posts/my-original-url/
-        - /2010/even-earlier-url.html
-    ---
+<table class="table">
+<tr>
+<th>TOML</th><th>YAML</th>
+</tr>
+<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/",
+    "/2010/even-earlier-url.html"
+]
++++
+</code></pre></td>
+</tr>
+</table>
 
 Now when you go to any of the aliases locations, they
 will redirect to the page.
--- a/docs/content/extras/builders.md
+++ b/docs/content/extras/builders.md
@@ -18,7 +18,7 @@
 
 Want to get a site built quickly?
 
-    hugo new site /path/to/site
+    $ hugo new site /path/to/site
 
 Hugo will create all the needed directories and files to get started
 quickly.
@@ -31,7 +31,7 @@
 
 Want to design a new theme?
 
-    hugo new theme `THEME_NAME`
+    $ hugo new theme THEME_NAME
 
 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
@@ -49,7 +49,7 @@
 will not only insert the current date and appropriate metadata, but it
 will pre-populate values based on the content type.
 
-    hugo new relative/path/to/content
+    $ hugo new relative/path/to/content
 
 This assumes it is being run from your working directory and the content
 path starts from your content directory.
@@ -56,5 +56,3 @@
 
 I typically keep two different terminals open, one to run `hugo server
 --watch`, and another to use the builders to create new content.
-
-
--- a/docs/content/templates/functions.md
+++ b/docs/content/templates/functions.md
@@ -14,7 +14,7 @@
 
 Hugo uses the excellent Go html/template library for its template engine.
 It is an extremely lightweight engine that provides a very small amount of
-logic. In our experience it is just the right amount of logic to be able
+logic. In our experience, it is just the right amount of logic to be able
 to create a good static website.
 
 Go templates are lightweight but extensible. Hugo has added the following
@@ -63,7 +63,7 @@
 e.g.
 
     {{ range where .Data.Pages "Section" "post" }}
-       {{ .Content}}
+       {{ .Content }}
     {{ end }}
 
 It can be used with dot chaining second argument to refer a nested element of a value.
@@ -98,12 +98,10 @@
 - `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
 
-*where and first can be stacked*
+*`where` and `first` can be stacked, e.g.:*
 
-e.g.
-
     {{ range first 5 (where .Data.Pages "Section" "post") }}
-       {{ .Content}}
+       {{ .Content }}
     {{ end }}
 
 ### delimit
@@ -206,36 +204,54 @@
 
 ## Math
 
-### add
-Adds two integers.
+<table class="table table-bordered">
+<thead>
+<tr>
+<th>Function</th>
+<th>Description</th>
+<th>Example</th>
+</tr>
+</thead>
 
-e.g. `{{add 1 2}}` → 3
+<tbody>
+<tr>
+<td><code>add</code></td>
+<td>Adds two integers.</td>
+<td><code>{{add 1 2}}</code> → 3</td>
+</tr>
 
-### sub
-Subtracts two integers.
+<tr>
+<td><code>sub</code></td>
+<td>Subtracts two integers.</td>
+<td><code>{{sub 3 2}}</code> → 1</td>
+</tr>
 
-e.g. `{{sub 3 2}}` → 1
+<tr>
+<td><code>mul</code></td>
+<td>Multiplies two integers.</td>
+<td><code>{{mul 2 3}}</code> → 6</td>
+</tr>
 
-### div
-Divides two integers.
+<tr>
+<td><code>div</code></td>
+<td>Divides two integers.</td>
+<td><code>{{div 6 3}}</code> → 2</td>
+</tr>
 
-e.g. `{{div 6 3}}` → 2
+<tr>
+<td><code>mod</code></td>
+<td>Modulus of two integers.</td>
+<td><code>{{mod 15 3}}</code> → 0</td>
+</tr>
 
-### mul
-Multiplies two integers.
+<tr>
+<td><code>modBool</code></td>
+<td>Boolean of modulus of two integers.  <code>true</code> if modulus is 0.</td>
+<td><code>{{modBool 15 3}}</code> → true</td>
+</tr>
+</tbody>
+</table>
 
-e.g. `{{mul 2 3}}` → 6
-
-### mod
-Modulus of two integers.
-
-e.g. `{{mod 15 3}}` → 0
-
-### modBool
-Boolean of modulus of two integers.
-true if modulus is 0.
-
-e.g. `{{modBool 15 3}}` → true
 
 ## Strings
 
--- a/docs/content/troubleshooting/strange-eof-error.md
+++ b/docs/content/troubleshooting/strange-eof-error.md
@@ -9,18 +9,18 @@
 
 ## Trouble: `hugo new` aborts with cryptic EOF error
 
-I'm running into an issue where I cannot get archetypes working, when running `hugo new showcase/test.md`, for example, I see an `EOF` error thrown by Hugo.
-
-I have set up this test repository to show exactly what I've done, but it is essentially a vanilla installation of Hugo. https://github.com/polds/hugo-archetypes-test
-
-When in that repository, using Hugo v0.12 to run `hugo new -v showcase/test.md`, I see the following output:
-
-    INFO: 2015/01/04 Using config file: /private/tmp/test/config.toml
-    INFO: 2015/01/04 attempting to create  showcase/test.md of showcase
-    INFO: 2015/01/04 curpath: /private/tmp/test/archetypes/showcase.md
-    ERROR: 2015/01/04 EOF
-
-Is there something that I am blatantly missing?
+> I'm running into an issue where I cannot get archetypes working, when running `hugo new showcase/test.md`, for example, I see an `EOF` error thrown by Hugo.
+>
+> I have set up this test repository to show exactly what I've done, but it is essentially a vanilla installation of Hugo. https://github.com/polds/hugo-archetypes-test
+>
+> When in that repository, using Hugo v0.12 to run `hugo new -v showcase/test.md`, I see the following output:
+>
+>     INFO: 2015/01/04 Using config file: /private/tmp/test/config.toml
+>     INFO: 2015/01/04 attempting to create  showcase/test.md of showcase
+>     INFO: 2015/01/04 curpath: /private/tmp/test/archetypes/showcase.md
+>     ERROR: 2015/01/04 EOF
+>
+> Is there something that I am blatantly missing?
 
 ## Solution