Docs: Minor copyediting/proofreading

- Correct some typos
- Add backticks and commas where necessary
- Use fenced code blocks specifying "bash" as the language
  to avoid weird highlighting
- Place commas outside of quotation marks surroundingn codes
  to avoid possible confusion
- Suggest users to use the discussion forum rather than the
  mailing list
This commit is contained in:
Anthony Fok 2014-12-04 09:26:12 -07:00 committed by bep
parent 736dd4b521
commit a6d3862b87
15 changed files with 83 additions and 75 deletions

View file

@ -86,10 +86,10 @@ Field names are always normalized to lowercase (e.g. `camelCase: true` is availa
* **type** The type of the content (will be derived from the directory automatically if unset)
* **weight** Used for sorting
* **markup** (Experimental) Specify "rst" for reStructuredText (requires
`rst2html`,) or "md" (default) for the Markdown
* **slug** The token to appear in the tail of the URL
`rst2html`) or "md" (default) for Markdown
* **slug** The token to appear in the tail of the URL,
*or*<br>
* **url** The full path to the content from the web root.<br>
*If neither slug or url is present, the filename will be used.*
*If neither `slug` or `url` is present, the filename will be used.*

View file

@ -22,9 +22,9 @@ When using automatic summaries, Hugo will strip all HTML tags from the summary.
## User-defined: manual summary split:
Hugo also provides an easy way to customize where a piece of content will be split with its summary content divider: <code>&#60;&#33;&#45;&#45;more&#45;&#45;&#62;</code>. The summary content divider is Hugo's version of a "more tag", "summary divider", "excerpt separator", etc. found in other systems. For the summary content divider to be valid, it most be entered as <code>&#60;&#33;&#45;&#45;more&#45;&#45;&#62;</code>; with no additional spaces or other characters between the <code>&#60;&#33;&#45;&#45;</code> and <code>&#45;&#45;&#62;</code> tags.
Hugo also provides an easy way to customize where a piece of content will be split with its summary content divider: <code>&#60;&#33;&#45;&#45;more&#45;&#45;&#62;</code>. The summary content divider is Hugo's version of a "more tag", "summary divider", "excerpt separator", etc. found in other systems. For the summary content divider to be valid, it must be entered exactly as <code>&#60;&#33;&#45;&#45;more&#45;&#45;&#62;</code>, all lowercase with no additional spaces or other characters between the <code>&#60;&#33;&#45;&#45;</code> and <code>&#45;&#45;&#62;</code> tags.
If the summary content divider exists within a piece of content, Hugo will split the content at that point, instead of its default split point of 70 words. The content prior to the summary content provider will be used as that content's summary and the summary content divider will be replaced with a `Read More` link. When the full content is rendered, the summary content provider, <code>&#60;&#33;&#45;&#45;more&#45;&#45;&#62;</code>, is elided from the output.
If the summary content divider exists within a piece of content, Hugo will split the content at that point instead of its default split point of 70 words. The content prior to the summary content divider will be used as that content's summary, and the summary content divider will be replaced with a `Read More` link. When the full content is rendered, the summary content divider, <code>&#60;&#33;&#45;&#45;more&#45;&#45;&#62;</code>, is elided from the output.
When using user-defined summaries, <code>&#60;&#33;&#45;&#45;more&#45;&#45;&#62;</code>, Hugo will preserve the HTML in the summary.

View file

