From: spf13 Date: Sat, 17 Aug 2013 12:34:25 +0000 (-0400) Subject: Complete overhaul of the docs X-Git-Tag: v0.9~159 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=8c0ab4def124cc632c6e046e3e770bd4a055133a;p=brevno-suite%2Fhugo Complete overhaul of the docs --- diff --git a/docs/content/content/example.md b/docs/content/content/example.md new file mode 100644 index 00000000..9d90c97f --- /dev/null +++ b/docs/content/content/example.md @@ -0,0 +1,41 @@ +--- +title: "Example Content File" +date: "2013-07-01" +aliases: ["/doc/example/"] +--- + +Somethings are better shown than explained. The following is a very basic example of a content file: + +**mysite/project/nitro.md <- http://mysite.com/project/nitro.html** + + --- + Title: "Nitro : A quick and simple profiler for golang" + Description": "" + Keywords": [ "Development", "golang", "profiling" ] + Tags": [ "Development", "golang", "profiling" ] + date": "2013-06-19" + Topics": [ "Development", "GoLang" ] + Slug": "nitro" + project_url": "http://github.com/spf13/nitro" + --- + + # Nitro + + Quick and easy performance analyzer library for golang. + + ## Overview + + Nitro is a quick and easy performance analyzer library for golang. + It is useful for comparing A/B against different drafts of functions + or different functions. + + ## Implementing Nitro + + Using Nitro is simple. First use go get to install the latest version + of the library. + + $ go get github.com/spf13/nitro + + Next include nitro in your application. + + diff --git a/docs/content/content/front-matter.md b/docs/content/content/front-matter.md new file mode 100644 index 00000000..0a409c56 --- /dev/null +++ b/docs/content/content/front-matter.md @@ -0,0 +1,84 @@ ++++ +title = "Front Matter" +date = "2013-07-01" +aliases = ["/doc/front-matter/"] ++++ + +The front matter is one of the features that gives Hugo it's strength. It enables +you to include the meta data of the content right with it. Hugo supports a few +different formats each with their own identifying tokens. + +Supported formats:
+ **YAML**, identified by '\-\-\-'.
+ **TOML**, indentified with '+++'.
+ **JSON**, a single JSON object which is surrounded by '{' and '}' each on their own line. + +### YAML Example + + --- + title: "spf13-vim 3.0 release and new website" + description: "spf13-vim is a cross platform distribution of vim plugins and resources for Vim." + tags: [ ".vimrc", "plugins", "spf13-vim", "vim" ] + date: "2012-04-06" + categories: + - "Development" + - "VIM" + slug: "spf13-vim-3-0-release-and-new-website" + --- + Content of the file goes Here + +### TOML Example + + +++ + title = "spf13-vim 3.0 release and new website" + description = "spf13-vim is a cross platform distribution of vim plugins and resources for Vim." + tags = [ ".vimrc", "plugins", "spf13-vim", "vim" ] + date = "2012-04-06" + categories = [ + "Development", + "VIM" + ] + slug = "spf13-vim-3-0-release-and-new-website" + +++ + Content of the file goes Here + +### JSON Example + + { + "title": "spf13-vim 3.0 release and new website", + "description": "spf13-vim is a cross platform distribution of vim plugins and resources for Vim.", + "tags": [ ".vimrc", "plugins", "spf13-vim", "vim" ], + "date": "2012-04-06", + "categories": [ + "Development", + "VIM" + ], + "slug": "spf13-vim-3-0-release-and-new-website", + } + Content of the file goes Here + +### Variables + +There are a few predefined variables that Hugo is aware of and utilizes. The user can also create +any variable they want to. These will be placed into the `.Params` variable available to the templates. +**Field names are case insensitive.** + +#### Required + +**title** The title for the content.
+**description** The description for the content.
+**date** The date the content will be sorted by.
+**indexes** These will use the field name of the plural form of the index (see tags and categories above) + +#### Optional + +**redirect** Mark the post as a redirect post
+**draft** If true the content will not be rendered unless `hugo` is called with -d
+**type** The type of the content (will be derived from the directory automatically if unset).
+**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.
+ *or*
+**url** The full path to the content from the web root.
+*If neither is present the filename will be used.* + diff --git a/docs/content/content/organization.md b/docs/content/content/organization.md new file mode 100644 index 00000000..f9eba097 --- /dev/null +++ b/docs/content/content/organization.md @@ -0,0 +1,154 @@ +--- +title: "Content Organization" +date: "2013-07-01" +aliases: ["/doc/organization/"] +--- + +Hugo uses markdown files with headers commonly called the front matter. Hugo respects the organization +that you provide for your content to minimize any extra configuration, though this can be overridden +by additional configuration in the front matter. + +## Organization +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). + + . + └── content + ├── post + | ├── firstpost.md // <- http://site.com/post/firstpost/ + | ├── happy + | | └── happiness.md // <- http://site.com/happy/happiness/ + | └── secondpost.md // <- http://site.com/post/secondpost/ + └── quote + ├── first.md // <- http://site.com/quote/first/ + └── second.md // <- http://site.com/quote/second/ + +**Here's the same organization run with hugo -\-uglyurls** + + . + └── content + ├── post + | ├── firstpost.md // <- http://site.com/post/firstpost.html + | ├── happy + | | └── happiness.md // <- http://site.com/happy/happiness.html + | └── secondpost.md // <- http://site.com/post/secondpost.html + └── quote + ├── first.md // <- http://site.com/quote/first.html + └── second.md // <- http://site.com/quote/second.html + +## Destinations + +Hugo thinks 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. As displayed above, the organization of the source content will be +mirrored in the destination. + +There are times when one would need more control over their content. In these +cases there are a variety of things that can be specified in the front matter to +determine the destination of a specific piece of content. + +The following items are defined in order, latter items in the list will override +earlier settings. + +#### filename +This isn't in the front matter, but is the actual name of the file minus the +extension. This will be the name of the file in the destination. + +#### slug +Defined in the front matter, the slug can take the place of the filename for the +destination. + +#### filepath +The actual path to the file on disk. Destination will create the destination +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). + +#### 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). + +#### url +A complete url can be provided. This will override all the above as it pertains +to the end destination. This must be the path from the baseurl (starting with a "/"). +When a url is provided it will be used exactly. Using url will ignore the +-\-uglyurls setting. + + +## Path breakdown in hugo + +### Content + + . path slug + . ⊢-------^----⊣ ⊢------^-------⊣ + content/extras/indexes/category-example/index.html + + + . section slug + . ⊢--^--⊣ ⊢------^-------⊣ + content/extras/indexes/category-example/index.html + + + . section slug + . ⊢--^--⊣⊢--^--⊣ + content/extras/indexes/index.html + +### Destination + + + permalink + ⊢--------------^-------------⊣ + http://spf13.com/projects/hugo + + + baseUrl section slug + ⊢-----^--------⊣ ⊢--^---⊣ ⊢-^⊣ + http://spf13.com/projects/hugo + + + baseUrl section slug + ⊢-----^--------⊣ ⊢--^--⊣ ⊢--^--⊣ + http://spf13.com/extras/indexes/example + + + baseUrl path slug + ⊢-----^--------⊣ ⊢------^-----⊣ ⊢--^--⊣ + http://spf13.com/extras/indexes/example + + + baseUrl url + ⊢-----^--------⊣ ⊢-----^-----⊣ + http://spf13.com/projects/hugo + + + baseUrl url + ⊢-----^--------⊣ ⊢--------^-----------⊣ + http://spf13.com/extras/indexes/example + + + +section = which type the content is by default + based on content location + front matter overrides + + +slug = name.ext or name/ + based on content-name.md + front matter overrides + + +path = section + path to file exluding slug + based on path to content location + + +url = relative url + defined in front matter + overrides all the above + + + diff --git a/docs/content/content/sections.md b/docs/content/content/sections.md new file mode 100644 index 00000000..ca72d610 --- /dev/null +++ b/docs/content/content/sections.md @@ -0,0 +1,43 @@ +--- +title: "Sections" +date: "2013-07-01" +--- + +Hugo thinks 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 +uses the top level of your content organization as **the Section**. + +The following example site uses two sections, "post" and "quote". + + . + └── content + ├── post + | ├── firstpost.md // <- http://site.com/post/firstpost/ + | ├── happy + | | └── happiness.md // <- http://site.com/happy/happiness/ + | └── secondpost.md // <- http://site.com/post/secondpost/ + └── quote + ├── first.md // <- http://site.com/quote/first/ + └── second.md // <- http://site.com/quote/second/ + + +*Regardless of location on disk, the section can be provided in the front matter +which will affect the destination location*. + +## Sections and Types + +By default everything created within a section will use the content type +that matches the section name. + +Section defined in the front matter have the same impact. + +To change the type of a given piece of content simply define the type +in the front matter. + +If a layout for a given type hasn't been provided a default type template will +be used instead provided is exists. + + + + diff --git a/docs/content/content/types.md b/docs/content/content/types.md new file mode 100644 index 00000000..8f535454 --- /dev/null +++ b/docs/content/content/types.md @@ -0,0 +1,49 @@ +--- +title: "Content Types" +date: "2013-07-01" +--- + +Hugo has full support for multiple content types each with it's own set +of meta data and template. A good example of when multiple types are +needed is to look a tumblr. A piece of content could be a photo, quote +or post, each with different meta data and rendered differently. + + +## Defining a content type + +Creating a new content type is easy in Hugo. You simply provide the +templates that the new type will use. + +It is essential to provide the single render view template as well as a +list view template. + +**Step 1:** +Create a directory with the name of the type in layouts.Type is always singular. *Eg /layouts/post*. + +**Step 2:** +Create a file called single.html inside your directory. *Eg /layouts/post/single.html*. + +**Step 3:** +Create a file with the same name as your directory in /layouts/indexes/. *Eg /layouts/index/post.html*. + +**Step 4:** +Many sites support rendering content in a few different ways, for +instance a single page view and a summary view to be used when displaying a list +of contents on a single page. Hugo makes no assumptions here about how you want +to display your content, and will support as many different views of a content +type as your site requires. All that is required for these additional views is +that a template exists in each layout/type directory with the same name. + +For these, reviewing this example site will be very helpful in order to understand how these types work. + +## Assigning a content type + +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. + +Alternatively you can set the type in the meta data under the key "type". + + + diff --git a/docs/content/doc/aliases.md b/docs/content/doc/aliases.md deleted file mode 100644 index 1e8a3556..00000000 --- a/docs/content/doc/aliases.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: "Aliases" -Pubdate: "2013-07-09" -Aliases: - - /doc/redirects/ - - /doc/alias/ ---- - -For people migrating existing published content to Hugo theres a good chance -you need a mechanism to handle redirecting old urls. - -Luckily, this can be handled easily with aliases in Hugo. - -## Example -**content/posts/my-awesome-blog-post.md** - - --- - aliases: - - /posts/my-original-url/ - - /2010/even-earlier-url.html - --- - -Now when you go to any of the aliases locations they -will redirect to the page. - -## Important Behaviors - -1. *Hugo makes no assumptions about aliases. They also don't change based -on your UglyUrls setting. You Need to provide a relative path and the -complete filename or directory.* - -2. *Aliases are rendered prior to any content and will be overwritten by -any content with the same location.* diff --git a/docs/content/doc/configuration.md b/docs/content/doc/configuration.md deleted file mode 100644 index 0fee6529..00000000 --- a/docs/content/doc/configuration.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: "Configuring Hugo" -pubdate: "2013-07-01" ---- - -The directory structure and templates provide the majority of the -configuration for a site. In fact a config file isn't even needed for many websites -since the defaults used follow commonly used patterns. - -Hugo expects to find the config file in the root of the source directory and -will look there first for a config.yaml file. If none is present it will -then look for a config.json file, followed by a config.toml file. - -**Please note the field names must be all lowercase** - -## Examples - -The following is an example of a yaml config file with the default values: - - --- - contentdir: "content" - layoutdir: "layouts" - publishdir: "public" - builddrafts: false - indexes: - category: "categories" - tag: "tags" - baseurl: "http://yoursite.com/" - ... - - -The following is an example of a json config file with the default values: - - { - "contentdir": "content", - "layoutdir": "layouts", - "publishdir": "public", - "builddrafts": false, - "indexes": { - "category": "categories", - "tag": "tags" - }, - "baseurl": "http://yoursite.com/" - } - - -The following is an example of a toml config file with the default values: - - contentdir = "content" - layoutdir = "layouts" - publishdir = "public" - builddrafts = false - baseurl = "http://yoursite.com/" - [indexes] - category = "categories" - tag = "tags" - - diff --git a/docs/content/doc/contributing.md b/docs/content/doc/contributing.md deleted file mode 100644 index 84d08633..00000000 --- a/docs/content/doc/contributing.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: "Contributing to Hugo" -Pubdate: "2013-07-01" ---- - -We welcome all contributions. If you want to contribute, all -that is needed is simply fork Hugo, make changes and submit -a pull request. If you prefer, pick something from the roadmap -or contact [spf13](http://spf13.com) about what may make sense -to do next. - -## Overview -1. Fork it from https://github.com/spf13/hugo -2. Create your feature branch (`git checkout -b my-new-feature`) -3. Commit your changes (`git commit -am 'Add some feature'`) -4. Push to the branch (`git push origin my-new-feature`) -5. Create new Pull Request - - -### Clone locally (for contributors): - - git clone https://github.com/spf13/hugo - cd hugo - go get - -Because go expects all of your libraries to be found in either -$GOROOT or $GOPATH, it's helpful to symlink the project to one -of the following paths: - - * ln -s /path/to/your/hugo $GOPATH/src/github.com/spf13/hugo - * ln -s /path/to/your/hugo $GOROOT/src/pkg/github.com/spf13/hugo - -### Running Hugo - - cd /path/to/hugo - go install github.com/spf13/hugo/hugolibs - go run main.go - -### Building Hugo - - cd /path/to/hugo - go build -o hugo main.go - mv hugo /usr/local/bin/ - diff --git a/docs/content/doc/contributors.md b/docs/content/doc/contributors.md deleted file mode 100644 index 4bc5a9d3..00000000 --- a/docs/content/doc/contributors.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: "Contributors" -date: "2013-07-01" ---- - -Hugo was built with love and golang by: - -* [spf13](https://github.com/spf13) - diff --git a/docs/content/doc/example.md b/docs/content/doc/example.md deleted file mode 100644 index 51e3c160..00000000 --- a/docs/content/doc/example.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: "Example Content File" -Pubdate: "2013-07-01" ---- - -Somethings are better shown than explained. The following is a very basic example of a content file: - -**mysite/project/nitro.md <- http://mysite.com/project/nitro.html** - - --- - Title: "Nitro : A quick and simple profiler for golang" - Description": "" - Keywords": [ "Development", "golang", "profiling" ] - Tags": [ "Development", "golang", "profiling" ] - Pubdate": "2013-06-19" - Topics": [ "Development", "GoLang" ] - Slug": "nitro" - project_url": "http://github.com/spf13/nitro" - --- - - # Nitro - - Quick and easy performance analyzer library for golang. - - ## Overview - - Nitro is a quick and easy performance analyzer library for golang. - It is useful for comparing A/B against different drafts of functions - or different functions. - - ## Implementing Nitro - - Using Nitro is simple. First use go get to install the latest version - of the library. - - $ go get github.com/spf13/nitro - - Next include nitro in your application. - - diff --git a/docs/content/doc/front-matter.md b/docs/content/doc/front-matter.md deleted file mode 100644 index 566fb1fb..00000000 --- a/docs/content/doc/front-matter.md +++ /dev/null @@ -1,83 +0,0 @@ -+++ -title = "Front Matter" -date = "2013-07-01" -+++ - -The front matter is one of the features that gives Hugo it's strength. It enables -you to include the meta data of the content right with it. Hugo supports a few -different formats each with their own identifying tokens. - -Supported formats:
- **YAML**, identified by '\-\-\-'.
- **TOML**, indentified with '+++'.
- **JSON**, a single JSON object which is surrounded by '{' and '}' each on their own line. - -### YAML Example - - --- - title: "spf13-vim 3.0 release and new website" - description: "spf13-vim is a cross platform distribution of vim plugins and resources for Vim." - tags: [ ".vimrc", "plugins", "spf13-vim", "vim" ] - pubdate: "2012-04-06" - categories: - - "Development" - - "VIM" - slug: "spf13-vim-3-0-release-and-new-website" - --- - Content of the file goes Here - -### TOML Example - - +++ - title = "spf13-vim 3.0 release and new website" - description = "spf13-vim is a cross platform distribution of vim plugins and resources for Vim." - tags = [ ".vimrc", "plugins", "spf13-vim", "vim" ] - Pubdate = "2012-04-06" - categories = [ - "Development", - "VIM" - ] - slug = "spf13-vim-3-0-release-and-new-website" - +++ - Content of the file goes Here - -### JSON Example - - { - "title": "spf13-vim 3.0 release and new website", - "description": "spf13-vim is a cross platform distribution of vim plugins and resources for Vim.", - "tags": [ ".vimrc", "plugins", "spf13-vim", "vim" ], - "date": "2012-04-06", - "categories": [ - "Development", - "VIM" - ], - "slug": "spf13-vim-3-0-release-and-new-website", - } - Content of the file goes Here - -### Variables - -There are a few predefined variables that Hugo is aware of and utilizes. The user can also create -any variable they want to. These will be placed into the `.Params` variable available to the templates. -**Field names are case insensitive.** - -#### Required - -**title** The title for the content.
-**description** The description for the content.
-**date** The date the content will be sorted by.
-**indexes** These will use the field name of the plural form of the index (see tags and categories above) - -#### Optional - -**redirect** Mark the post as a redirect post
-**draft** If true the content will not be rendered unless `hugo` is called with -d
-**type** The type of the content (will be derived from the directory automatically if unset).
-**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.
- *or*
-**url** The full path to the content from the web root.
-*If neither is present the filename will be used.* - diff --git a/docs/content/doc/indexes.md b/docs/content/doc/indexes.md deleted file mode 100644 index 9731a773..00000000 --- a/docs/content/doc/indexes.md +++ /dev/null @@ -1,221 +0,0 @@ ---- -title: "Indexes" -Pubdate: "2013-07-01" ---- - -Hugo includes support for user defined indexes of content. In our -terminology an index is best thought of as tags applied to content -but they can be used for far more than just tags. Other common -uses would include categories, groups, series. For the purpose of -this document we will just use tags for our example. For a more -complete example see [spf13.com-hugo](http://github.com/spf13/spf13.com-hugo). - -## Defining Indexes for a site - -Indexes must be defined in the site configuration, before they -can be used throughout the site. - -Here is an example configuration in YAML that specifies two indexes. -Notice the format is **singular key** : *plural value*. While -we could use an inflection library to pluralize this, they currently -support only a few languages, so instead we've opted for user defined -pluralization. - -**config.yaml** - - --- - indexes: - tag: "tags" - topic: "topics" - baseurl: "http://spf13.com/" - title: "Steve Francia is spf13.com" - --- - -## Creating index templates -For each index type a template needs to be provided to render the index page. -In the case of tags, this will render the content for /tags/TAGNAME/. - -The template must be called the singular name of the index and placed in -layouts/indexes - - . - └── layouts - └── indexes - └── category.html - -The template will be provided Data about the index. - -### Variables - -The following variables are available to the index template: - -**.Title** The title for the content.
-**.Date** The date the content is published on.
-**.Permalink** The Permanent link for this page.
-**.RSSLink** Link to the indexes' rss link.
-**.Data.Pages** The content that is assigned this index.
-**.Data.`singular`** The index itself.
- -#### Example - - {{ template "chrome/header.html" . }} - {{ template "chrome/subheader.html" . }} - -
-
-

{{ .Title }}

- {{ range .Data.Pages }} - {{ .Render "summary"}} - {{ end }} -
-
- - - - {{ template "chrome/footer.html" }} - - -## Assigning indexes to content - -Once an index is defined at the site level, any piece of content -can be assigned to it regardless of content type or section. - -Assigning content to an index is done in the front matter. -Simply create a variable with the *plural* name of the index -and assign all keys you want this content to match against. - -**Index values are case insensitive** - -#### Example - { - "Title": "Hugo: A fast and flexible static site generator", - "Tags": [ - "Development", - "golang", - "Blogging" - ], - "Slug": "hugo", - "project_url": "http://github.com/spf13/hugo" - } - - -## Displaying indexes within content - -Within your content templates you may wish to display -the indexes that that piece of content is assigned to. - -Because we are leveraging the front matter system to -define indexes for content, the indexes assigned to -each content piece are located in the usual place -(.Params.`plural`) - -#### Example - - - -If you wish to display the list of all indexes, the index can -be retrieved from the `.Site` variable. - -#### Example - - - -## Creating Indexes of Indexes - -Hugo also supports creating pages that list your values for each -index along with the number of content items associated with the -index key. - -This may take the form of a tag cloud or simply a list. - -To have hugo create these indexes of indexes pages, simply create -a template in indexes called indexes.html - -Hugo provides two different versions of the index. One alphabetically -sorted, the other sorted by most popular. It's important to recognize -that the data structure of the two is different. - -#### Example indexes.html file (alphabetical) - - {{ template "chrome/header.html" . }} - {{ template "chrome/subheader.html" . }} - -
-
-

{{ .Title }}

-
    - {{ $data := .Data }} - {{ range $key, $value := .Data.Index }} -
  • {{ $key }} {{ len $value }}
  • - {{ end }} -
-
-
- - {{ template "chrome/footer.html" }} - - -#### Example indexes.html file (ordered) - - {{ template "chrome/header.html" . }} - {{ template "chrome/subheader.html" . }} - -
-
-

{{ .Title }}

-
    - {{ range $data.OrderedIndex }} -
  • {{ .Name }} {{ .Count }}
  • - {{ end }} -
-
-
- - {{ template "chrome/footer.html" }} - -### Variables available to indexes of indexes pages. - -**.Title** The title for the content.
-**.Date** The date the content is published on.
-**.Permalink** The Permanent link for this page.
-**.RSSLink** Link to the indexes' rss link.
-**.Data.Singular** The singular name of the index
-**.Data.Plural** The plural name of the index
-**.Data.Index** The Alphabetical index
-**.Data.OrderedIndex** The popular index
- -## Creating a menu based on indexes - -Hugo can generate menus based on indexes by iterating and -nesting the index keys. This can be used to build a hierarchy -of content within your site. - -To have hugo create the menu, simply create a template in chome -called menu.html, then include it using the -`{{ template "chrome/menu.html" . }}` syntax. - - -#### Example menu.html file - - - diff --git a/docs/content/doc/installing.md b/docs/content/doc/installing.md deleted file mode 100644 index 53c0fb61..00000000 --- a/docs/content/doc/installing.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: "Installing Hugo" -Pubdate: "2013-07-01" ---- - -Hugo is written in GoLang with support for Windows, Linux, FreeBSD and OSX. - -The latest release can be found at [hugo releases](https://github.com/spf13/hugo/releases). -We currently build for Windows, Linux, FreeBSD and OS X for x64 -and 386 architectures. - -## Installing Hugo (binary) - -Installation is very easy. Simply download the appropriate version for your -platform from [hugo releases](https://github.com/spf13/hugo/releases). -Once downloaded it can be run from anywhere. You don't need to install -it into a global location. This works well for shared hosts and other systems -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. - -*the Hugo executible has no external dependencies.* - -## Installing from source - -### Dependencies - -* Git -* Go 1.1+ -* Mercurial -* Bazaar - -### Get directly from Github: - - go get github.com/spf13/hugo - -### Building Hugo - - cd /path/to/hugo - go build -o hugo main.go - mv hugo /usr/local/bin/ - -## Contributing - -Please see the [contributing guide](/doc/contributing) diff --git a/docs/content/doc/license.md b/docs/content/doc/license.md deleted file mode 100644 index 613a7ed2..00000000 --- a/docs/content/doc/license.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: "License" -Pubdate: "2013-07-01" ---- - -Hugo is released under the Simple Public License. - - -Simple Public License (SimPL-2.0) -================================= - -Preamble --------- - -This Simple Public License 2.0 (SimPL-2.0 for short) is a plain language -implementation of GPL 2.0. The words are different, but the goal is the -same - to guarantee for all users the freedom to share and change -software. If anyone wonders about the meaning of the SimPL, they should -interpret it as consistent with GPL 2.0. - - -Simple Public License (SimPL) 2.0 -================================= - -The SimPL applies to the software's source and object code and comes -with any rights that I have in it (other than trademarks). You agree to -the SimPL by copying, distributing, or making a derivative work of the -software. - - You get the royalty free right to: - -- Use the software for any purpose; -- Make derivative works of it (this is called a "Derived Work"); -- Copy and distribute it and any Derived Work. - -If you distribute the software or a Derived Work, you must give back to -the community by: - -- Prominently noting the date of any changes you make; -- Leaving other people's copyright notices, warranty disclaimers, and - license terms in place; -- Providing the source code, build scripts, installation scripts, and - interface definitions in a form that is easy to get and best to - modify; -- Licensing it to everyone under SimPL, or substantially similar terms - (such as GPL 2.0), without adding further restrictions to the rights - provided; -- Conspicuously announcing that it is available under that license. - -There are some things that you must shoulder: - -- You get NO WARRANTIES. None of any kind; -- If the software damages you in any way, you may only recover direct - damages up to the amount you paid for it (that is zero if you did - not pay anything). You may not recover any other damages, including - those called "consequential damages." (The state or country where - you live may not allow you to limit your liability in this way, so - this may not apply to you); - -The SimPL continues perpetually, except that your license rights end -automatically if: - -- You do not abide by the "give back to the community" terms (your - licensees get to keep their rights if they abide); -- Anyone prevents you from distributing the software under the terms - of the SimPL. - -License for the License ------------------------ - -You may do anything that you want with the SimPL text; it's a license -form to use in any way that you find helpful. To avoid confusion, -however, if you change the terms in any way then you may not call your -license the Simple Public License or the SimPL (but feel free to -acknowledge that your license is "based on the Simple Public License"). diff --git a/docs/content/doc/organization.md b/docs/content/doc/organization.md deleted file mode 100644 index f524c59d..00000000 --- a/docs/content/doc/organization.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: "Organization" -Pubdate: "2013-07-01" ---- - -Hugo uses markdown files with headers commonly called the front matter. Hugo respects the organization -that you provide for your content to minimize any extra configuration, though this can be overridden -by additional configuration in the front matter. - -## Organization -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. - - . - └── content - ├── post - | ├── firstpost.md // <- http://site.com/post/firstpost.html - | └── secondpost.md // <- http://site.com/post/secondpost.html - └── quote - ├── first.md // <- http://site.com/quote/first.html - └── second.md // <- http://site.com/quote/second.html - diff --git a/docs/content/doc/release-notes.md b/docs/content/doc/release-notes.md deleted file mode 100644 index 025b7187..00000000 --- a/docs/content/doc/release-notes.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: "Release Notes" -Pubdate: "2013-07-01" ---- - -* **0.9.0** - * Added support for aliases (redirects) -* **0.8.0** August 2, 2013 - * Added support for pretty urls (filename/index.html vs filename.html) - * Hugo supports a destination directory - * Will efficiently sync content in static to destination directory - * Cleaned up options.. now with support for short and long options - * Added support for TOML - * Added support for YAML - * Added support for Previous & Next - * Added support for indexes for the indexes - * Better Windows compatibility - * Support for series - * Adding verbose output - * Loads of bugfixes -* **0.7.0** July 4, 2013 - * Hugo now includes a simple server - * First public release -* **0.6.0** July 2, 2013 - * Hugo includes an example documentation site which it builds -* **0.5.0** June 25, 2013 - * Hugo is quite usable and able to build spf13.com - diff --git a/docs/content/doc/roadmap.md b/docs/content/doc/roadmap.md deleted file mode 100644 index a0921efa..00000000 --- a/docs/content/doc/roadmap.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: "Roadmap" -Pubdate: "2013-07-01" ---- - -In no particular order, here is what we are working on: - - * Pagination - * Support for top level pages (other than homepage) - * Better error handling - * Syntax highlighting - * Commands - * Actions (eg. hugo create page) - * Related Posts - * Support for other formats - - diff --git a/docs/content/doc/shortcodes.md b/docs/content/doc/shortcodes.md deleted file mode 100644 index 222963b0..00000000 --- a/docs/content/doc/shortcodes.md +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: "Shortcodes" -Pubdate: "2013-07-01" ---- - -Because Hugo uses markdown for it's content format, it was clear that there's a lot of things that -markdown doesn't support well. This is good, the simple nature of markdown is exactly why we chose it. - -However we cannot accept being constrained by our simple format. Also unacceptable is writing raw -html in our markdown every time we want to include unsupported content such as a video. To do -so is in complete opposition to the intent of using a bare bones format for our content and -utilizing templates to apply styling for display. - -To avoid both of these limitations Hugo has full support for shortcodes. - -### What is a shortcode? -A shortcode is a simple snippet inside a markdown file that Hugo will render using a template. - -Short codes are designated by the opening and closing characters of '{{%' and '%}}' respectively. -Short codes are space delimited. The first word is always the name of the shortcode. Following the -name are the parameters. The author of the shortcode can choose if the short code -will use positional parameters or named parameters (but not both). A good rule of thumb is that if a -short code has a single required value in the case of the youtube example below then positional -works very well. For more complex layouts with optional parameters named parameters work best. - -The format for named parameters models that of html with the format name="value" - -### Example: youtube -*Example has an extra space so Hugo doesn't actually render it* - - {{ % youtube 09jf3ow9jfw %}} - -This would be rendered as - -
- -
- -### Example: image with caption -*Example has an extra space so Hugo doesn't actually render it* - - {{ % img src="/media/spf13.jpg" title="Steve Francia" %}} - -Would be rendered as: - -
- -
-

Steve Francia

-
-
- - -### Creating a shortcode - -All that you need to do to create a shortcode is place a template in the layouts/shortcodes directory. - -The template name will be the name of the shortcode. - -**Inside the template** - -To access a parameter by either position or name the index method can be used. - - {{ index .Params 0 }} - or - {{ index .Params "class" }} - -To check if a parameter has been provided use the isset method provided by Hugo. - - {{ if isset .Params "class"}} class="{{ index .Params "class"}}" {{ end }} - - diff --git a/docs/content/doc/source-directory.md b/docs/content/doc/source-directory.md deleted file mode 100644 index 26312757..00000000 --- a/docs/content/doc/source-directory.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -title: "Source Directory Organization" -Pubdate: "2013-07-01" ---- - -Hugo takes a single directory and uses it as the input for creating a complete website. - -Hugo has a very small amount of configuration, while remaining highly customizable. -It accomplishes by assuming that you will only provide templates with the intent of -using them. - -An example directory may look like: - - . - ├── config.yaml - ├── content - | ├── post - | | ├── firstpost.md - | | └── secondpost.md - | └── quote - | | ├── first.md - | | └── second.md - ├── layouts - | ├── chrome - | | ├── header.html - | | └── footer.html - | ├── indexes - | | ├── category.html - | | ├── post.html - | | ├── quote.html - | | └── tag.html - | ├── post - | | ├── li.html - | | ├── single.html - | | └── summary.html - | ├── quote - | | ├── li.html - | | ├── single.html - | | └── summary.html - | ├── shortcodes - | | ├── img.html - | | ├── vimeo.html - | | └── youtube.html - | ├── index.html - | └── rss.xml - └── static - -This directory structure tells us a lot about this site: - -1. the website intends to have two different types of content, posts and quotes. -2. It will also apply two different indexes to that content, categories and tags. -3. It will be displaying content in 3 different views, a list, a summary and a full page view. - -Included with the repository is this example site ready to be rendered. diff --git a/docs/content/doc/templates.md b/docs/content/doc/templates.md deleted file mode 100644 index 6b6e0f34..00000000 --- a/docs/content/doc/templates.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -title: "Templates" -Pubdate: "2013-07-01" ---- - -Hugo uses the excellent golang html/template library for it's template engine. It is an extremely -lightweight engine that provides a very small amount of logic. In our -experience that it is just the right amount of logic to be able to create a good static website - -This document will not cover how to use golang templates, but the [golang docs](http://golang.org/pkg/html/template/) -provide a good introduction. - -### Template roles - -There are 5 different kinds of templates that Hugo works with. - -#### index.html -This file must exist in the layouts directory. It is the template used to render the -homepage of your site. - -#### rss.xml -This file must exist in the layouts directory. It will be used to render all rss documents. -The one provided in the example application will generate an ATOM format. - -*Important: Hugo will automatically add the following header line to this file.* - - - -#### Indexes -An index is a page that list multiple pieces of content. If you think of a typical blog, the tag -pages are good examples of indexes. - - -#### Content Type(s) -Hugo supports multiple types of content. Another way of looking at this is that Hugo has the ability -to render content in a variety of ways as determined by the type. - -#### Chrome -Chrome is simply the decoration of your site. It's not a requirement to have this, but in practice -it's very convenient. Hugo doesn't know anything about Chrome, it's simply a convention that you may -likely find beneficial. As you create the rest of your templates you will include templates from the -/layout/chrome directory. I've found it helpful to include a header and footer template -in Chrome so I can include those in the other full page layouts (index.html, indexes/ type/single.html). - -### Adding a new content type - -Adding a type is easy. - -**Step 1:** -Create a directory with the name of the type in layouts.Type is always singular. *Eg /layouts/post*. - -**Step 2:** -Create a file called single.html inside your directory. *Eg /layouts/post/single.html*. - -**Step 3:** -Create a file with the same name as your directory in /layouts/indexes/. *Eg /layouts/index/post.html*. - -**Step 4:** -Many sites support rendering content in a few different ways, for instance a single page view and a -summary view to be used when displaying a list of contents on a single page. Hugo makes no assumptions -here about how you want to display your content, and will support as many different views of a content -type as your site requires. All that is required for these additional views is that a template -exists in each layout/type directory with the same name. - -For these, reviewing this example site will be very helpful in order to understand how these types work. - diff --git a/docs/content/doc/usage.md b/docs/content/doc/usage.md deleted file mode 100644 index 3d0dbe9e..00000000 --- a/docs/content/doc/usage.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -title: "Using Hugo" -Pubdate: "2013-07-01" ---- - -Make sure either hugo is in your path or provide a path to it. - - $ hugo --help - usage: hugo [flags] [] - -b, --base-url="": hostname (and path) to the root eg. http://spf13.com/ - -D, --build-drafts=false: include content marked as draft - --config="": config file (default is path/config.yaml|json|toml) - -d, --destination="": filesystem path to write files to - -h, --help=false: show this help - --port="1313": port to run web server on, default :1313 - -S, --server=false: run a (very) simple web server - -s, --source="": filesystem path to read files relative from - --uglyurls=false: if true, use /filename.html instead of /filename/ - -v, --verbose=false: verbose output - --version=false: which version of hugo - -w, --watch=false: watch filesystem for changes and recreate as needed - -## Common Usage Example: - -The most common use is probably to run hugo with your current -directory being the input directory. - - - $ hugo - > X pages created - > Y indexes created - in 8 ms - - -If you are working on things and want to see the changes -immediately, tell Hugo to watch for changes. **It will -recreate the site faster than you can tab over to -your browser to view the changes.** - - $ hugo -s ~/mysite --watch - Watching for changes. Press ctrl+c to stop - 15 pages created - 0 tags created - in 8 ms - -Hugo can even run a server and create your site at the same time! - - $hugo --server -ws ~/mysite - Watching for changes. Press ctrl+c to stop - 15 pages created - 0 tags created - in 8 ms - Web Server is available at http://localhost:1313 - Press ctrl+c to stop - diff --git a/docs/content/doc/variables.md b/docs/content/doc/variables.md deleted file mode 100644 index 27f4c66a..00000000 --- a/docs/content/doc/variables.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: "Variables" -Pubdate: "2013-07-01" ---- - -Hugo makes a set of values available to the templates. Go templates are context based. The following -are available in the context for the templates. - -**.Title** The title for the content.
-**.Description** The description for the content.
-**.Keywords** The meta keywords for this content.
-**.Date** The date the content is published on.
-**.Indexes** These will use the field name of the plural form of the index (see tags and categories above)
-**.Permalink** The Permanent link for this page.
-**.FuzzyWordCount** The approximate number of words in the content.
-**.RSSLink** Link to the indexes' rss link
-**.Prev** Pointer to the previous content (based on pub date)
-**.Next** Pointer to the following content (based on pub date)
-**.Content** The content itself, defined below the front matter.
- -Any 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**
-**.Params.Categories**
- -Also available is `.Site` which has the following: - -**.Site.BaseUrl** The base URL for the site as defined in the config.json file.
-**.Site.Indexes** The names of the indexes of the site.
-**.Site.LastChange** The date of the last change of the most recent content.
-**.Site.Recent** Array of all content ordered by Date, newest first
diff --git a/docs/content/extras/aliases.md b/docs/content/extras/aliases.md new file mode 100644 index 00000000..d1228d69 --- /dev/null +++ b/docs/content/extras/aliases.md @@ -0,0 +1,34 @@ +--- +title: "Aliases" +date: "2013-07-09" +aliases: + - /doc/redirects/ + - /doc/alias/ + - /doc/aliases/ +--- + +For people migrating existing published content to Hugo theres a good chance +you need a mechanism to handle redirecting old urls. + +Luckily, this can be handled easily with aliases in Hugo. + +## Example +**content/posts/my-awesome-blog-post.md** + + --- + aliases: + - /posts/my-original-url/ + - /2010/even-earlier-url.html + --- + +Now when you go to any of the aliases locations they +will redirect to the page. + +## Important Behaviors + +1. *Hugo makes no assumptions about aliases. They also don't change based +on your UglyUrls setting. You Need to provide a relative path and the +complete filename or directory.* + +2. *Aliases are rendered prior to any content and will be overwritten by +any content with the same location.* diff --git a/docs/content/extras/indexes.md b/docs/content/extras/indexes.md new file mode 100644 index 00000000..b08c8374 --- /dev/null +++ b/docs/content/extras/indexes.md @@ -0,0 +1,220 @@ +--- +title: "Indexes" +date: "2013-07-01" +aliases: ["/doc/indexes/"] +--- + +Hugo includes support for user defined indexes of content. In our +terminology an index is best thought of as tags applied to content +but they can be used for far more than just tags. Other common +uses would include categories, groups, series. For the purpose of +this document we will just use tags for our example. For a more +complete example see [spf13.com-hugo](http://github.com/spf13/spf13.com-hugo). + +## Defining Indexes for a site + +Indexes must be defined in the site configuration, before they +can be used throughout the site. + +Here is an example configuration in YAML that specifies two indexes. +Notice the format is **singular key** : *plural value*. While +we could use an inflection library to pluralize this, they currently +support only a few languages, so instead we've opted for user defined +pluralization. + +**config.yaml** + + --- + indexes: + tag: "tags" + topic: "topics" + baseurl: "http://spf13.com/" + title: "Steve Francia is spf13.com" + --- + +## Creating index templates +For each index type a template needs to be provided to render the index page. +In the case of tags, this will render the content for /tags/TAGNAME/. + +The template must be called the singular name of the index and placed in +layouts/indexes + + . + └── layouts + └── indexes + └── category.html + +The template will be provided Data about the index. + +### Variables + +The following variables are available to the index template: + +**.Title** The title for the content.
+**.Date** The date the content is published on.
+**.Permalink** The Permanent link for this page.
+**.RSSLink** Link to the indexes' rss link.
+**.Data.Pages** The content that is assigned this index.
+**.Data.`singular`** The index itself.
+ +#### Example + + {{ template "chrome/header.html" . }} + {{ template "chrome/subheader.html" . }} + +
+
+

{{ .Title }}

+ {{ range .Data.Pages }} + {{ .Render "summary"}} + {{ end }} +
+
+ + {{ template "chrome/footer.html" }} + + +## Assigning indexes to content + +Once an index is defined at the site level, any piece of content +can be assigned to it regardless of content type or section. + +Assigning content to an index is done in the front matter. +Simply create a variable with the *plural* name of the index +and assign all keys you want this content to match against. + +**Index values are case insensitive** + +#### Example + { + "title": "Hugo: A fast and flexible static site generator", + "tags": [ + "Development", + "golang", + "Blogging" + ], + "slug": "hugo", + "project_url": "http://github.com/spf13/hugo" + } + + +## Displaying indexes within content + +Within your content templates you may wish to display +the indexes that that piece of content is assigned to. + +Because we are leveraging the front matter system to +define indexes for content, the indexes assigned to +each content piece are located in the usual place +(.Params.`plural`) + +#### Example + + + +If you wish to display the list of all indexes, the index can +be retrieved from the `.Site` variable. + +#### Example + + + +## Creating Indexes of Indexes + +Hugo also supports creating pages that list your values for each +index along with the number of content items associated with the +index key. + +This may take the form of a tag cloud or simply a list. + +To have hugo create these indexes of indexes pages, simply create +a template in indexes called indexes.html + +Hugo provides two different versions of the index. One alphabetically +sorted, the other sorted by most popular. It's important to recognize +that the data structure of the two is different. + +#### Example indexes.html file (alphabetical) + + {{ template "chrome/header.html" . }} + {{ template "chrome/subheader.html" . }} + +
+
+

{{ .Title }}

+
    + {{ $data := .Data }} + {{ range $key, $value := .Data.Index }} +
  • {{ $key }} {{ len $value }}
  • + {{ end }} +
+
+
+ + {{ template "chrome/footer.html" }} + + +#### Example indexes.html file (ordered) + + {{ template "chrome/header.html" . }} + {{ template "chrome/subheader.html" . }} + +
+
+

{{ .Title }}

+
    + {{ range $data.OrderedIndex }} +
  • {{ .Name }} {{ .Count }}
  • + {{ end }} +
+
+
+ + {{ template "chrome/footer.html" }} + +### Variables available to indexes of indexes pages. + +**.Title** The title for the content.
+**.Date** The date the content is published on.
+**.Permalink** The Permanent link for this page.
+**.RSSLink** Link to the indexes' rss link.
+**.Data.Singular** The singular name of the index
+**.Data.Plural** The plural name of the index
+**.Data.Index** The Alphabetical index
+**.Data.OrderedIndex** The popular index
+ +## Creating a menu based on indexes + +Hugo can generate menus based on indexes by iterating and +nesting the index keys. This can be used to build a hierarchy +of content within your site. + +To have hugo create the menu, simply create a template in chome +called menu.html, then include it using the +`{{ template "chrome/menu.html" . }}` syntax. + + +#### Example menu.html file + + + diff --git a/docs/content/extras/indexes/category.md b/docs/content/extras/indexes/category.md new file mode 100644 index 00000000..6b948124 --- /dev/null +++ b/docs/content/extras/indexes/category.md @@ -0,0 +1,54 @@ +--- +title: "Index Category Example" +date: "2013-07-01" +--- + +This page demonstrates an example of using indexes to provide categories for your site. + +### config.yaml +First step is to define the index in your config file. +*Because we use both the singular and plural name of the index in our rendering it's +important to provide both here. We require this, rather than using inflection in +effort to support as many languages as possible.* + + --- + indexes: + category: "categories" + baseurl: "http://spf13.com/" + title: "Steve Francia is spf13.com" + --- + +### /layouts/indexes/category.html + +For each index type a template needs to be provided to render the index page. +In the case of categories, this will render the content for /categories/CATEGORYNAME/. + + {{ template "chrome/header.html" . }} + {{ template "chrome/subheader.html" . }} + +
+
+

{{ .Title }}

+ {{ range .Data.Pages }} + {{ .Render "summary"}} + {{ end }} +
+
+ + {{ template "chrome/footer.html" }} + + +### Assigning indexes to content + +Make sure that the index is set in the front matter: + + { + "title": "Hugo: A fast and flexible static site generator", + "categories": [ + "Development", + "golang", + "Blogging" + ], + "slug": "hugo" + } + diff --git a/docs/content/extras/indexes/series.md b/docs/content/extras/indexes/series.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/content/extras/shortcodes.md b/docs/content/extras/shortcodes.md new file mode 100644 index 00000000..a288fe58 --- /dev/null +++ b/docs/content/extras/shortcodes.md @@ -0,0 +1,77 @@ +--- +title: "Shortcodes" +date: "2013-07-01" +aliases: ["/doc/shortcodes/"] +--- + +Because Hugo uses markdown for it's content format, it was clear that there's a lot of things that +markdown doesn't support well. This is good, the simple nature of markdown is exactly why we chose it. + +However we cannot accept being constrained by our simple format. Also unacceptable is writing raw +html in our markdown every time we want to include unsupported content such as a video. To do +so is in complete opposition to the intent of using a bare bones format for our content and +utilizing templates to apply styling for display. + +To avoid both of these limitations Hugo has full support for shortcodes. + +### What is a shortcode? +A shortcode is a simple snippet inside a markdown file that Hugo will render using a template. + +Short codes are designated by the opening and closing characters of '{{%' and '%}}' respectively. +Short codes are space delimited. The first word is always the name of the shortcode. Following the +name are the parameters. The author of the shortcode can choose if the short code +will use positional parameters or named parameters (but not both). A good rule of thumb is that if a +short code has a single required value in the case of the youtube example below then positional +works very well. For more complex layouts with optional parameters named parameters work best. + +The format for named parameters models that of html with the format name="value" + +### Example: youtube +*Example has an extra space so Hugo doesn't actually render it* + + {{ % youtube 09jf3ow9jfw %}} + +This would be rendered as + +
+ +
+ +### Example: image with caption +*Example has an extra space so Hugo doesn't actually render it* + + {{ % img src="/media/spf13.jpg" title="Steve Francia" %}} + +Would be rendered as: + +
+ +
+

Steve Francia

+
+
+ + +### Creating a shortcode + +All that you need to do to create a shortcode is place a template in the layouts/shortcodes directory. + +The template name will be the name of the shortcode. + +**Inside the template** + +To access a parameter by either position or name the index method can be used. + + {{ index .Params 0 }} + or + {{ index .Params "class" }} + +To check if a parameter has been provided use the isset method provided by Hugo. + + {{ if isset .Params "class"}} class="{{ index .Params "class"}}" {{ end }} + + diff --git a/docs/content/layout/chrome.md b/docs/content/layout/chrome.md new file mode 100644 index 00000000..1616625a --- /dev/null +++ b/docs/content/layout/chrome.md @@ -0,0 +1,80 @@ +--- +title: "Chrome Templates" +date: "2013-07-01" +--- +Chrome is a convention to create templates that are used by the other templates +throughout the site. There is nothing special about the name "chrome", feel free +to provide and use your own. + +It's not a requirement to have this, but in practice it's very convenient. Hugo doesn't +know anything about Chrome, it's simply a convention that you may likely find +beneficial. As you create the rest of your templates you will include templates +from the /layout/chrome directory. + +I've found it helpful to include a header and footer template in Chrome so I can +include those in the other full page layouts (index.html, indexes/ +type/single.html). There is nothing special about header.html and footer.html +other than they seem like good names to use for inclusion in your other +templates. + + ▾ layouts/ + ▾ chrome/ + header.html + footer.html + +By ensuring that we only reference [variables](/layout/variables/) variables +used for both nodes and pages we can use the same chrome for both. + +## example header.html +This header template is used for [spf13.com](http://spf13.com). + + + + + + + {{ template "chrome/meta.html" . }} + + + {{ .Title }} : spf13.com + + {{ if .RSSlink }}{{ end }} + + {{ template "chrome/head_includes.html" . }} + + + + + +## example footer.html +This header template is used for [spf13.com](http://spf13.com). + + + + + + +**For examples of referencing these templates, see [content +templates](/layout/content/) and [homepage templates](/layout/homepage/)** diff --git a/docs/content/layout/content.md b/docs/content/layout/content.md new file mode 100644 index 00000000..e6df5886 --- /dev/null +++ b/docs/content/layout/content.md @@ -0,0 +1,125 @@ +--- +title: "Content Templates" +date: "2013-07-01" +--- + +Content templates are created in a directory matching the name of the content. + +Content pages are of the type "page" and have all the [page +variables](/layout/variables/) available to use in the templates. + +In the following examples we have created two different content types as well as +a default content type. + + ▾ layouts/ + ▾ post/ + single.html + ▾ project/ + single.html + +Hugo also has support for a default content template to be used in the event +that a specific template has not been provided for that type. The default type +works the same as the other types but the directory must be called "_default". +[Content views](/layout/views) can also be defined in the "_default" directory. + + + ▾ layouts/ + ▾ _default/ + single.html + + + + +## post/single.html +This content template is used for [spf13.com](http://spf13.com). +It makes use of [chrome templates](/layout/chrome) + + {{ template "chrome/header.html" . }} + {{ template "chrome/subheader.html" . }} + {{ $baseurl := .Site.BaseUrl }} + +
+

{{ .Title }}

+
+
+ {{ .Content }} +
+
+
+ + + + {{ template "chrome/disqus.html" . }} + {{ template "chrome/footer.html" . }} + + +## project/single.html +This content template is used for [spf13.com](http://spf13.com). +It makes use of [chrome templates](/layout/chrome) + + + {{ template "chrome/header.html" . }} + {{ template "chrome/subheader.html" . }} + {{ $baseurl := .Site.BaseUrl }} + +
+

{{ .Title }}

+
+
+ {{ .Content }} +
+
+
+ + + + {{if isset .Params "project_url" }} +
+ Fork me on GitHub +
+ {{ end }} + + {{ template "chrome/footer.html" }} + + +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. diff --git a/docs/content/layout/go-templates.md b/docs/content/layout/go-templates.md new file mode 100644 index 00000000..b3c15a09 --- /dev/null +++ b/docs/content/layout/go-templates.md @@ -0,0 +1,15 @@ +--- +title: "Go Templates" +date: "2013-07-01" +--- + +Hugo uses the excellent golang html/template library for it's template engine. +It is an extremely lightweight engine that provides a very small amount of +logic. In our experience that it is just the right amount of logic to be able to +create a good static website. + +This is a brief primer on using go templates. The [golang +docs](http://golang.org/pkg/html/template/) provide more details. + + + diff --git a/docs/content/layout/homepage.md b/docs/content/layout/homepage.md new file mode 100644 index 00000000..85fb276c --- /dev/null +++ b/docs/content/layout/homepage.md @@ -0,0 +1,50 @@ +--- +title: "Homepage Templates" +date: "2013-07-01" +--- + +Home pages are of the type "node" and have all the [node +variables](/layout/variables/) available to use in the templates. + +*This is the only required template for building a site and useful when +bootstrapping a new site and template.* + +In addition to the standard node variables, the homepage has access to +all site content accessible from .Data.Pages + + + ▾ layouts/ + index.html + + +## example index.html +This content template is used for [spf13.com](http://spf13.com). +It makes use of [chrome templates](/layout/chrome) + + + + + + + {{ template "chrome/meta.html" . }} + + + {{ .Site.Title }} + + + + {{ template "chrome/head_includes.html" . }} + + + + {{ template "chrome/subheader.html" . }} + +
+
+ {{ range .Data.Pages }} + {{ .Render "summary"}} + {{ end }} +
+
+ + {{ template "chrome/footer.html" }} diff --git a/docs/content/layout/index.md b/docs/content/layout/index.md new file mode 100644 index 00000000..7184bbf6 --- /dev/null +++ b/docs/content/layout/index.md @@ -0,0 +1,122 @@ +--- +title: "Index Templates" +date: "2013-07-01" +--- + +An index template is any template that will be used to render multiple pieces of +content (with the exception of the [homepage](/layout/homepage) which has a +dedicated template). + +We are using the term index in it's truest sense, a sequential arrangement of +material, especially in alphabetical or numerical order. In the case of Hugo +each index will render the content in newest first order based on the date +provided in the [front matter](/content/front-matter). + +index pages are of the type "node" and have all the [node +variables](/layout/variables/) available to use in the templates. +All index templates live in the layouts/indexes directory. There are 3 different +kinds of indexes that Hugo can produce. + +1. A listing of all the content for a given [section](/content/sections) +2. A listing of all the content for a given [index](/extras/indexes) +3. A listing of listings... [meta index](/extras/indexes) + +It's critical that the name of the index template matches either: + +1. The section name +2. The index singular name +3. "indexes" + +The following illustrates the location of one of each of these types. + + ▾ layouts/ + ▾ indexes/ + indexes.html + post.html + tag.html + +## Example section template (post.html) +This content template is used for [spf13.com](http://spf13.com). +It makes use of [chrome templates](/layout/chrome). All examples use a +[view](/layout/views/) called either "li" or "summary" which this example site +defined. + + {{ template "chrome/header.html" . }} + {{ template "chrome/subheader.html" . }} + +
+
+

{{ .Title }}

+
    + {{ range .Data.Pages }} + {{ .Render "li"}} + {{ end }} +
+
+
+ + {{ template "chrome/footer.html" }} + +## Example index template (tag.html) +This content template is used for [spf13.com](http://spf13.com). +It makes use of [chrome templates](/layout/chrome). All examples use a +[view](/layout/views/) called either "li" or "summary" which this example site +defined. + + {{ template "chrome/header.html" . }} + {{ template "chrome/subheader.html" . }} + +
+
+

{{ .Title }}

+ {{ range .Data.Pages }} + {{ .Render "summary"}} + {{ end }} +
+
+ + {{ template "chrome/footer.html" }} + + +## Example listing of indexes template (indexes.html) +This content template is used for [spf13.com](http://spf13.com). +It makes use of [chrome templates](/layout/chrome). The list of indexes +templates cannot use a [content view](/layout/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 +content tagged with each tag. + +This example demonstrates two different approaches. The first uses .Data.Index and +the latter uses .Data.OrderedIndex. .Data.Index is alphabetical by key name, while +.Data.Orderedindex is ordered by the quantity of content assigned to that particular +index key. In practice you would only use one of these approaches. + + {{ template "chrome/header.html" . }} + {{ template "chrome/subheader.html" . }} + +
+
+

{{ .Title }}

+ +
    + {{ $data := .Data }} + {{ range $key, $value := .Data.Index }} +
  • {{ $key }} {{ len $value }}
  • + {{ end }} +
+
+ + +
+ + {{ template "chrome/footer.html" }} + + + + diff --git a/docs/content/layout/rss.md b/docs/content/layout/rss.md new file mode 100644 index 00000000..6331cb08 --- /dev/null +++ b/docs/content/layout/rss.md @@ -0,0 +1,47 @@ +--- +title: "RSS (feed) Templates" +date: "2013-07-01" +--- + +A single RSS template is used to generate all of the RSS content for the entire +site. + +RSS 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 + + ▾ layouts/ + rss.xml + +## rss.xml +This rss template is used for [spf13.com](http://spf13.com). It adheres to the +ATOM 2.0 Spec. + + + + + {{ .Title }} on {{ .Site.Title }} + {{ .Permalink }} + en-us + Steve Francia + Copyright (c) 2008 - 2013, Steve Francia; all rights reserved. + {{ .Date }} + {{ range .Data.Pages }} + + {{ .Title }} + {{ .Permalink }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 MST" }} + Steve Francia + {{ .Permalink }} + {{ .Content | html }} + + {{ end }} + + + +*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.* + + diff --git a/docs/content/layout/templates.md b/docs/content/layout/templates.md new file mode 100644 index 00000000..521c73cb --- /dev/null +++ b/docs/content/layout/templates.md @@ -0,0 +1,35 @@ +--- +title: "Templates" +date: "2013-07-01" +aliases: ["/doc/templates/"] +--- + +Hugo uses the excellent golang html/template library for it's template engine. +It is an extremely lightweight engine that provides a very small amount of +logic. In our experience that it is just the right amount of logic to be able +to create a good static website + +If you are new to go's templates the [go template primer](/layout/go-templates) +is a great place to start. + +## Template roles + +There are 6 different kinds of templates that Hugo works with. + +### [Homepage](/layout/homepage/) +The homepage of your site. + +### [RSS](/layout/rss/) +Used to render all rss documents. + +### [Indexes](/layout/indexes) +Page that list multiple pieces of content. + +### [Content](/layout/content) +Templates to render a single piece of content. + +### [Views](/layout/views) +Different ways of rendering each content type + +### [Chrome](/layout/chrome) +Simply the decoration of your site. diff --git a/docs/content/layout/variables.md b/docs/content/layout/variables.md new file mode 100644 index 00000000..9e811551 --- /dev/null +++ b/docs/content/layout/variables.md @@ -0,0 +1,51 @@ +--- +title: "Variables" +date: "2013-07-01" +aliases: ["/doc/variables/"] +--- + +Hugo makes a set of values available to the templates. Go templates are context based. The following +are available in the context for the templates. + +## Page Variables + +**.Title** The title for the content.
+**.Description** The description for the content.
+**.Keywords** The meta keywords for this content.
+**.Date** The date the content is published on.
+**.Indexes** These will use the field name of the plural form of the index (see tags and categories above)
+**.Permalink** The Permanent link for this page.
+**.FuzzyWordCount** The approximate number of words in the content.
+**.RSSLink** Link to the indexes' rss link
+**.Prev** Pointer to the previous content (based on pub date)
+**.Next** Pointer to the following content (based on pub date)
+**.Site** See site variables below
+**.Content** The content itself, defined below the front matter.
+ +Any 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**
+**.Params.Categories**
+ +## Node Variables +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.
+**.Date** The date the content is published on.
+**.Data** The data specific to this type of node.
+**.Permalink** The Permanent link for this node
+**.Url** The relative url for this node.
+**.RSSLink** Link to the indexes' rss link
+**.Site** See site variables below
+ +## Site Variables + +Also available is `.Site` which has the following: + +**.Site.BaseUrl** The base URL for the site as defined in the config.json file.
+**.Site.Indexes** The names of the indexes of the site.
+**.Site.LastChange** The date of the last change of the most recent content.
+**.Site.Recent** Array of all content ordered by Date, newest first
+ diff --git a/docs/content/layout/views.md b/docs/content/layout/views.md new file mode 100644 index 00000000..bf02ceda --- /dev/null +++ b/docs/content/layout/views.md @@ -0,0 +1,79 @@ +--- +title: "Content Views" +date: "2013-07-01" +--- + +In addition to the [single content view](/layout/content/), Hugo can render alternative views of +your content. These are especially useful in [index](/layout/index) templates. + +To create a new view simple 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](/layout/content) +template "single.html" + + ▾ layouts/ + ▾ post/ + li.html + single.html + summary.html + ▾ project/ + li.html + single.html + summary.html + +Hugo also has support for a default content template to be used in the event +that a specific template has not been provided for that type. The default type +works the same as the other types but the directory must be called "_default". +Content views can also be defined in the "_default" directory. + + + ▾ layouts/ + ▾ _default/ + li.html + single.html + summary.html + + +Hugo will pass the entire page object to the view template. See [page +variables](/layout/variables) for a complete list. + +## Example li.html +This content template is used for [spf13.com](http://spf13.com). + +
  • + {{ .Title }} +
    {{ .Date.Format "Mon, Jan 2, 2006" }}
    +
  • + +## Example summary.html +This content template is used for [spf13.com](http://spf13.com). + +
    +
    +

    {{ .Title }}

    + +
    + + {{ .Summary }} + +
    + + +## Example render of view +Using the summary view inside of another ([index](/layout/index)) template. + +
    +
    +

    {{ .Title }}

    + {{ range .Data.Pages }} + {{ .Render "summary"}} + {{ end }} +
    +
    + +In the above example you will notice that we have called .Render and passed in +which view to render the content with. Render is a special function available on +a content which tells the content to render itself with the provided view template. diff --git a/docs/content/meta/contributing.md b/docs/content/meta/contributing.md new file mode 100644 index 00000000..0a1a0493 --- /dev/null +++ b/docs/content/meta/contributing.md @@ -0,0 +1,45 @@ +--- +title: "Contributing to Hugo" +date: "2013-07-01" +aliases: ["/doc/contributing/"] +--- + +We welcome all contributions. If you want to contribute, all +that is needed is simply fork Hugo, make changes and submit +a pull request. If you prefer, pick something from the roadmap +or contact [spf13](http://spf13.com) about what may make sense +to do next. + +## Overview +1. Fork it from https://github.com/spf13/hugo +2. Create your feature branch (`git checkout -b my-new-feature`) +3. Commit your changes (`git commit -am 'Add some feature'`) +4. Push to the branch (`git push origin my-new-feature`) +5. Create new Pull Request + + +### Clone locally (for contributors): + + git clone https://github.com/spf13/hugo + cd hugo + go get + +Because go expects all of your libraries to be found in either +$GOROOT or $GOPATH, it's helpful to symlink the project to one +of the following paths: + + * ln -s /path/to/your/hugo $GOPATH/src/github.com/spf13/hugo + * ln -s /path/to/your/hugo $GOROOT/src/pkg/github.com/spf13/hugo + +### Running Hugo + + cd /path/to/hugo + go install github.com/spf13/hugo/hugolibs + go run main.go + +### Building Hugo + + cd /path/to/hugo + go build -o hugo main.go + mv hugo /usr/local/bin/ + diff --git a/docs/content/meta/contributors.md b/docs/content/meta/contributors.md new file mode 100644 index 00000000..3b24fb2a --- /dev/null +++ b/docs/content/meta/contributors.md @@ -0,0 +1,12 @@ +--- +title: "Contributors" +date: "2013-07-01" +aliases: ["/doc/contributors/"] +--- + +Hugo was built with love and golang by: + +* Steve Francia - [spf13](https://github.com/spf13) +* Noah Campbell - [noahcampbell](https://github.com/noahcampbell) +* [Many more](http://github.com/spf13/hugo/graphs/contributors) + diff --git a/docs/content/meta/license.md b/docs/content/meta/license.md new file mode 100644 index 00000000..e9b2c466 --- /dev/null +++ b/docs/content/meta/license.md @@ -0,0 +1,76 @@ +--- +title: "License" +date: "2013-07-01" +aliases: ["/doc/license/", "/license/"] +--- + +Hugo is released under the Simple Public License. + + +Simple Public License (SimPL-2.0) +================================= + +Preamble +-------- + +This Simple Public License 2.0 (SimPL-2.0 for short) is a plain language +implementation of GPL 2.0. The words are different, but the goal is the +same - to guarantee for all users the freedom to share and change +software. If anyone wonders about the meaning of the SimPL, they should +interpret it as consistent with GPL 2.0. + + +Simple Public License (SimPL) 2.0 +================================= + +The SimPL applies to the software's source and object code and comes +with any rights that I have in it (other than trademarks). You agree to +the SimPL by copying, distributing, or making a derivative work of the +software. + + You get the royalty free right to: + +- Use the software for any purpose; +- Make derivative works of it (this is called a "Derived Work"); +- Copy and distribute it and any Derived Work. + +If you distribute the software or a Derived Work, you must give back to +the community by: + +- Prominently noting the date of any changes you make; +- Leaving other people's copyright notices, warranty disclaimers, and + license terms in place; +- Providing the source code, build scripts, installation scripts, and + interface definitions in a form that is easy to get and best to + modify; +- Licensing it to everyone under SimPL, or substantially similar terms + (such as GPL 2.0), without adding further restrictions to the rights + provided; +- Conspicuously announcing that it is available under that license. + +There are some things that you must shoulder: + +- You get NO WARRANTIES. None of any kind; +- If the software damages you in any way, you may only recover direct + damages up to the amount you paid for it (that is zero if you did + not pay anything). You may not recover any other damages, including + those called "consequential damages." (The state or country where + you live may not allow you to limit your liability in this way, so + this may not apply to you); + +The SimPL continues perpetually, except that your license rights end +automatically if: + +- You do not abide by the "give back to the community" terms (your + licensees get to keep their rights if they abide); +- Anyone prevents you from distributing the software under the terms + of the SimPL. + +License for the License +----------------------- + +You may do anything that you want with the SimPL text; it's a license +form to use in any way that you find helpful. To avoid confusion, +however, if you change the terms in any way then you may not call your +license the Simple Public License or the SimPL (but feel free to +acknowledge that your license is "based on the Simple Public License"). diff --git a/docs/content/meta/release-notes.md b/docs/content/meta/release-notes.md new file mode 100644 index 00000000..f4af8cdd --- /dev/null +++ b/docs/content/meta/release-notes.md @@ -0,0 +1,35 @@ +--- +title: "Release Notes" +date: "2013-07-01" +aliases: ["/doc/release-notes/"] +--- + +* **0.9.0** HEAD + * Added support for aliases (redirects) + * Cleanup of how content organization is handled + * Support for top level pages (other than homepage) + * Loads of unit and performance tests + * Integration with travis ci + * Complete overhaul of the documentation site + * Full Windows support +* **0.8.0** August 2, 2013 + * Added support for pretty urls (filename/index.html vs filename.html) + * Hugo supports a destination directory + * Will efficiently sync content in static to destination directory + * Cleaned up options.. now with support for short and long options + * Added support for TOML + * Added support for YAML + * Added support for Previous & Next + * Added support for indexes for the indexes + * Better Windows compatibility + * Support for series + * Adding verbose output + * Loads of bugfixes +* **0.7.0** July 4, 2013 + * Hugo now includes a simple server + * First public release +* **0.6.0** July 2, 2013 + * Hugo includes an example documentation site which it builds +* **0.5.0** June 25, 2013 + * Hugo is quite usable and able to build spf13.com + diff --git a/docs/content/meta/roadmap.md b/docs/content/meta/roadmap.md new file mode 100644 index 00000000..d0e8276e --- /dev/null +++ b/docs/content/meta/roadmap.md @@ -0,0 +1,18 @@ +--- +title: "Roadmap" +date: "2013-07-01" +aliases: ["/doc/roadmap/"] +--- + +In no particular order, here is what we are working on: + + * Pagination + * Support for top level pages (other than homepage) + * Better error handling + * Syntax highlighting + * Commands + * Actions (eg. hugo create page) + * Related Posts + * Support for other formats + + diff --git a/docs/content/overview/configuration.md b/docs/content/overview/configuration.md new file mode 100644 index 00000000..84790fda --- /dev/null +++ b/docs/content/overview/configuration.md @@ -0,0 +1,58 @@ +--- +title: "Configuring Hugo" +date: "2013-07-01" +aliases: ["/doc/configuration/"] +--- + +The directory structure and templates provide the majority of the +configuration for a site. In fact a config file isn't even needed for many websites +since the defaults used follow commonly used patterns. + +Hugo expects to find the config file in the root of the source directory and +will look there first for a config.yaml file. If none is present it will +then look for a config.json file, followed by a config.toml file. + +**Please note the field names must be all lowercase** + +## Examples + +The following is an example of a yaml config file with the default values: + + --- + contentdir: "content" + layoutdir: "layouts" + publishdir: "public" + builddrafts: false + indexes: + category: "categories" + tag: "tags" + baseurl: "http://yoursite.com/" + ... + + +The following is an example of a json config file with the default values: + + { + "contentdir": "content", + "layoutdir": "layouts", + "publishdir": "public", + "builddrafts": false, + "indexes": { + "category": "categories", + "tag": "tags" + }, + "baseurl": "http://yoursite.com/" + } + + +The following is an example of a toml config file with the default values: + + contentdir = "content" + layoutdir = "layouts" + publishdir = "public" + builddrafts = false + baseurl = "http://yoursite.com/" + [indexes] + category = "categories" + tag = "tags" + diff --git a/docs/content/overview/installing.md b/docs/content/overview/installing.md new file mode 100644 index 00000000..90456111 --- /dev/null +++ b/docs/content/overview/installing.md @@ -0,0 +1,47 @@ +--- +title: "Installing Hugo" +date: "2013-07-01" +aliases: ["/doc/installing/"] +--- + +Hugo is written in GoLang with support for Windows, Linux, FreeBSD and OSX. + +The latest release can be found at [hugo releases](https://github.com/spf13/hugo/releases). +We currently build for Windows, Linux, FreeBSD and OS X for x64 +and 386 architectures. + +## Installing Hugo (binary) + +Installation is very easy. Simply download the appropriate version for your +platform from [hugo releases](https://github.com/spf13/hugo/releases). +Once downloaded it can be run from anywhere. You don't need to install +it into a global location. This works well for shared hosts and other systems +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. + +*the Hugo executible has no external dependencies.* + +## Installing from source + +### Dependencies + +* Git +* Go 1.1+ +* Mercurial +* Bazaar + +### Get directly from Github: + + go get github.com/spf13/hugo + +### Building Hugo + + cd /path/to/hugo + go build -o hugo main.go + mv hugo /usr/local/bin/ + +## Contributing + +Please see the [contributing guide](/doc/contributing) diff --git a/docs/content/overview/source-directory.md b/docs/content/overview/source-directory.md new file mode 100644 index 00000000..12a70353 --- /dev/null +++ b/docs/content/overview/source-directory.md @@ -0,0 +1,55 @@ +--- +title: "Source Directory Organization" +date: "2013-07-01" +aliases: ["/doc/source-directory/"] +--- + +Hugo takes a single directory and uses it as the input for creating a complete website. + +Hugo has a very small amount of configuration, while remaining highly customizable. +It accomplishes by assuming that you will only provide templates with the intent of +using them. + +An example directory may look like: + + . + ├── config.yaml + ├── content + | ├── post + | | ├── firstpost.md + | | └── secondpost.md + | └── quote + | | ├── first.md + | | └── second.md + ├── layouts + | ├── chrome + | | ├── header.html + | | └── footer.html + | ├── indexes + | | ├── category.html + | | ├── post.html + | | ├── quote.html + | | └── tag.html + | ├── post + | | ├── li.html + | | ├── single.html + | | └── summary.html + | ├── quote + | | ├── li.html + | | ├── single.html + | | └── summary.html + | ├── shortcodes + | | ├── img.html + | | ├── vimeo.html + | | └── youtube.html + | ├── index.html + | └── rss.xml + └── static + +This directory structure tells us a lot about this site: + +1. the website intends to have two different types of content, posts and quotes. +2. It will also apply two different indexes to that content, categories and tags. +3. It will be displaying content in 3 different views, a list, a summary and a full page view. + +Included with the repository is this example site ready to be rendered. diff --git a/docs/content/overview/usage.md b/docs/content/overview/usage.md new file mode 100644 index 00000000..3f022a16 --- /dev/null +++ b/docs/content/overview/usage.md @@ -0,0 +1,56 @@ +--- +title: "Using Hugo" +date: "2013-07-01" +aliases: ["/doc/usage/"] +--- + +Make sure either hugo is in your path or provide a path to it. + + $ hugo --help + usage: hugo [flags] [] + -b, --base-url="": hostname (and path) to the root eg. http://spf13.com/ + -D, --build-drafts=false: include content marked as draft + --config="": config file (default is path/config.yaml|json|toml) + -d, --destination="": filesystem path to write files to + -h, --help=false: show this help + --port="1313": port to run web server on, default :1313 + -S, --server=false: run a (very) simple web server + -s, --source="": filesystem path to read files relative from + --uglyurls=false: if true, use /filename.html instead of /filename/ + -v, --verbose=false: verbose output + --version=false: which version of hugo + -w, --watch=false: watch filesystem for changes and recreate as needed + +## Common Usage Example: + +The most common use is probably to run hugo with your current +directory being the input directory. + + + $ hugo + > X pages created + > Y indexes created + in 8 ms + + +If you are working on things and want to see the changes +immediately, tell Hugo to watch for changes. **It will +recreate the site faster than you can tab over to +your browser to view the changes.** + + $ hugo -s ~/mysite --watch + Watching for changes. Press ctrl+c to stop + 15 pages created + 0 tags created + in 8 ms + +Hugo can even run a server and create your site at the same time! + + $hugo --server -ws ~/mysite + Watching for changes. Press ctrl+c to stop + 15 pages created + 0 tags created + in 8 ms + Web Server is available at http://localhost:1313 + Press ctrl+c to stop + diff --git a/docs/layouts/_default/single.html b/docs/layouts/_default/single.html new file mode 100644 index 00000000..5e42b2a0 --- /dev/null +++ b/docs/layouts/_default/single.html @@ -0,0 +1,4 @@ +{{ template "chrome/header.html" . }} +

    {{ .Title }}

    + {{ .Content }} +{{ template "chrome/footer.html" . }} diff --git a/docs/layouts/chrome/header.html b/docs/layouts/chrome/header.html index 544f08ab..324d922c 100644 --- a/docs/layouts/chrome/header.html +++ b/docs/layouts/chrome/header.html @@ -13,7 +13,10 @@

    Hugo

    -

    A Fast and Flexible Static Site Generator built with love by spf13 in Go

    +

    A Fast and Flexible Static Site Generator + built with love by spf13 and friends + in Go

    {{ template "chrome/menu.html" . }}
    diff --git a/docs/layouts/chrome/menu.html b/docs/layouts/chrome/menu.html index 5efd8183..40b3b669 100644 --- a/docs/layouts/chrome/menu.html +++ b/docs/layouts/chrome/menu.html @@ -2,29 +2,40 @@
  • Home
  • -
  • Installing Hugo
  • -
  • Usage
  • -
  • Configuration
  • -
  • Input Directory Layout
  • +
  • Installing Hugo
  • +
  • Usage
  • +
  • Configuration
  • +
  • Source Directory Layout
  • -
  • Templates
  • -
  • Variables
  • +
  • Overview
  • + +
  • Variables
  • +
  • Homepage
  • +
  • RSS
  • +
  • Index
  • +
  • Content
  • +
  • Content Views
  • +
  • Chrome
  • -
  • Organization
  • -
  • Front Matter
  • -
  • Example
  • +
  • Organization
  • +
  • Sections
  • +
  • Types
  • +
  • Front Matter
  • +
  • Example
  • -
  • ShortCodes
  • -
  • Indexes
  • -
  • Aliases
  • +
  • ShortCodes
  • +
  • Aliases
  • +
  • Indexes
  • +
  • Example Index - Category
  • +
  • -
  • Release Notes
  • -
  • Roadmap
  • -
  • Contributing
  • -
  • Contributors
  • -
  • License
  • +
  • Release Notes
  • +
  • Roadmap
  • +
  • Contributing
  • +
  • Contributors
  • +
  • License
  • diff --git a/docs/layouts/doc/single.html b/docs/layouts/doc/single.html deleted file mode 100644 index 5e42b2a0..00000000 --- a/docs/layouts/doc/single.html +++ /dev/null @@ -1,4 +0,0 @@ -{{ template "chrome/header.html" . }} -

    {{ .Title }}

    - {{ .Content }} -{{ template "chrome/footer.html" . }} diff --git a/docs/layouts/index.html b/docs/layouts/index.html index b6646e75..92e82fa3 100644 --- a/docs/layouts/index.html +++ b/docs/layouts/index.html @@ -51,4 +51,7 @@ focus on writing great content.

    + {{ range $key, $val := .Site.Recent }} + {{ $val.Title}} + {{ end }} {{ template "chrome/footer.html" }}