From b45d604b6d26dfebfc30a4669c0aefe21d04107e Mon Sep 17 00:00:00 2001 From: spf13 Date: Tue, 3 Jun 2014 14:40:51 -0400 Subject: [PATCH 01/26] setting version number --- commands/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/version.go b/commands/version.go index 784255a1938..baeae6a3669 100644 --- a/commands/version.go +++ b/commands/version.go @@ -24,6 +24,6 @@ var version = &cobra.Command{ Short: "Print the version number of Hugo", Long: `All software has versions. This is Hugo's`, Run: func(cmd *cobra.Command, args []string) { - fmt.Println("Hugo Static Site Generator v0.11") + fmt.Println("Hugo Static Site Generator v0.11.1") }, } From bed81e5fb40b33304d1349eb39fd3b76adeff099 Mon Sep 17 00:00:00 2001 From: Abe Pazos Date: Tue, 3 Jun 2014 17:18:55 +0300 Subject: [PATCH 02/26] Add empty line to correctly render a list --- docs/content/overview/quickstart.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/content/overview/quickstart.md b/docs/content/overview/quickstart.md index 7f09f3c7ebf..026f0db5dcf 100644 --- a/docs/content/overview/quickstart.md +++ b/docs/content/overview/quickstart.md @@ -98,6 +98,7 @@ your content Press ctrl+c to stop We specified two options here. + * --theme to pick which theme. * --buildDrafts because we want to display our content, both set to draft status From 467070601d2efe9d9c0d8962af02b302f0904b69 Mon Sep 17 00:00:00 2001 From: spf13 Date: Tue, 3 Jun 2014 17:06:32 -0400 Subject: [PATCH 03/26] fixed #303. Adding theme support to views --- hugolib/page.go | 12 +++++++- hugolib/page_test.go | 50 ++++++++++++++++++--------------- hugolib/path_seperators_test.go | 12 +++++--- 3 files changed, 46 insertions(+), 28 deletions(-) diff --git a/hugolib/page.go b/hugolib/page.go index 94c9b928a03..af17e35c8d8 100644 --- a/hugolib/page.go +++ b/hugolib/page.go @@ -190,11 +190,21 @@ func (page *Page) Layout(l ...string) []string { func layouts(types string, layout string) (layouts []string) { t := strings.Split(types, "/") + + // Add type/layout.html for i := range t { search := t[:len(t)-i] layouts = append(layouts, fmt.Sprintf("%s/%s.html", strings.ToLower(path.Join(search...)), layout)) } - layouts = append(layouts, fmt.Sprintf("%s.html", layout)) + + // Add _default/layout.html + layouts = append(layouts, fmt.Sprintf("_default/%s.html", layout)) + + // Add theme/type/layout.html & theme/_default/layout.html + for _, l := range layouts { + layouts = append(layouts, "theme/"+l) + } + return } diff --git a/hugolib/page_test.go b/hugolib/page_test.go index 0ade5c950bb..81a168638ed 100644 --- a/hugolib/page_test.go +++ b/hugolib/page_test.go @@ -307,7 +307,7 @@ func TestCreateNewPage(t *testing.T) { checkPageContent(t, p, "

Simple Page

\n") checkPageSummary(t, p, "Simple Page") checkPageType(t, p, "page") - checkPageLayout(t, p, "page/single.html", "single.html") + checkPageLayout(t, p, "page/single.html", "_default/single.html", "theme/page/single.html", "theme/_default/single.html") checkTruncation(t, p, false, "simple short page") } @@ -322,7 +322,7 @@ func TestPageWithDelimiter(t *testing.T) { checkPageContent(t, p, "

Summary Next Line

\n\n

Some more text

\n") checkPageSummary(t, p, "

Summary Next Line

\n") checkPageType(t, p, "page") - checkPageLayout(t, p, "page/single.html", "single.html") + checkPageLayout(t, p, "page/single.html", "_default/single.html", "theme/page/single.html", "theme/_default/single.html") checkTruncation(t, p, true, "page with summary delimiter") } @@ -337,7 +337,7 @@ func TestPageWithShortCodeInSummary(t *testing.T) { checkPageContent(t, p, "

Summary Next Line. {{% img src=“/not/real” %}}.\nMore text here.

\n\n

Some more text

\n") checkPageSummary(t, p, "Summary Next Line. . More text here. Some more text") checkPageType(t, p, "page") - checkPageLayout(t, p, "page/single.html", "single.html") + checkPageLayout(t, p, "page/single.html", "_default/single.html", "theme/page/single.html", "theme/_default/single.html") } func TestTableOfContents(t *testing.T) { @@ -362,7 +362,7 @@ func TestPageWithMoreTag(t *testing.T) { checkPageContent(t, p, "

Summary Same Line

\n\n

Some more text

\n") checkPageSummary(t, p, "

Summary Same Line