@ -43,7 +43,7 @@ Highlight takes exactly one required parameter of language and requires a
closing shortcode.
### Example
The example has an extra space between the “{{” and “%” characters to prevent rendering here. Since this example is a code block, we use Github flavored Markdown's code fences, ```, to delimit the code. If you are using standard Markdown, instead of the code fence delimiters, each line must be preceeded by 4 spaces to identify each line as a line of code. Not doing either will result in the text being rendered as HTML. This will prevent Pytment highlighting from working.
The example has an extra space between the “`{{`” and “`%`” characters to prevent rendering here. Since this example is a code block, we use GitHub flavored Markdown's code fences, ```, to delimit the code. If you are using standard Markdown, instead of the code fence delimiters, each line must be preceeded by 4 spaces to identify each line as a line of code. Not doing either will result in the text being rendered as HTML. This will prevent Pygments highlighting from working.
```
{{ % highlight html %}}

View file

@ -10,8 +10,8 @@ title: Hugo Quickstart Guide
weight: 10
---
_This quickstart depends on features introduced in hugo v0.11. If you
have an earlier version of hugo you will need to [upgrade](/overview/installing/) before
_This quickstart depends on features introduced in Hugo v0.11. If you
have an earlier version of Hugo, you will need to [upgrade](/overview/installing/) before
proceeding._
## Step 1. Install Hugo
@ -79,7 +79,9 @@ We still lack any templates to tell us how to display the content.
Hugo has rich theme support and a growing set of themes to choose from:
git clone --recursive https://github.com/spf13/hugoThemes themes
```bash
git clone --recursive https://github.com/spf13/hugoThemes themes
```
## Step 5. Run Hugo

View file

@ -15,12 +15,12 @@ title: Taxonomy Overview
weight: 10
---
Hugo includes support for user defined groupings of content called
Hugo includes support for user-defined groupings of content called
taxonomies. Taxonomies give us a way to classify our content so we can
demonstrate relationships in a variety of logical ways.
The default taxonomies for Hugo are tags and categories. These
taxonomies are common to many website systems (WordPress, Drupal,
taxonomies are common to many website systems (e.g. WordPress, Drupal,
Jekyll). Unlike all of those systems, Hugo makes it trivial to customize
the taxonomies you will be using for your site however you wish. Another
good use for taxonomies is to group a set of posts into a series. Other

View file

@ -13,14 +13,14 @@ title: 404.html Templates
weight: 100
---
When using Hugo with [GitHub Pages](http://pages.github.com/) you can provide
When using Hugo with [GitHub Pages](http://pages.github.com/), you can provide
your own 404 template by creating a 404.html file in the root.
404 pages are of the type "node" and have all the [node
variables](/layout/variables/) available to use in the templates.
In addition to the standard node variables, the homepage has access to
all site content accessible from .Data.Pages
all site content accessible from `.Data.Pages`.
▾ layouts/
404.html

View file

@ -30,18 +30,19 @@ and other basic tools; these are listed in the
Return true if the parameter is set.
Takes either a slice, array or channel and an index or a map and a key as input.
e.g. {{ if isset .Params "project_url" }} {{ index .Params "project_url" }}{{ end }}
e.g. `{{ if isset .Params "project_url" }} {{ index .Params "project_url" }}{{ end }}`
### echoParam
If parameter is set, then echo it.
e.g. {{echoParam .Params "project_url" }}
e.g. `{{echoParam .Params "project_url" }}`
### eq
Return true if the parameters are equal.
e.g.
{{ if eq .Section "blog" }}current{{ end}}"
{{ if eq .Section "blog" }}current{{ end }}
### first
Slices an array to only the first X elements.
@ -49,8 +50,9 @@ Slices an array to only the first X elements.
Works on [lists](/templates/list/), [taxonomies](/taxonomies/displaying/), [terms](/templates/terms/), [groups](/templates/list/)
e.g.
{{ range first 10 .Data.Pages }}
{{ .Render "summary"}}
{{ .Render "summary" }}
{{ end }}
### where
@ -76,8 +78,11 @@ e.g.
Checks if an element is in an array (or slice) and returns a boolean. The elements supported are strings, integers and floats (only float64 will match as expected). In addition, it can also check if a substring exists in a string.
e.g.
{{ if in .Params.tags "Git" }}Follow me on GitHub!{{ end }}
or
{{ if in "this string contains a substring" "substring" }}Substring found!{{ end }}
### intersect
@ -86,6 +91,7 @@ Given two arrays (or slices), this function will return the common elements in t
A useful example of this functionality is a 'similar posts' block. Create a list of links to posts where any of the tags in the current post match any tags in other posts.
e.g.
<ul>
{{ $page_link := .Permalink }}
{{ $tags := .Params.tags }}
@ -104,67 +110,67 @@ e.g.
### add
Adds two integers.
e.g. {{add 1 2}} → 3
e.g. `{{add 1 2}}` → 3
### sub
Subtracts two integers.
e.g. {{sub 3 2}} → 1
e.g. `{{sub 3 2}}` → 1
### div
Divides two integers.
e.g. {{div 6 3}} → 2
e.g. `{{div 6 3}}` → 2
### mul
Multiplies two integers.
e.g. {{mul 2 3}} → 6
e.g. `{{mul 2 3}}` → 6
### mod
Modulus of two integers.
e.g. {{mod 15 3}} → 0
e.g. `{{mod 15 3}}` → 0
### modBool
Boolean of modulus of two integers.
true if modulus is 0.
e.g. {{modBool 15 3}} → true
e.g. `{{modBool 15 3}}` → true
## Strings
### urlize
Takes a string and sanitizes it for usage in URLs, converts spaces to "-".
e.g. &lt;a href="/tags/{{ . | urlize }}"&gt;{{ . }}&lt;/a&gt;
e.g. `<a href="/tags/{{ . | urlize }}">{{ . }}</a>`
### safeHtml
Declares the provided string as "safe" so Go templates will not filter it.
e.g. {{ .Params.CopyrightHTML | safeHtml }}
e.g. `{{ .Params.CopyrightHTML | safeHtml }}`
### markdownify
This will run the string through the Markdown processesor. The result will be declared as "safe" so Go templates will not filter it.
e.g. {{ .Title | markdownify }}
e.g. `{{ .Title | markdownify }}`
### lower
Convert all characters in string to lowercase.
e.g. {{lower "BatMan"}} → "batman"
e.g. `{{lower "BatMan"}}` → "batman"
### upper
Convert all characters in string to uppercase.
e.g. {{upper "BatMan"}} → "BATMAN"
e.g. `{{upper "BatMan"}}` → "BATMAN"
### title
Convert all characters in string to titlecase.
e.g. {{title "BatMan"}} → "Batman"
e.g. `{{title "BatMan"}}` → "Batman"
### highlight
Take a string of code and a language, uses Pygments to return the syntax

View file

@ -15,7 +15,7 @@ weight: 95
A single Sitemap template is used to generate the `sitemap.xml` file.
Hugo automatically comes with this template file. **No work is needed on
the users part unless they want to customize the sitemap.xml.**
the users' part unless they want to customize `sitemap.xml`.**
This page is of the type "node" and have all the [node
variables](/layout/variables/) available to use in this template
@ -27,7 +27,7 @@ along with Sitemap-specific ones:
In addition to the standard node variables, the homepage has access to all
site pages through `.Data.Pages`.
If provided Hugo will use /layouts/sitemap.xml instead of the internal
If provided, Hugo will use `/layouts/sitemap.xml` instead of the internal
one.
## Hugos sitemap.xml
@ -46,7 +46,7 @@ Protocol](http://www.sitemaps.org/protocol.html).
{{ end }}
</urlset>
*Important: Hugo will automatically add the following header line to this file
on render...please don't include this in the template as it's not valid HTML.*
***Important:** Hugo will automatically add the following header line to this file
on render. Please don't include this in the template as it's not valid HTML.*
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>

View file

@ -37,10 +37,9 @@ a large amount of flexibility.
The default single file layout is located at `layouts/_default/single.html`.
### List of Contents
The default list file layout is located at `layouts/_default/list.html`
The default list file layout is located at `layouts/_default/list.html`.
### Partial Templates

View file

@ -14,19 +14,19 @@ from within your working directory.
## Replacing Static files
If you would like to include a different file than the theme ships
with.. For example you would like to use a more recent version of jquery
then the theme happens to include simply place an identically name file in the same
relative location but in your working directory. For example if the
theme has jquery 1.6 in /themes/themename/static/js/jQuery.min.js, simply place your file
in the same relative path /static/js/jQuery.min.js.
For including a different file than what the theme ships
with. For example, if you would like to use a more recent version of jQuery
than what the theme happens to include, simply place an identically named file in the same
relative location but in your working directory. For example, if the
theme has jQuery 1.6 in `/themes/themename/static/js/jquery.min.js`, simply place your file
in the same relative path `/static/js/jquery.min.js`.
## Replace a single template file
Anytime Hugo looks for a matching template it will first check the
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)
like to modify a template, simply create that template in your local
`layouts` directory. In the [template documentation](/templates/overview)
each different template type explains the rules it uses to determine
which template to use.
@ -35,22 +35,22 @@ templates](/templates/partials). These partial templates are perfect for easy
injection into the theme with minimal maintenance to ensure future
compatibility.
**warning.. This only works for templates that Hugo knows about. If the
theme imports template files in a creatively named directory
Hugo wont know to look for the local /layouts first**
**Warning: This only works for templates that Hugo knows about. If the
theme imports template files in a creatively named directory,
Hugo wont know to look for the local `/layouts` first.**
## Replace an archetype
If the archetype that ships with the theme for a given content type (or
all content types) doesnt fit with how you are using the theme, feel
free to copy it to your /archetypes directory and make modifications as
free to copy it to your `/archetypes` directory and make modifications as
you see fit.
## Beware of the default
**Default** is a very powerful force in Hugo... Especially as it pertains to
overwriting theme files. If a default is located in the local archetype
directory or /layouts/\_default/ directory it will be used instead of
directory or `/layouts/_default/` directory, it will be used instead of
any of the similar files in the theme.
It is usually better to override specific files rather than using the

View file

@ -18,8 +18,9 @@ repository which contains pointers to set of contributed themes.
If you would like to install all of the available hugo themes, simply
clone the entire repository from within your working directory.
git clone --recursive https://github.com/spf13/hugoThemes.git themes
```bash
git clone --recursive https://github.com/spf13/hugoThemes.git themes
```
## Installing a specific theme

View file

@ -17,8 +17,8 @@ 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 template library. If you are new to Go templates, see our [primer on
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

View file

@ -10,13 +10,13 @@ weight: 30
---
Please make certain you have installed the themes you want to use in the
/themes directory.
`/themes` directory.
To use a theme for a site:
hugo -t ThemeName
The ThemeName must match the name of the directory inside /themes
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, goto [customizing themes](/themes/customizing)
directory. To learn more, go to [customizing themes](/themes/customizing).

View file

@ -6,8 +6,8 @@ next = "/tutorials/mathjax"
prev = "/community/contributing"
title = "Creating a New Theme"
weight = 10
[[menu:main]]
parent = "tutorials"
[[menu.main]]
parent = "tutorials"
+++
## Introduction
@ -81,7 +81,7 @@ Content is stored in text files that contain two sections. The first section is
#### Front Matter
The front matter is information about the content. Like the configuration file, it can be written in TOML, YAML, or JSON. Unlike the configuration file, Hugo doesnt use the files extension to know the format. It looks for markers to signal the type. TOML is surrounded by “+++,” YAML by “---,” and JSON is enclosed in curly braces. I prefer to use TOML, so youll need to translate my examples if you prefer YAML or JSON.
The front matter is information about the content. Like the configuration file, it can be written in TOML, YAML, or JSON. Unlike the configuration file, Hugo doesnt use the files extension to know the format. It looks for markers to signal the type. TOML is surrounded by “`+++`”, YAML by “`---`”, and JSON is enclosed in curly braces. I prefer to use TOML, so youll need to translate my examples if you prefer YAML or JSON.
The information in the front matter is passed into the template before the content is rendered into HTML.
@ -140,7 +140,7 @@ The other directories (archetypes/, layouts/, and static/) are used when customi
### Generate the HTML For the New Site
Running the hugo command with no options will read all the available content and generate the HTML files. It will also copy all static files (that's everything that's not content). Since we have an empty site, it won't do much, but it will do it very quickly.
Running the `hugo` command with no options will read all the available content and generate the HTML files. It will also copy all static files (that's everything that's not content). Since we have an empty site, it won't do much, but it will do it very quickly.
```
$ hugo --verbose
@ -157,7 +157,7 @@ in 2 ms
$
```
The "--verbose" flag gives extra information that will be helpful when we build the template. Every line of the output that starts with "INFO:" or "WARN:" is present because we used that flag. The lines that start with "WARN:" are warning messages. We'll go over them later.
The "`--verbose`" flag gives extra information that will be helpful when we build the template. Every line of the output that starts with "INFO:" or "WARN:" is present because we used that flag. The lines that start with "WARN:" are warning messages. We'll go over them later.
We can verify that the command worked by looking at the directory again.
@ -422,7 +422,7 @@ Note: If you're building on an SSD, you should ignore this. Churning on a SSD ca
### Hugo's Watch Option
Hugo's "--watch" option will monitor the content/ and your theme directories for changes and rebuild the site automatically.
Hugo's "`--watch`" option will monitor the content/ and your theme directories for changes and rebuild the site automatically.
### Live Reload
@ -529,7 +529,7 @@ $ cat public/index.html
#### Live Reload
Note: If you're running the server with the --watch option, you'll see different content in the file:
Note: If you're running the server with the `--watch` option, you'll see different content in the file:
```
$ cat public/index.html
@ -544,7 +544,7 @@ $ cat public/index.html
</html>
```
When you use --watch, the Live Reload script is added by Hugo. Look for live reload in the documentation to see what it does and how to disable it.
When you use `--watch`, the Live Reload script is added by Hugo. Look for live reload in the documentation to see what it does and how to disable it.
### Build a "Dynamic" Home Page
@ -1145,4 +1145,4 @@ Note that we removed the date logic from the default template and put it in the
### Don't Repeat Yourself
DRY is a good design goal and Hugo does a great job supporting it. Part of the art of a good template is knowing when to add a new template and when to update an existing one. While you're figuring that out, Accept that you'll be doing some refactoring. Hugo makes that easy and fast, so it's okay to delay splitting up a template.
DRY is a good design goal and Hugo does a great job supporting it. Part of the art of a good template is knowing when to add a new template and when to update an existing one. While you're figuring that out, accept that you'll be doing some refactoring. Hugo makes that easy and fast, so it's okay to delay splitting up a template.

View file

@ -225,20 +225,20 @@ For more information about the deployment script, see this [README](https://gith
## Hosting Personal/Organization Pages
As mentionned [in this github's article](https://help.github.com/articles/user-organization-and-project-pages/), besides project pages, you may also want to host a user/organization page. Here are the key differences:
As mentioned [in this GitHub's article](https://help.github.com/articles/user-organization-and-project-pages/), besides project pages, you may also want to host a user/organization page. Here are the key differences:
> - You must use the username.github.io naming scheme.
> - Content from the master branch will be used to build and publish your GitHub Pages site.
> - You must use the `username.github.io` naming scheme.
> - Content from the `master` branch will be used to build and publish your GitHub Pages site.
It becomes much simpler in that case: we'll create two separated repos, one for Hugo's content, and a git submodule with the `public` folder's content in it.
It becomes much simpler in that case: we'll create two separate repos, one for Hugo's content, and a git submodule with the `public` folder's content in it.
Step by step:
1. Create on github `<your-project>-hugo` repository (it will host hugo's content)
2. Create on github `<username>.github.io` repository (it will host the `public` folder: the static website)
1. Create on GitHub `<your-project>-hugo` repository (it will host Hugo's content)
2. Create on GitHub `<username>.github.io` repository (it will host the `public` folder: the static website)
2. `git clone <<your-project>-hugo-url> && cd <your-project>-hugo`
3. Make your website work locally (`hugo serve --watch -t <yourtheme>`)
4. Once you are happy with the results, `Ctrl+c` (kill server) and `rm -rf public` (don't worry it can always be regenerated with `hugo -t <yourtheme>`)
4. Once you are happy with the results, `Ctrl+c` (kill server) and `rm -rf public` (don't worry, it can always be regenerated with `hugo -t <yourtheme>`)
5. `git submodule add git@github.com:<username>/<username>.github.io.git public`
6. Almost done: add a `deploy.sh` script to help you (and make it executable: `chmod +x deploy.sh`):
@ -268,10 +268,10 @@ git push origin master
# Come Back
cd ..
```
7. `./deploy.sh "Your optional commit message"` to send changes to `<username>.github.io` (carefull, you may also want to commit changes on the `<your-project>-hugo` repo).
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 [mailing lists](/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).