MERGE: pulling from upstream master
|
@ -7,7 +7,7 @@ and [friends](http://github.com/spf13/hugo/graphs/contributors) in Go.
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
Hugo is a static site generator written in GoLang. It is optimized for
|
Hugo is a static site generator written in Go. It is optimized for
|
||||||
speed, easy use and configurability. Hugo takes a directory with content and
|
speed, easy use and configurability. Hugo takes a directory with content and
|
||||||
templates and renders them into a full html website.
|
templates and renders them into a full html website.
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ kind of website including blogs, tumbles and docs.
|
||||||
|
|
||||||
## Installing Hugo
|
## Installing Hugo
|
||||||
|
|
||||||
Hugo is written in GoLang with support for Windows, Linux, FreeBSD and OSX.
|
Hugo is written in Go with support for Windows, Linux, FreeBSD and OSX.
|
||||||
|
|
||||||
The latest release can be found at [hugo releases](https://github.com/spf13/hugo/releases).
|
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
|
We currently build for Windows, Linux, FreeBSD and OS X for x64
|
||||||
|
@ -43,7 +43,7 @@ where you don't have a privileged account.
|
||||||
Ideally you should install it somewhere in your path for easy use. `/usr/local/bin`
|
Ideally you should install it somewhere in your path for easy use. `/usr/local/bin`
|
||||||
is the most probable location.
|
is the most probable location.
|
||||||
|
|
||||||
*The Hugo executible has no external dependencies.*
|
*The Hugo executable has no external dependencies.*
|
||||||
|
|
||||||
### Installing from source
|
### Installing from source
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ groups_weight: 40
|
||||||
notoc: true
|
notoc: true
|
||||||
---
|
---
|
||||||
|
|
||||||
Hugo was built with love and golang by:
|
Hugo was built with love and Go by:
|
||||||
|
|
||||||
* Steve Francia - [spf13](https://github.com/spf13)
|
* Steve Francia - [spf13](https://github.com/spf13)
|
||||||
* Noah Campbell - [noahcampbell](https://github.com/noahcampbell)
|
* Noah Campbell - [noahcampbell](https://github.com/noahcampbell)
|
||||||
|
|
|
@ -14,22 +14,22 @@ Somethings are better shown than explained. The following is a very basic exampl
|
||||||
|
|
||||||
{{% highlight yaml %}}
|
{{% highlight yaml %}}
|
||||||
---
|
---
|
||||||
Title: "Nitro : A quick and simple profiler for golang"
|
Title: "Nitro : A quick and simple profiler for Go"
|
||||||
Description: "Nitro is a simple profiler for you go lang applications"
|
Description: "Nitro is a simple profiler for you go lang applications"
|
||||||
Tags: [ "Development", "golang", "profiling" ]
|
Tags: [ "Development", "Go", "profiling" ]
|
||||||
date: "2013-06-19"
|
date: "2013-06-19"
|
||||||
Topics: [ "Development", "GoLang" ]
|
Topics: [ "Development", "Go" ]
|
||||||
Slug: "nitro"
|
Slug: "nitro"
|
||||||
project_url: "http://github.com/spf13/nitro"
|
project_url: "http://github.com/spf13/nitro"
|
||||||
---
|
---
|
||||||
|
|
||||||
# Nitro
|
# Nitro
|
||||||
|
|
||||||
Quick and easy performance analyzer library for golang.
|
Quick and easy performance analyzer library for Go.
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
Nitro is a quick and easy performance analyzer library for golang.
|
Nitro is a quick and easy performance analyzer library for Go.
|
||||||
It is useful for comparing A/B against different drafts of functions
|
It is useful for comparing A/B against different drafts of functions
|
||||||
or different functions.
|
or different functions.
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ Make sure that the index is set in the front matter:
|
||||||
"title": "Hugo: A fast and flexible static site generator",
|
"title": "Hugo: A fast and flexible static site generator",
|
||||||
"categories": [
|
"categories": [
|
||||||
"Development",
|
"Development",
|
||||||
"golang",
|
"Go",
|
||||||
"Blogging"
|
"Blogging"
|
||||||
],
|
],
|
||||||
"slug": "hugo"
|
"slug": "hugo"
|
||||||
|
|
|
@ -18,8 +18,8 @@ It's important to understand what Indexes do. At it's most basic form an index
|
||||||
is simply a map of a key to a list of content values.
|
is simply a map of a key to a list of content values.
|
||||||
|
|
||||||
In the hugo internals this is stored as `Site.Indexes[Plural][key][]pages`.
|
In the hugo internals this is stored as `Site.Indexes[Plural][key][]pages`.
|
||||||
For example all the content tagged with GoLang would be found at
|
For example all the content tagged with Go would be found at
|
||||||
`Site.Indexes["tags"]["golang"]`.
|
`Site.Indexes["tags"]["Go"]`.
|
||||||
|
|
||||||
For a
|
For a
|
||||||
more complete example see the source of [this docs site](http://github.com/spf13/hugo/docs/).
|
more complete example see the source of [this docs site](http://github.com/spf13/hugo/docs/).
|
||||||
|
@ -65,7 +65,7 @@ and assign all keys you want this content to match against.
|
||||||
"title": "Hugo: A fast and flexible static site generator",
|
"title": "Hugo: A fast and flexible static site generator",
|
||||||
"tags": [
|
"tags": [
|
||||||
"Development",
|
"Development",
|
||||||
"golang",
|
"Go",
|
||||||
"fast",
|
"fast",
|
||||||
"Blogging"
|
"Blogging"
|
||||||
],
|
],
|
||||||
|
|
|
@ -6,7 +6,7 @@ groups: ["layout"]
|
||||||
groups_weight: 70
|
groups_weight: 70
|
||||||
---
|
---
|
||||||
|
|
||||||
Hugo uses the excellent golang html/template library for its template engine.
|
Hugo uses the excellent go html/template library for its template engine.
|
||||||
It is an extremely lightweight engine that provides a very small amount of
|
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
|
logic. In our experience that it is just the right amount of logic to be able
|
||||||
to create a good static website.
|
to create a good static website.
|
||||||
|
@ -14,7 +14,7 @@ to create a good static website.
|
||||||
Go templates are lightweight but extensible. Hugo has added the following
|
Go templates are lightweight but extensible. Hugo has added the following
|
||||||
functions to the basic template logic.
|
functions to the basic template logic.
|
||||||
|
|
||||||
Golang documentation for the built-in functions can be found [here](http://golang.org/pkg/text/template/)
|
Go documentation for the built-in functions can be found [here](http://golang.org/pkg/text/template/)
|
||||||
|
|
||||||
## General
|
## General
|
||||||
|
|
||||||
|
|
|
@ -5,14 +5,14 @@ groups: ["layout"]
|
||||||
groups_weight: 15
|
groups_weight: 15
|
||||||
---
|
---
|
||||||
|
|
||||||
Hugo uses the excellent [golang][] [html/template][gohtmltemplate] library for
|
Hugo uses the excellent [go][] [html/template][gohtmltemplate] library for
|
||||||
its template engine. It is an extremely lightweight engine that provides a very
|
its 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
|
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 have used other
|
logic to be able to create a good static website. If you have used other
|
||||||
template systems from different languages or frameworks you will find a lot of
|
template systems from different languages or frameworks you will find a lot of
|
||||||
similarities in go templates.
|
similarities in go templates.
|
||||||
|
|
||||||
This document is a brief primer on using go templates. The [golang docs][gohtmltemplate]
|
This document is a brief primer on using go templates. The [go docs][gohtmltemplate]
|
||||||
provide more details.
|
provide more details.
|
||||||
|
|
||||||
## Introduction to Go Templates
|
## Introduction to Go Templates
|
||||||
|
@ -23,7 +23,7 @@ One consequence of this simplicity is that go templates parse very quickly.
|
||||||
|
|
||||||
A unique characteristic of go templates is they are content aware. Variables and
|
A unique characteristic of go templates is they are content aware. Variables and
|
||||||
content will be sanitized depending on the context of where they are used. More
|
content will be sanitized depending on the context of where they are used. More
|
||||||
details can be found in the [golang docs][gohtmltemplate].
|
details can be found in the [go docs][gohtmltemplate].
|
||||||
|
|
||||||
## Basic Syntax
|
## Basic Syntax
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ Could be rewritten as
|
||||||
|
|
||||||
## Context (aka. the dot)
|
## Context (aka. the dot)
|
||||||
|
|
||||||
The most easily overlooked concept to understand about golang templates is that {{ . }}
|
The most easily overlooked concept to understand about go templates is that {{ . }}
|
||||||
always refers to the current context. In the top level of your template this
|
always refers to the current context. In the top level of your template this
|
||||||
will be the data set made available to it. Inside of a iteration it will have
|
will be the data set made available to it. Inside of a iteration it will have
|
||||||
the value of the current item. When inside of a loop the context has changed. .
|
the value of the current item. When inside of a loop the context has changed. .
|
||||||
|
@ -329,5 +329,5 @@ so, such as in this example:
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
[golang]: <http://golang.org/>
|
[go]: <http://golang.org/>
|
||||||
[gohtmltemplate]: <http://golang.org/pkg/html/template/>
|
[gohtmltemplate]: <http://golang.org/pkg/html/template/>
|
||||||
|
|
|
@ -7,7 +7,7 @@ groups: ["layout"]
|
||||||
groups_weight: 10
|
groups_weight: 10
|
||||||
---
|
---
|
||||||
|
|
||||||
Hugo uses the excellent golang html/template library for its template engine.
|
Hugo uses the excellent go html/template library for its template engine.
|
||||||
It is an extremely lightweight engine that provides a very small amount of
|
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
|
logic. In our experience that it is just the right amount of logic to be able
|
||||||
to create a good static website
|
to create a good static website
|
||||||
|
|
|
@ -6,7 +6,7 @@ groups: ['gettingStarted']
|
||||||
groups_weight: 20
|
groups_weight: 20
|
||||||
---
|
---
|
||||||
|
|
||||||
Hugo is written in GoLang with support for Windows, Linux, FreeBSD and OSX.
|
Hugo is written in Go with support for Windows, Linux, FreeBSD and OSX.
|
||||||
|
|
||||||
The latest release can be found at [hugo releases](https://github.com/spf13/hugo/releases).
|
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
|
We currently build for Windows, Linux, FreeBSD and OS X for x64
|
||||||
|
|
|
@ -6,17 +6,11 @@ groups_weight: 10
|
||||||
author: "Spencer Lyon"
|
author: "Spencer Lyon"
|
||||||
---
|
---
|
||||||
|
|
||||||
<script type="text/javascript"
|
|
||||||
|
|
||||||
src="https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
## What is MathJax?
|
## What is MathJax?
|
||||||
|
|
||||||
[MathJax](http://www.mathjax.org/) is a JavaScript library that allows allows the display of mathematical expressions described via a LaTeX-style syntax in the html (or markdown) source of a web page. As it is a pure a JavaScript library, getting it to work within Hugo is fairly straightforward, but does have some oddities that will be discussed here.
|
[MathJax](http://www.mathjax.org/) is a JavaScript library that allows allows the display of mathematical expressions described via a LaTeX-style syntax in the html (or markdown) source of a web page. As it is a pure a JavaScript library, getting it to work within Hugo is fairly straightforward, but does have some oddities that will be discussed here.
|
||||||
|
|
||||||
This is an introduction into actually using MathJax to render typeset mathematics on your website. Instead this page is a collection of tips and hints for one way to get MathJax working on a website built with Hugo.
|
This is not an introduction into actually using MathJax to render typeset mathematics on your website. Instead this page is a collection of tips and hints for one way to get MathJax working on a website built with Hugo.
|
||||||
|
|
||||||
## Enabling MathJax
|
## Enabling MathJax
|
||||||
|
|
||||||
|
@ -72,7 +66,7 @@ MathJax.Hub.Config({
|
||||||
</script>
|
</script>
|
||||||
{{% /highlight %}}
|
{{% /highlight %}}
|
||||||
|
|
||||||
As before, this content should be included in the html source of each page that you would like to use
|
As before, this content should be included in the html source of each page that will be using MathJax. The next code snippet contains the CSS that is used to have verbatim MathJax blocks render with the same font style as the body of the page.
|
||||||
|
|
||||||
|
|
||||||
{{% highlight css %}}
|
{{% highlight css %}}
|
||||||
|
@ -83,8 +77,7 @@ code.has-jax {font: inherit;
|
||||||
color: #515151;}
|
color: #515151;}
|
||||||
{{% /highlight %}}
|
{{% /highlight %}}
|
||||||
|
|
||||||
In the css snippet notice the line `color: #515151;`. This is the value assigned to the `color` attribute of the `body` class in my css. In order for the equations to look good on a particular website, this value should be updated to match the color of the text body for that page.
|
In the css snippet notice the line `color: #515151;`. `#515151` is the value assigned to the `color` attribute of the `body` class in my css. In order for the equations to fit in with the body of a web page, this value should be the same as e color of the body.
|
||||||
|
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
||||||
{{ template "chrome/includes.html" . }}
|
{{ template "chrome/includes.html" . }}
|
||||||
|
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
|
||||||
|
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
<!-- Add custom CSS here -->
|
<!-- Add custom CSS here -->
|
||||||
<link href="/static/css/HPstyles.css" rel="stylesheet">
|
<link href="/static/css/HPstyles.css" rel="stylesheet">
|
||||||
<link href="/static/css/hugofont.css" rel="stylesheet">
|
<link href="/static/css/hugofont.css" rel="stylesheet">
|
||||||
|
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
|
||||||
|
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
@ -152,7 +154,7 @@
|
||||||
<div class="item"> <blockquote><p>Finally someone builds me my own static site generator </p>— Hugo Rodger-Brown (@hugorodgerbrown) <a href="https://twitter.com/hugorodgerbrown/statuses/364417910153818112">August 5, 2013</a></blockquote> </div>
|
<div class="item"> <blockquote><p>Finally someone builds me my own static site generator </p>— Hugo Rodger-Brown (@hugorodgerbrown) <a href="https://twitter.com/hugorodgerbrown/statuses/364417910153818112">August 5, 2013</a></blockquote> </div>
|
||||||
<div class="item"> <blockquote><p>I'm loving the static site generator renaissance we are currently enjoying. Hugo is new, looks great, written in Go</p>— Jim Biancolo (@jimbiancolo) <a href="https://twitter.com/jimbiancolo/statuses/408678420348813314">December 5, 2013</a></blockquote> </div>
|
<div class="item"> <blockquote><p>I'm loving the static site generator renaissance we are currently enjoying. Hugo is new, looks great, written in Go</p>— Jim Biancolo (@jimbiancolo) <a href="https://twitter.com/jimbiancolo/statuses/408678420348813314">December 5, 2013</a></blockquote> </div>
|
||||||
<div class="item"> <blockquote><p>Good work on Hugo, I'm impressed with the speed!</p>— Ludovic Chabant (@ludovicchabant) <a href="https://twitter.com/ludovicchabant/statuses/408806199602053120">December 6, 2013</a></blockquote> </div>
|
<div class="item"> <blockquote><p>Good work on Hugo, I'm impressed with the speed!</p>— Ludovic Chabant (@ludovicchabant) <a href="https://twitter.com/ludovicchabant/statuses/408806199602053120">December 6, 2013</a></blockquote> </div>
|
||||||
<div class="item"> <blockquote><p>Checking out Hugo; Loving it so far. Like Jekyll but not so blog-oriented and written in golang</p>— Jose Gonzalvo (@jgonzalvo) <a href="https://twitter.com/jgonzalvo/statuses/408177855819173888">December 4, 2013</a></blockquote> </div>
|
<div class="item"> <blockquote><p>Checking out Hugo; Loving it so far. Like Jekyll but not so blog-oriented and written in go</p>— Jose Gonzalvo (@jgonzalvo) <a href="https://twitter.com/jgonzalvo/statuses/408177855819173888">December 4, 2013</a></blockquote> </div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
BIN
docs/static/static/share/hugo-tall.png
vendored
Normal file
After Width: | Height: | Size: 9.7 KiB |
BIN
docs/static/static/share/made-with-hugo-dark.png
vendored
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
docs/static/static/share/made-with-hugo-long-dark.png
vendored
Normal file
After Width: | Height: | Size: 8.9 KiB |
BIN
docs/static/static/share/made-with-hugo-long.png
vendored
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
docs/static/static/share/made-with-hugo.png
vendored
Normal file
After Width: | Height: | Size: 8.7 KiB |
BIN
docs/static/static/share/powered-by-hugo-dark.png
vendored
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
docs/static/static/share/powered-by-hugo-long-dark.png
vendored
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
docs/static/static/share/powered-by-hugo-long.png
vendored
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
docs/static/static/share/powered-by-hugo.png
vendored
Normal file
After Width: | Height: | Size: 3.4 KiB |
|
@ -28,7 +28,7 @@ type IndexList map[string]Index
|
||||||
* An index is a map of keywords to a list of pages.
|
* An index is a map of keywords to a list of pages.
|
||||||
* For example
|
* For example
|
||||||
* TagIndex['technology'] = WeightedPages
|
* TagIndex['technology'] = WeightedPages
|
||||||
* TagIndex['golang'] = WeightedPages2
|
* TagIndex['go'] = WeightedPages2
|
||||||
*/
|
*/
|
||||||
type Index map[string]WeightedPages
|
type Index map[string]WeightedPages
|
||||||
|
|
||||||
|
|