# Building from source
-### Clone locally (for contributors):
+## Clone locally (for contributors):
git clone https://github.com/spf13/hugo
cd hugo
* 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
+## Running Hugo
cd /path/to/hugo
go install github.com/spf13/hugo/hugolibs
go run main.go
-### Building Hugo
+## Building Hugo
cd /path/to/hugo
go build -o hugo main.go
aliases: ["/doc/contributors/", "/meta/contributors/"]
groups: ["community"]
groups_weight: 40
+notoc: true
---
Hugo was built with love and golang by:
linktitle: "Example"
groups: ['content']
groups_weight: 50
+notoc: true
---
Somethings are better shown than explained. The following is a very basic example of a content file:
date: "2013-07-01"
groups: ['content']
groups_weight: 20
+notoc: true
---
Hugo thinks that you organize your content with a purpose. The same structure
- "/doc/permalinks/"
groups: ["extras"]
groups_weight: 30
+notoc: true
---
By default, content is laid out into the target `publishdir` (public)
- "/doc/urls/"
groups: ["extras"]
groups_weight: 40
+notoc: true
---
By default, all relative URLs encountered in the input will be canonicalized
using `baseurl`, so that a link `/css/foo.css` becomes
This page demonstrates what would be required to add a new index called "categories" to your site.
-### config.yaml
+## 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
---
{{% /highlight %}}
-### /layouts/indexes/category.html
+## /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`/.
{{% /highlight %}}
-### Assigning indexes to content
+## Assigning indexes to content
Make sure that the index is set in the front matter:
number of content assigned to that key or alphabetically.
-### Example indexes.html file (alphabetical)
+## Example indexes.html file (alphabetical)
{{% highlight html %}}
{{ template "chrome/header.html" . }}
{{ template "chrome/footer.html" }}
{{% /highlight %}}
-### Example indexes.html file (ordered)
+## Example indexes.html file (ordered)
{{% highlight html %}}
{{ template "chrome/header.html" . }}
{{ template "chrome/footer.html" }}
{{% /highlight %}}
-### Variables available to list of indexes pages.
+## Variables available to list of indexes pages.
**.Title** The title for the content. <br>
**.Date** The date the content is published on.<br>
date: "2013-07-01"
groups: ["layout"]
groups_weight: 30
+notoc: true
---
Home pages are of the type "node" and have all the [node
date: "2013-07-01"
groups: ["layout"]
groups_weight: 40
+notoc: "one"
---
A single RSS template is used to generate all of the RSS content for the entire
aliases: ["/doc/roadmap/"]
groups: ["meta"]
groups_weight: 20
+notoc: true
---
In no particular order, here is what we are working on:
groups: ['gettingStarted']
linktitle: "Configuration"
groups_weight: 40
+notoc: true
---
The directory structure and templates provide the majority of the
aliases: ["/doc/source-directory/"]
groups: ['gettingStarted']
groups_weight: 50
+notoc: true
---
Hugo takes a single directory and uses it as the input for creating a complete website.
aliases: ["/doc/usage/"]
groups: ['gettingStarted']
groups_weight: 30
+notoc: true
---
Make sure either hugo is in your path or provide a path to it.
{{ template "chrome/header.html" . }}
+ {{ if .Params.notoc }}
+ {{ else }}
+ <div id="toc" class="well col-md-4 col-sm-6">
+ {{ .TableOfContents }}
+ </div>
+ {{ end }}
<h1>{{ .Title }}</h1>
{{ .Content }}
{{ template "chrome/footer.html" . }}
</div>
<script src="/static/js/jquery.js"></script>
<script src="/static/js/bootstrap.min.js"></script>
+
+ <script>
+ $(document).ready(function() {
+ $("nav#TableOfContents a").click(function() {
+ $("html, body").animate({
+ scrollTop: $($(this).attr("href")).offset().top-25 + "px"
+ }, {
+ duration: 450,
+ });
+ return false;
+ });
+ });
+ </script>
{{ template "chrome/analytics.html" . }}
+
</body>
</html>
background-color: #fdfdfb !important;\r
}\r
\r
+#toc {\r
+ float: right;\r
+ margin-left: 1em;\r
+ padding: 1em;\r
+}\r
+\r
+#TableOfContents > ul {\r
+ margin-left: -1em;\r
+ padding: 0;\r
+}\r
+\r
+#TableOfContents>ul>li {\r
+ list-style: none outside none;\r
+}\r
+\r
+#TableOfContents > ul > li > a {\r
+ padding-left: 1em;\r
+}\r
+\r
#main table{width:100%;margin-bottom:20px;}#main table thead>tr>th,#main table tbody>tr>th,#main table tfoot>tr>th,#main table thead>tr>td,#main table tbody>tr>td,#main table tfoot>tr>td{padding:8px;line-height:1.428571429;vertical-align:top;border-top:1px solid #dddddd;}\r
#main table thead>tr>th{vertical-align:bottom;border-bottom:2px solid #dddddd;}\r
#main table caption+thead tr:first-child th,#main table colgroup+thead tr:first-child th,#main table thead:first-child tr:first-child th,#main table caption+thead tr:first-child td,#main table colgroup+thead tr:first-child td,#main table thead:first-child tr:first-child td{border-top:0;}\r