Anthony Fok [Wed, 3 Sep 2014 00:10:19 +0000 (18:10 -0600)]
A small fix and update to the multilingual example
Enclose `{{ .Content }}` with a `{{ if .IsPage }}` test to avoid
the "Content is not a field of struct type *hugolib.Node" error.
Thanks to @spf13 for the tip! Fixes #366.
Also update example to Hugo v0.12 conventions:
- Convert config.yaml to config.toml to follow what
`hugo new site /path/to/site` generates
- Rename layouts/chrome to layouts/partials
- Convert `template` calls to `partial` calls
- Add .gitignore to ignore the `public` directory
- Add README.md with pointers to discussions in issues
to help bring newcomers up to speed with this multilingual example
Anthony Fok [Tue, 2 Sep 2014 19:05:20 +0000 (13:05 -0600)]
Update example blog to Hugo v0.12 conventions
- Convert config.yaml to config.toml to follow what
"hugo new site /path/to/site" generates
- Rename layouts/chrome to layouts/partials
- Convert "template" calls to "partial" calls
- Minor revisions to the text in example content
- Upgrade Bootswatch Yeti theme (3.1.1+1 → to 3.2.0+3)
- Upgrade Font Awesome (4.0.3 → 4.2.0)
- Upgrade jQuery (1.11.0 → 1.11.1)
Anthony Fok [Sun, 31 Aug 2014 09:43:25 +0000 (03:43 -0600)]
Fix loading of Lato font in style.css for docs
The "@import url()" statement for loading Lato from Google Fonts
was ignored because "@import are not allowed after any valid statement
other than @charset and @import" according to the W3C CSS Validator.
Also remove the line for importing line-icons.css which no longer
exists.
Nate Finch [Fri, 29 Aug 2014 17:40:21 +0000 (13:40 -0400)]
Fix CreatePages
This fixes #450. There are two problems:
1.) We're creating a new goroutine for every page.
2.) We're calling s.Pages = append(s.Pages, page) inside each goroutine.
1 is a problem if in that if you have a ton of pages, that's a ton of goroutines. It's not really useful to have more than a few goroutines at a time, and lots can actually make your code much slower, and, evidently, crash.
2 is a problem in that append is not thread safe. Sometimes it returns a new slice with a larger capacity, when the original slice isn't large enough. This can cause problems if two goroutines do this at the same time.
The solution for 1 is to use a limited number of workers (I chose 2*GOMAXPROCS as a nice guess).
The solution for 2 is to serialize access to s.Pages, which I did by doing it in a single goroutine.
Nate Finch [Fri, 22 Aug 2014 11:59:59 +0000 (07:59 -0400)]
Support subdir in baseurl.
Mainly this was a change to helpers.MakePermalink, but to get the local server to run correctly,
we needed to redirect the path of the request from /foo to /. In addition, I added tests for the
server's code for fixing up the base url with different config file & CLI options.
Joel Scoble [Sat, 23 Aug 2014 21:12:36 +0000 (16:12 -0500)]
added functionality to check the error message returned from Cobra, if any. for uage message text. If its present, the usage message gets truncated and the resulting message is returned to be used for the rest of the error message. If the resulting error is blank, no error message is printed
Rahul Bansal [Fri, 15 Aug 2014 18:39:12 +0000 (00:09 +0530)]
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.
Nate Finch [Sun, 3 Aug 2014 10:53:48 +0000 (06:53 -0400)]
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.