Anthony Fok [Wed, 19 Aug 2015 06:36:22 +0000 (00:36 -0600)]
Search current directory for config file by default
As of 2015-08-16, Viper no longer searches the CWD
for config file by default to avoid unintended surprises,
but Hugo relies on the original behaviour.
Fixed by calling
viper.AddConfigPath(".")
at the appropriate place.
See https://github.com/spf13/viper/issues/73 for more information.
Anthony Fok [Sat, 8 Aug 2015 20:22:48 +0000 (14:22 -0600)]
docs: Clean up and align Showcase thumbnail images
Some of the thumbnails in Showcase were out of place
because of several irregularly sized thumbnails,
and some of them almost 300KB in filesize.
Resize them all to 600x400 (pixels), and use the `-tn.png`
suffix.
When necessary, the website snapshot is re-captured using
gnome-web-photo. Then, the following commands (or a combination
thereof) are used to crop and resize the image into a thumbnail,
and to reduce its filesize:
Anthony Fok [Sat, 8 Aug 2015 07:41:18 +0000 (01:41 -0600)]
docs: Add site title; set pluralizeListTitles = false
To prevent "Showcase" from becoming "Showcases",
also to have the RSS feed display correct titles,
i.e. "Showcase on gohugo.io" rather than "Showcase on ".
Baptiste Mathus [Sat, 1 Aug 2015 21:50:39 +0000 (23:50 +0200)]
Doc for other supported formats (external helpers)
As Hugo now supports more formats thanks to the new "external helpers"
feature recently introduced, and as requested by some people, I added
some lines in the doc:
* basically confirming it actually exists
* how to use it
'sort' template function used to accept only each element's struct field
name, method name and map key name as its second argument. This extends
it to accept a field/method/key chaining key string like
'Params.foo.bar' as the argument. It evaluates sub elements of each
array or map elements and sorts by them.
Typical use case would be sorting pages by user defined front matter
value. For example, sorting pages by 'Params.foo.bar' is possible by
writing the following template code
{{ range sort .Data.Pages "Params.foo.bar" }}
{{ .Content }}
{{ end }}
It ignores all leading and trailing dots so "Params.foo.bar" can be
written in ".Params.foo.bar"
This also fixes the issue that 'sort' cannot evaluate a pointer value.
sort template function returns `[]interface{}` type slice value
regardless of its original element type.
This fixes it to keep the original element type. For example, if it
sorts `map[string]int` type value, it returns `[]int` slice value
instead of `[]interface{}` slice value.
When a YAML/TOML's delimiter character sequence is included in a
frontmatter string, parser mistakes it as a delimiter. This fixes it by
checking a character right before the delimiter sequence is '\n' or it
is the beginning of the frontmatter.
This simplifies the retrieval of the HTML (no more need to extract the
part within body) and also removes the unwanted "Last Updated" part in
the article.
Scott C Wilson [Mon, 13 Jul 2015 09:41:46 +0000 (05:41 -0400)]
Make small fixes to README file
- Add a step to Contributor instructions for those modifying commands
- Change forum link to http (https does not work)
- Add "Sign the forum release thread" to contributor instructions
Valere JEANTET [Thu, 25 Jun 2015 10:26:48 +0000 (12:26 +0200)]
Allow page.HasMenuCurrent() and node.HasMenuCurrent() to proceed with multi-level nested menus
Currently HasMenuCurrent only process the first 2 levels.
Andrew Brampton [Fri, 3 Jul 2015 21:53:50 +0000 (14:53 -0700)]
Add support for GitHub-flavoured markdown code fences for highlighting
This commit adds a new PygmentsCodeFences config option (default false), which if true will allow GitHub style backtick code fences around code, which will then be rendered by Pygments.
For example:
``` language
your code
```
can be used instead of {{< highlight language >}}your code {{< /highlight >}}.
Andrew Brampton [Fri, 3 Jul 2015 21:51:43 +0000 (14:51 -0700)]
If no language is provided to Pygments, then try and guess it
Previously if no language was specified, then illegal args would be passed to pygments, for example `pygments -l -fhtml`, which would result in pygments printing an error.
I could be wrong here, but it looks to me like .Site.Social.facebook is used in tpl/template_embedded.go, but the variable is never set. I've added a line to initializeSiteInfo to map the info from config into this variable.
Tatsushi Demachi [Sat, 27 Jun 2015 17:15:42 +0000 (02:15 +0900)]
Add nil comparison to where tpl function
`where` template function's internal condition check function always
returns `false` when a target value doesn't exist or it's nil value but
this behavior makes it difficult to filter values which doesn't have a
particular parameter.
To solve it, this adds nil value comparison to the function.
`where Values ".Param.key" nil` like clause can be used for the case
above.
Only "=", "==", "eq", "!=", "<>", "ne" operators are allowed to be used
with `nil`. If an other operator is passed with `nil`, the condition
check function returns `false` like before.