\n") checkPageType(t, p, "page") - checkPageLayout(t, p, "page/single.html", "single.html") + checkPageLayout(t, p, "page/single.html", "_default/single.html", "theme/page/single.html", "theme/_default/single.html") } func TestPageWithDate(t *testing.T) { @@ -513,25 +513,25 @@ func TestLayoutOverride(t *testing.T) { path string expectedLayout []string }{ - {SIMPLE_PAGE_NOLAYOUT, path_content_two_dir, L("dub/sub/single.html", "dub/single.html", "single.html")}, - {SIMPLE_PAGE_NOLAYOUT, path_content_one_dir, L("gub/single.html", "single.html")}, - {SIMPLE_PAGE_NOLAYOUT, path_content_no_dir, L("page/single.html", "single.html")}, - {SIMPLE_PAGE_NOLAYOUT, path_one_directory, L("fub/single.html", "single.html")}, - {SIMPLE_PAGE_NOLAYOUT, path_no_directory, L("page/single.html", "single.html")}, - {SIMPLE_PAGE_LAYOUT_FOOBAR, path_content_two_dir, L("dub/sub/foobar.html", "dub/foobar.html", "foobar.html")}, - {SIMPLE_PAGE_LAYOUT_FOOBAR, path_content_one_dir, L("gub/foobar.html", "foobar.html")}, - {SIMPLE_PAGE_LAYOUT_FOOBAR, path_one_directory, L("fub/foobar.html", "foobar.html")}, - {SIMPLE_PAGE_LAYOUT_FOOBAR, path_no_directory, L("page/foobar.html", "foobar.html")}, - {SIMPLE_PAGE_TYPE_FOOBAR, path_content_two_dir, L("foobar/single.html", "single.html")}, - {SIMPLE_PAGE_TYPE_FOOBAR, path_content_one_dir, L("foobar/single.html", "single.html")}, - {SIMPLE_PAGE_TYPE_FOOBAR, path_content_no_dir, L("foobar/single.html", "single.html")}, - {SIMPLE_PAGE_TYPE_FOOBAR, path_one_directory, L("foobar/single.html", "single.html")}, - {SIMPLE_PAGE_TYPE_FOOBAR, path_no_directory, L("foobar/single.html", "single.html")}, - {SIMPLE_PAGE_TYPE_LAYOUT, path_content_two_dir, L("barfoo/buzfoo.html", "buzfoo.html")}, - {SIMPLE_PAGE_TYPE_LAYOUT, path_content_one_dir, L("barfoo/buzfoo.html", "buzfoo.html")}, - {SIMPLE_PAGE_TYPE_LAYOUT, path_content_no_dir, L("barfoo/buzfoo.html", "buzfoo.html")}, - {SIMPLE_PAGE_TYPE_LAYOUT, path_one_directory, L("barfoo/buzfoo.html", "buzfoo.html")}, - {SIMPLE_PAGE_TYPE_LAYOUT, path_no_directory, L("barfoo/buzfoo.html", "buzfoo.html")}, + {SIMPLE_PAGE_NOLAYOUT, path_content_two_dir, L("dub/sub/single.html", "dub/single.html", "_default/single.html")}, + {SIMPLE_PAGE_NOLAYOUT, path_content_one_dir, L("gub/single.html", "_default/single.html")}, + {SIMPLE_PAGE_NOLAYOUT, path_content_no_dir, L("page/single.html", "_default/single.html")}, + {SIMPLE_PAGE_NOLAYOUT, path_one_directory, L("fub/single.html", "_default/single.html")}, + {SIMPLE_PAGE_NOLAYOUT, path_no_directory, L("page/single.html", "_default/single.html")}, + {SIMPLE_PAGE_LAYOUT_FOOBAR, path_content_two_dir, L("dub/sub/foobar.html", "dub/foobar.html", "_default/foobar.html")}, + {SIMPLE_PAGE_LAYOUT_FOOBAR, path_content_one_dir, L("gub/foobar.html", "_default/foobar.html")}, + {SIMPLE_PAGE_LAYOUT_FOOBAR, path_one_directory, L("fub/foobar.html", "_default/foobar.html")}, + {SIMPLE_PAGE_LAYOUT_FOOBAR, path_no_directory, L("page/foobar.html", "_default/foobar.html")}, + {SIMPLE_PAGE_TYPE_FOOBAR, path_content_two_dir, L("foobar/single.html", "_default/single.html")}, + {SIMPLE_PAGE_TYPE_FOOBAR, path_content_one_dir, L("foobar/single.html", "_default/single.html")}, + {SIMPLE_PAGE_TYPE_FOOBAR, path_content_no_dir, L("foobar/single.html", "_default/single.html")}, + {SIMPLE_PAGE_TYPE_FOOBAR, path_one_directory, L("foobar/single.html", "_default/single.html")}, + {SIMPLE_PAGE_TYPE_FOOBAR, path_no_directory, L("foobar/single.html", "_default/single.html")}, + {SIMPLE_PAGE_TYPE_LAYOUT, path_content_two_dir, L("barfoo/buzfoo.html", "_default/buzfoo.html")}, + {SIMPLE_PAGE_TYPE_LAYOUT, path_content_one_dir, L("barfoo/buzfoo.html", "_default/buzfoo.html")}, + {SIMPLE_PAGE_TYPE_LAYOUT, path_content_no_dir, L("barfoo/buzfoo.html", "_default/buzfoo.html")}, + {SIMPLE_PAGE_TYPE_LAYOUT, path_one_directory, L("barfoo/buzfoo.html", "_default/buzfoo.html")}, + {SIMPLE_PAGE_TYPE_LAYOUT, path_no_directory, L("barfoo/buzfoo.html", "_default/buzfoo.html")}, } for _, test := range tests { p, _ := NewPage(test.path) @@ -539,6 +539,10 @@ func TestLayoutOverride(t *testing.T) { if err != nil { t.Fatalf("Unable to parse content:\n%s\n", test.content) } + + for _, y := range test.expectedLayout { + test.expectedLayout = append(test.expectedLayout, "theme/"+y) + } if !listEqual(p.Layout(), test.expectedLayout) { t.Errorf("Layout mismatch. Expected: %s, got: %s", test.expectedLayout, p.Layout()) } diff --git a/hugolib/path_seperators_test.go b/hugolib/path_seperators_test.go index 816769d9758..187c155b5e4 100644 --- a/hugolib/path_seperators_test.go +++ b/hugolib/path_seperators_test.go @@ -28,10 +28,10 @@ func TestNewPageWithFilePath(t *testing.T) { section string layout []string }{ - {path.Join("sub", "foobar.html"), "sub", L("sub/single.html", "single.html")}, - {path.Join("content", "foobar.html"), "", L("page/single.html", "single.html")}, - {path.Join("content", "sub", "foobar.html"), "sub", L("sub/single.html", "single.html")}, - {path.Join("content", "dub", "sub", "foobar.html"), "dub/sub", L("dub/sub/single.html", "dub/single.html", "single.html")}, + {path.Join("sub", "foobar.html"), "sub", L("sub/single.html", "_default/single.html")}, + {path.Join("content", "foobar.html"), "", L("page/single.html", "_default/single.html")}, + {path.Join("content", "sub", "foobar.html"), "sub", L("sub/single.html", "_default/single.html")}, + {path.Join("content", "dub", "sub", "foobar.html"), "dub/sub", L("dub/sub/single.html", "dub/single.html", "_default/single.html")}, } for _, el := range toCheck { @@ -44,6 +44,10 @@ func TestNewPageWithFilePath(t *testing.T) { t.Errorf("Section not set to %s for page %s. Got: %s", el.section, el.input, p.Section) } + for _, y := range el.layout { + el.layout = append(el.layout, "theme/"+y) + } + if !listEqual(p.Layout(), el.layout) { t.Errorf("Layout incorrect. Expected: '%s', Got: '%s'", el.layout, p.Layout()) } From 9e9dcdf588b236af4ea3d57117cc053bfba95f88 Mon Sep 17 00:00:00 2001 From: spf13 Date: Wed, 4 Jun 2014 12:33:16 -0400 Subject: [PATCH 04/26] Adding proper error message when view is not found.. fixing #303 --- hugolib/page.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hugolib/page.go b/hugolib/page.go index af17e35c8d8..0cbb7802c5e 100644 --- a/hugolib/page.go +++ b/hugolib/page.go @@ -514,12 +514,18 @@ func (p *Page) Render(layout ...string) template.HTML { func (p *Page) ExecuteTemplate(layout string) *bytes.Buffer { l := p.Layout(layout) buffer := new(bytes.Buffer) + worked := false for _, layout := range l { if p.Tmpl.Lookup(layout) != nil { p.Tmpl.ExecuteTemplate(buffer, layout, p) + worked = true break } } + if !worked { + jww.ERROR.Println("Unable to render", layout, ".") + jww.ERROR.Println("Expecting to find a template in either the theme/layouts or /layouts in one of the following relative locations", l) + } return buffer } From cc63e2df4c8abbe0f569fca1fc9ee1a21690f23a Mon Sep 17 00:00:00 2001 From: spf13 Date: Wed, 18 Jun 2014 12:38:40 -0400 Subject: [PATCH 05/26] fixing typo in docs --- docs/content/templates/go-templates.md | 1 + docs/content/themes/overview.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/content/templates/go-templates.md b/docs/content/templates/go-templates.md index 03783e16e5e..c9f6178ccbe 100644 --- a/docs/content/templates/go-templates.md +++ b/docs/content/templates/go-templates.md @@ -1,6 +1,7 @@ --- aliases: - /layout/go-templates/ +- /layouts/go-templates/ date: 2013-07-01 menu: main: diff --git a/docs/content/themes/overview.md b/docs/content/themes/overview.md index 393213e0fba..10ec16c5df1 100644 --- a/docs/content/themes/overview.md +++ b/docs/content/themes/overview.md @@ -18,7 +18,7 @@ site. Hugo themes have been designed to be the perfect balance between simplicity and functionality. Hugo themes are powered by the excellent go template library. If you are new to go templates, see our [primer on -go templates](/layouts/go-templates). +go templates](/templates/go-templates). Hugo themes support all modern features you come to expect. They are structured in such a way to eliminate code duplication. Themes are also From 42f748d0e0c249a0fcb2404269d06079992adf00 Mon Sep 17 00:00:00 2001 From: jesper-mortensen Date: Thu, 5 Jun 2014 19:15:40 +0200 Subject: [PATCH 06/26] Fix #263, document HTML comments & IE conditionals --- docs/content/templates/go-templates.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/content/templates/go-templates.md b/docs/content/templates/go-templates.md index c9f6178ccbe..cdc351fe90e 100644 --- a/docs/content/templates/go-templates.md +++ b/docs/content/templates/go-templates.md @@ -221,6 +221,13 @@ Could be rewritten as Stuff Here {{ end }} +### Internet Explorer conditional comments using Pipes + +By default Go Templates remove HTML comments from output. This has the unfortunate side effect of removing Internet Explorer conditional comments. As a workaround, use something like this: + + {{ "" | safeHtml }} ## Context (aka. the dot) From 06cb312a6efa4e0dac3db4571833f4299c71da1e Mon Sep 17 00:00:00 2001 From: Michael Whatcott Date: Thu, 5 Jun 2014 23:32:06 -0600 Subject: [PATCH 07/26] Included instructions for omitting disqus comments on localhost. --- docs/content/extras/comments.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/docs/content/extras/comments.md b/docs/content/extras/comments.md index a0f881c5140..2b8cce7c4ba 100644 --- a/docs/content/extras/comments.md +++ b/docs/content/extras/comments.md @@ -44,6 +44,38 @@ for a given piece of content * **disqus_title** * **disqus_url** + +## Conditional Loading of Disqus Comments + +Users have noticed that enabling disqus comments when running the hugo web server on localhost causes the creation of unwanted discussions on the associated disqus account. In order to prevent this, a slightly tweaked partial template is required. So, rather than using the built-in `"_internal/disqus.html"` template referenced above, create a template in your `partials` folder that looks like this: + +```javascript +
+ + +comments powered by Disqus +``` + +Notice that there is a simple if statement that detects when you are running on localhost and skips the initialization of the disqus comment injection. + +Now reference the partial template from your page template: + + {{ template "partials/disqus.html" . }} + + # Alternatives A few alternatives exist to Disqus. From 97c050d687d14735b4fe89a3b53143c89819e194 Mon Sep 17 00:00:00 2001 From: Gour Date: Mon, 9 Jun 2014 07:52:32 +0200 Subject: [PATCH 08/26] do not use angle brackets in hyperlink labels --- docs/content/templates/go-templates.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/templates/go-templates.md b/docs/content/templates/go-templates.md index cdc351fe90e..8ba16b26eae 100644 --- a/docs/content/templates/go-templates.md +++ b/docs/content/templates/go-templates.md @@ -343,5 +343,5 @@ so, such as in this example: ``` -[go]: -[gohtmltemplate]: +[go]: http://golang.org/ +[gohtmltemplate]: http://golang.org/pkg/html/template/ From 48d64b10214e0bf9bd22c1b57c1a3d5b9312bd16 Mon Sep 17 00:00:00 2001 From: Rolando Pereira Date: Fri, 20 Jun 2014 23:10:15 +0100 Subject: [PATCH 09/26] Fix minor typo in file docs/content/templates/overview.md --- docs/content/templates/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/templates/overview.md b/docs/content/templates/overview.md index d04db7a9d8d..a90797ac58d 100644 --- a/docs/content/templates/overview.md +++ b/docs/content/templates/overview.md @@ -57,7 +57,7 @@ Different ways of rendering a (single) content type ### [Taxonomy Terms](/templates/terms) A list of the terms used for a specific taxonomy eg. a Tag cloud -## Other Templates (generally unncessary) +## Other Templates (generally unnecessary) ### [RSS](/templates/rss/) Used to render all rss documents From 8c0afeaadecd865fcedf1901f8558369bc3390d3 Mon Sep 17 00:00:00 2001 From: Maarten Everts Date: Sat, 21 Jun 2014 17:51:14 +0200 Subject: [PATCH 10/26] taxonomies -> Taxonomies --- docs/content/taxonomies/usage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/taxonomies/usage.md b/docs/content/taxonomies/usage.md index 1b16e558082..4db37364df9 100644 --- a/docs/content/taxonomies/usage.md +++ b/docs/content/taxonomies/usage.md @@ -22,7 +22,7 @@ Notice the format is **singular key** : *plural value*. ### config.yaml --- - taxonomies: + Taxonomies: tag: "tags" category: "categories" series: "series" From 74d8d7605411bffe55ec177961f7e448d1c74c18 Mon Sep 17 00:00:00 2001 From: Gina White Date: Sun, 22 Jun 2014 08:47:45 -0700 Subject: [PATCH 11/26] fix link to template primer --- docs/content/themes/creation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/themes/creation.md b/docs/content/themes/creation.md index 515fed987e9..0df140265c9 100644 --- a/docs/content/themes/creation.md +++ b/docs/content/themes/creation.md @@ -16,7 +16,7 @@ using the `hugo new` command. This command will initialize all of the files and directories a basic theme would need. Hugo themes are written in the go template language. If you are new -to Go, the [go template primer](/templates/primer/) will help you get started. +to Go, the [go template primer](/layout/go-templates/) will help you get started. ## Theme Components From 31cb2241ecdd38d87ca3a31e02d115bb11017b97 Mon Sep 17 00:00:00 2001 From: spf13 Date: Mon, 30 Jun 2014 23:39:21 -0400 Subject: [PATCH 12/26] Getting rid of bad scrollbar --- docs/layouts/partials/footer.html | 2 -- docs/static/js/scripts.js | 8 -------- 2 files changed, 10 deletions(-) diff --git a/docs/layouts/partials/footer.html b/docs/layouts/partials/footer.html index 1dfd82003a5..961638d8cf7 100644 --- a/docs/layouts/partials/footer.html +++ b/docs/layouts/partials/footer.html @@ -19,8 +19,6 @@ - - diff --git a/docs/static/js/scripts.js b/docs/static/js/scripts.js index 65c537bb806..5ecfa332470 100755 --- a/docs/static/js/scripts.js +++ b/docs/static/js/scripts.js @@ -6,14 +6,6 @@ function initializeJS() { //popovers jQuery('.popovers').popover(); - //custom scrollbar - //for html - jQuery("html").niceScroll({styler:"fb",cursorcolor:"#007AFF", cursorwidth: '6', cursorborderradius: '10px', background: '#F7F7F7', cursorborder: '', zindex: '1000'}); - //for sidebar - jQuery("#sidebar").niceScroll({styler:"fb",cursorcolor:"#007AFF", cursorwidth: '3', cursorborderradius: '10px', background: '#F7F7F7', cursorborder: ''}); - // for scroll panel - jQuery(".scroll-panel").niceScroll({styler:"fb",cursorcolor:"#007AFF", cursorwidth: '3', cursorborderradius: '10px', background: '#F7F7F7', cursorborder: ''}); - //sidebar dropdown menu jQuery('#sidebar .sub-menu > a').click(function () { var last = jQuery('.sub-menu.open', jQuery('#sidebar')); From 9fb3b2bd4b03501ab671eaeca8db15326370460f Mon Sep 17 00:00:00 2001 From: spf13 Date: Tue, 1 Jul 2014 10:59:58 -0400 Subject: [PATCH 13/26] Fixed #328. Config file set appropriately. --- commands/hugo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/hugo.go b/commands/hugo.go index d3e3bea1e81..c15da0d6526 100644 --- a/commands/hugo.go +++ b/commands/hugo.go @@ -89,7 +89,7 @@ func init() { } func InitializeConfig() { - viper.SetConfigName(CfgFile) + viper.SetConfigFile(CfgFile) viper.AddConfigPath(Source) err := viper.ReadInConfig() if err != nil { From 25c7ffcaeeb78386fd7f29794cdb6a48bf09a3dd Mon Sep 17 00:00:00 2001 From: Nate Finch Date: Sun, 3 Aug 2014 06:53:48 -0400 Subject: [PATCH 14/26] make type-or-section more obvious It took me a long time to realize that /layouts/TYPE or SECTION/LAYOUT.html was supposed to be a single URL and not two urls (/layouts/TYPE) or (SECTION/LAYOUT.html) ... putting in the hyphens I think makes it much more clear it's all one URL, and only the middle part is an either-or. --- docs/content/templates/content.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/content/templates/content.md b/docs/content/templates/content.md index 3764103f5ba..a472eeed298 100644 --- a/docs/content/templates/content.md +++ b/docs/content/templates/content.md @@ -32,11 +32,11 @@ it will be used instead of `section`. ### Single -* /layouts/`TYPE` or `SECTION`/`LAYOUT`.html -* /layouts/`TYPE` or `SECTION`/single.html +* /layouts/`TYPE`-or-`SECTION`/`LAYOUT`.html +* /layouts/`TYPE`-or-`SECTION`/single.html * /layouts/\_default/single.html -* /themes/`THEME`/layouts/`TYPE` or `SECTION`/`LAYOUT`.html -* /themes/`THEME`/layouts/`TYPE` or `SECTION`/single.html +* /themes/`THEME`/layouts/`TYPE`-or-`SECTION`/`LAYOUT`.html +* /themes/`THEME`/layouts/`TYPE`-or-`SECTION`/single.html * /themes/`THEME`/layouts/\_default/single.html ## Example Single Template File From 8acf54b0ac13d092d374e8723ef3aa890268b4fa Mon Sep 17 00:00:00 2001 From: Nate Finch Date: Sat, 2 Aug 2014 07:16:24 -0400 Subject: [PATCH 15/26] update docs for permalinks with all fields List all the fields and what they mean, based on hugolib/permalinks.go --- docs/content/extras/permalinks.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/content/extras/permalinks.md b/docs/content/extras/permalinks.md index 54b4c6104a9..4018b37ed98 100644 --- a/docs/content/extras/permalinks.md +++ b/docs/content/extras/permalinks.md @@ -36,3 +36,18 @@ A file named `content/post/sample-entry` which contains a line appearing at `public/2013/11/sample-entry/index.html` and be reachable via the URL . +The following is a list of values that can be used in a permalink definition, +all references to time are dependent on the content's date. + +**:year** the 4 digit year
+**:month** the 2 digit month
+**:monthname** the name of the month
+**:day** the 2 digit day
+**:weekday** the 1 digit day of the week (Sunday = 0)
+**:weekdayname** the name of the day of the week
+**:yearday** the 1-3 digit day of the year
+**:section** the content's section
+**:title** the content's title
+**:slug** the content's slug (or title if no slug)
+**:filename** the content's filename (without extension)
+ From bb88865d7393dbb4d2c92b828da9bd4af0d8db0b Mon Sep 17 00:00:00 2001 From: Kevin Burke Date: Sat, 26 Jul 2014 23:43:21 -0700 Subject: [PATCH 16/26] it's/its --- commands/server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/server.go b/commands/server.go index 89e4c5ba703..0709d263ff8 100644 --- a/commands/server.go +++ b/commands/server.go @@ -36,8 +36,8 @@ var disableLiveReload bool var serverCmd = &cobra.Command{ Use: "server", - Short: "Hugo runs it's own a webserver to render the files", - Long: `Hugo is able to run it's own high performance web server. + Short: "Hugo runs its own webserver to render the files", + Long: `Hugo is able to run its own high performance web server. Hugo will render all the files defined in the source directory and Serve them up.`, //Run: server, From 1dab4108240d9a2198bed076ee82989aba53cafc Mon Sep 17 00:00:00 2001 From: GraemeCaldwell Date: Tue, 5 Aug 2014 17:19:56 +0100 Subject: [PATCH 17/26] Update press.md --- docs/content/community/press.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/content/community/press.md b/docs/content/community/press.md index 00ee0c09d72..5e112911dfb 100644 --- a/docs/content/community/press.md +++ b/docs/content/community/press.md @@ -16,6 +16,7 @@ Hugo has been featured in the following Blog Posts, Press and Media. | Title | Author | Date | | ------ | ------ | -----: | +| [An Introduction To Hugo, A Go-Based Static Site Generator](http://www.cirrushosting.com/web-hosting-blog/an-introduction-to-hugo/) | Dan Silber | July 1 2014 | | [Hugo - A Static Site Builder in Go](http://deepfriedcode.com/post/hugo/) | Deep Fried Code | 30 Mar 2014 | | [Hugo](http://bra.am/post/hugo/) | bra.am | 23 Mar 2014 | | [Converting Blogger To Markdown](http://trishagee.github.io/project/atom-to-hugo/) | Trisha Gee | 20 Mar 2014 | From 3a3e79bcf6f64cd4f39e6107c55be10bb96448a5 Mon Sep 17 00:00:00 2001 From: Roberto Dip Date: Sat, 9 Aug 2014 20:40:18 -0300 Subject: [PATCH 18/26] Fix #363 - Docs: make the fixed menu on the left scrollable --- docs/static/css/style.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/static/css/style.css b/docs/static/css/style.css index f32af063b8a..792d53cf357 100755 --- a/docs/static/css/style.css +++ b/docs/static/css/style.css @@ -354,10 +354,11 @@ table tr th { color: #007AFF;} /*sidebar navigation*/ #sidebar { - width: 180px; + width: 190px; height: 100%; position: fixed; background: #ffffff; + overflow-y: auto; } .nav-collapse.collapse { From 58577e22535f3b6b4b541b5514e1cdb3d23f3e41 Mon Sep 17 00:00:00 2001 From: David Kebler Date: Sat, 9 Aug 2014 10:03:06 -0700 Subject: [PATCH 19/26] Docs-removed bullet and broken link for catagetories. Included category text in bullet for taxonomies --- docs/content/overview/introduction.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/content/overview/introduction.md b/docs/content/overview/introduction.md index bd5ecdd4082..59fe6cab24f 100644 --- a/docs/content/overview/introduction.md +++ b/docs/content/overview/introduction.md @@ -51,8 +51,7 @@ Hugo boasts the following features: * Straightforward [organization](/content/organization) * Support for [website sections](/content/sections) * Completely customizable [urls](/extras/urls) - * Support for [categories](/indexes/category) and tags - * Support for configurable [taxonomies](/indexes/overview) to create your own organization + * Support for configurable [taxonomies](/indexes/overview) which includes categories and tags. Create your own custom organization of content * Ability to [sort content](/content/ordering) as you desire * Automatic [table of contents](/extras/toc) generation * Dynamic menu creation From 3416d8f3a1568b47f22f6c84ab901df7e2a8d640 Mon Sep 17 00:00:00 2001 From: spf13 Date: Sun, 10 Aug 2014 00:17:36 -0400 Subject: [PATCH 20/26] Adding more press --- docs/content/community/press.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/content/community/press.md b/docs/content/community/press.md index 5e112911dfb..90d33e104f2 100644 --- a/docs/content/community/press.md +++ b/docs/content/community/press.md @@ -16,7 +16,10 @@ Hugo has been featured in the following Blog Posts, Press and Media. | Title | Author | Date | | ------ | ------ | -----: | +| [Hugo: Beyond the Defaults](http://npf.io/2014/08/hugo-beyond-the-defaults/) | Nate Finch | Aug 8 2014 | +| [Hugo Is Friggin' Awesome](http://npf.io/2014/08/hugo-is-awesome/) | Nate Finch | Aug 1 2014 | | [An Introduction To Hugo, A Go-Based Static Site Generator](http://www.cirrushosting.com/web-hosting-blog/an-introduction-to-hugo/) | Dan Silber | July 1 2014 | +| [Mission Not Accomplished](http://johnsto.co.uk/blog/mission-not-accomplished/) | Dave Johnston | 3 Apr 2014 | | [Hugo - A Static Site Builder in Go](http://deepfriedcode.com/post/hugo/) | Deep Fried Code | 30 Mar 2014 | | [Hugo](http://bra.am/post/hugo/) | bra.am | 23 Mar 2014 | | [Converting Blogger To Markdown](http://trishagee.github.io/project/atom-to-hugo/) | Trisha Gee | 20 Mar 2014 | From fcf58044339194797e4815d04a5f6eb34633ae1e Mon Sep 17 00:00:00 2001 From: Franklin Wise Date: Sun, 10 Aug 2014 09:09:12 -0700 Subject: [PATCH 21/26] hugo builds no site if there are only drafts if you run: hugo and all of your posts are drafts, no site gets build. --- docs/content/tutorials/github_pages_blog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/tutorials/github_pages_blog.md b/docs/content/tutorials/github_pages_blog.md index f01d3c2147f..59042d3f509 100644 --- a/docs/content/tutorials/github_pages_blog.md +++ b/docs/content/tutorials/github_pages_blog.md @@ -162,7 +162,7 @@ The first two items in the previous list are simply a way to conveniently previe echo -e "\033[0;32mDeploying updates to Github...\033[0m" - # Build the project. + # Build the project. (If you only have drafts, no site will be generated) hugo # Add changes to git. From 0937ef3c4c839ebfeb6b5e09c2d51220798c2f1a Mon Sep 17 00:00:00 2001 From: Roberto Dip Date: Thu, 14 Aug 2014 23:22:57 -0300 Subject: [PATCH 22/26] Fix #394 - Docs: add a missing link to the livereload page in the intro --- docs/content/overview/introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/overview/introduction.md b/docs/content/overview/introduction.md index 59fe6cab24f..519826a791e 100644 --- a/docs/content/overview/introduction.md +++ b/docs/content/overview/introduction.md @@ -42,7 +42,7 @@ Hugo boasts the following features: * Extremely fast built times (~1ms per page) * Completely cross platform: Runs on Mac OSX, Linux and Windows * Easy [installation](/overview/installing) - * Render changes [on the fly](/overview/usage) with [live reload](#) as you develop + * Render changes [on the fly](/overview/usage) with [live reload](/extras/livereload) as you develop * Complete theme support * Host your site anywhere From 2f171f33c5023ce6b6ce2a5c9ca5c8c4b6a021a2 Mon Sep 17 00:00:00 2001 From: Rahul Bansal Date: Sat, 16 Aug 2014 00:09:12 +0530 Subject: [PATCH 23/26] Config changes and Live Reload I noticed that config file changes do not work with Live Reload feature. This may be "fixed" in future but for now adding a note might avoid confusion. --- docs/content/overview/configuration.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/content/overview/configuration.md b/docs/content/overview/configuration.md index 4942a02b783..4a499ca6310 100644 --- a/docs/content/overview/configuration.md +++ b/docs/content/overview/configuration.md @@ -61,3 +61,8 @@ Here is a yaml configuration file which sets a few more options SidebarRecentLimit: 5 ... +## Notes + +Config changes do not reflect with [Live Reload](http://hugo.spf13.com/extras/livereload) + +Please restart `hugo server --watch` whenever you make a config change. From b8c708ff1d468cae56d9a6152b6be2c22c808952 Mon Sep 17 00:00:00 2001 From: Rahul Bansal Date: Sat, 16 Aug 2014 00:32:24 +0530 Subject: [PATCH 24/26] Added yaml menu example Added yaml menu example, matching with existing toml example. Also added link to sitewide config page. --- docs/content/extras/menus.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/content/extras/menus.md b/docs/content/extras/menus.md index 24b24b775fe..59480168e45 100644 --- a/docs/content/extras/menus.md +++ b/docs/content/extras/menus.md @@ -87,7 +87,7 @@ available. ## Adding (non-content) entries to a menu You can also add entries to menus that aren’t attached to a piece of -content. This takes place in the site wide config file. +content. This takes place in the site wide [config file](http://hugo.spf13.com/overview/configuration). Here’s an example (in toml): @@ -101,6 +101,20 @@ Here’s an example (in toml): pre = "" weight = -100 +Here’s an example (in yaml): + + --- + menu: + main: + - Name: "about hugo" + Pre: "" + Weight: -110 + Identifier: "about" + - Name: "getting started" + Pre: "" + Weight: -100 + --- + ## Nesting All nesting of content is done via the `parent` field. From 7559abbf824e4e30d216ec416720b620821b14be Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Mon, 18 Aug 2014 11:36:24 +1000 Subject: [PATCH 25/26] switch to new location of goyaml --- parser/frontmatter.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/parser/frontmatter.go b/parser/frontmatter.go index d3c3f034762..68e4456d2a5 100644 --- a/parser/frontmatter.go +++ b/parser/frontmatter.go @@ -20,7 +20,7 @@ import ( "strings" "github.com/BurntSushi/toml" - "launchpad.net/goyaml" + "gopkg.in/yaml.v1" ) type FrontmatterType struct { @@ -38,7 +38,7 @@ func InterfaceToConfig(in interface{}, mark rune) ([]byte, error) { switch mark { case rune(YAML_LEAD[0]): - by, err := goyaml.Marshal(in) + by, err := yaml.Marshal(in) if err != nil { return nil, err } @@ -83,7 +83,7 @@ func InterfaceToFrontMatter(in interface{}, mark rune) ([]byte, error) { if err != nil { return nil, err } - by, err := goyaml.Marshal(in) + by, err := yaml.Marshal(in) if err != nil { return nil, err } @@ -178,7 +178,7 @@ func removeTomlIdentifier(datum []byte) []byte { func HandleYamlMetaData(datum []byte) (interface{}, error) { m := map[string]interface{}{} - if err := goyaml.Unmarshal(datum, &m); err != nil { + if err := yaml.Unmarshal(datum, &m); err != nil { return m, err } return m, nil From b3240db44bb7b480ec8691395720c85b2fc01efb Mon Sep 17 00:00:00 2001 From: Franklin Wise Date: Sun, 10 Aug 2014 13:49:33 -0700 Subject: [PATCH 26/26] Added a note after the script adding potential issues per @franklinwise's feedback --- docs/content/tutorials/github_pages_blog.md | 25 ++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/docs/content/tutorials/github_pages_blog.md b/docs/content/tutorials/github_pages_blog.md index 59042d3f509..bd7140cff1f 100644 --- a/docs/content/tutorials/github_pages_blog.md +++ b/docs/content/tutorials/github_pages_blog.md @@ -131,8 +131,9 @@ To get this properly set up we will execute a series of commands at the terminal # Pull down the file we just committed. This helps avoid merge conflicts git subtree pull --prefix=public - # Run hugo. Generated site will be placed in public directory - hugo + # Run hugo. Generated site will be placed in public directory (or omit -t ThemeName if you're not using a theme) + hugo -t ThemeName + # Add everything git add -A @@ -156,15 +157,29 @@ Now, as you add new posts to your blog, you will follow steps that look somethin * Push the `master` branch * Push the public subtree to the remote `gh-pages` branch -The first two items in the previous list are simply a way to conveniently preview your content as you write. This is a dynamic and fairly streamlined process. All the remaining items, however, are the same every time you want to add new content to the website. To make this repetitive process easier, I have adapted a script from the source repository for the [Chimer Arta & Maker Space](https://github.com/chimera/chimeraarts.org) website that is highlighted in the [Hugo Showcase](/showcase). The script lives in a file called `deploy.sh` and has the following contents +The first two items in the previous list are simply a way to conveniently preview your content as you write. This is a dynamic and fairly streamlined process. All the remaining items, however, are the same every time you want to add new content to the website. To make this repetitive process easier, I have adapted a script from the source repository for the [Chimer Arta & Maker Space](https://github.com/chimera/chimeraarts.org) website that is highlighted in the [Hugo Showcase](/showcase). The script lives in a file called `deploy.sh` and has the following contents: + +**Note:** + +The first command `hugo` assumes you are running with all the default settings. + +To use a theme, make sure to specify it with `-t ThemeName` instead (or include the theme in the config file). + + hugo -t ThemeName + +To build all draft posts *(If you only have drafts, no site will be generated)* + + hugo --buildDrafts + +**Deploy.sh:** #!/bin/bash echo -e "\033[0;32mDeploying updates to Github...\033[0m" - # Build the project. (If you only have drafts, no site will be generated) + # Build the project. hugo - + # Add changes to git. git add -A