summaryrefslogtreecommitdiffstats
path: root/hugolib
AgeCommit message (Collapse)Author
2015-12-12Duplicate p.Description in Params mapBjørn Erik Pedersen
Fixes #1484
2015-12-10Add copyright header to that source files that don’t have one.Anthony Fok
See #1646
2015-12-07Fix copyright headers in source filesBjørn Erik Pedersen
Still need to add some missing headers and an AUTHORS file. See #1646
2015-12-06Sort and remove "" from "Available templates" listAnthony Fok
2015-12-06Remove transformation of menu URLsgunnaraasen
Fixes #1239
2015-12-03Fix broken Highlight testBjørn Erik Pedersen
2015-12-02Improve error handling in commandsBjørn Erik Pedersen
Cobra, the CLI commander in use in Hugo, has some long awaited improvements in the error handling department. This enables a more centralized error handling approach. This commit introduces that by changing all the command funcs to `RunE`: * The core part of the error logging, usage logging and `os.Exit(-1)` is now performed in one place and that one place only. * The usage text is now only shown on invalid arguments etc. (user errors) Fixes #1502
2015-12-01Print error when /index.html is zero-lengthAnthony Fok
Also print warning (in verbose mode) for other empty pages. See #947
2015-12-01Run `go fmt hugolib/site.go`Anthony Fok
2015-11-23Change the license to Apache 2.0Steve Francia
2015-11-23Permalink on Node and Page should be of stringKato Kazuyoshi
This change fixes #1384.
2015-11-23Move blackfriday site-wide config loading to NewBlackFriday()Marek Janda
2015-11-23Add shortcode IsNamedParams propertyCameron Moore
It would be helpful to know whether a shortcode was called with positional or named parameters. This commit adds a boolean `IsNamedParams` property to the `ShortcodeWithPage` struct.
2015-11-21Avoid multiple locks for shortcode templateBjørn Erik Pedersen
Fixes #1600
2015-11-21Improve RW-locking of template in shortcode handlingBjørn Erik Pedersen
See #1599
2015-11-21Fix recently introduced new data race in the shortcode handlingBjørn Erik Pedersen
Fixes #1599
2015-11-20Add RSSLink to SiteInfoCameron Moore
2015-11-20Return error if shortcode template.Tree is nilCameron Moore
If a shortcode template fails to compile, the template will be non-nil, but template.Tree will be nil which caused a panic.
2015-11-17Make replaceShortcodeTokens rewrite the input sliceBjørn Erik Pedersen
Currently a `[]byte` copy is returned. In most cases this is the safe thing to do, but we should just modify/grow the slice as needed. This is faster and consumes less memory: ``` benchmark old ns/op new ns/op delta BenchmarkReplaceShortcodeTokens-4 7350 4419 -39.88% benchmark old allocs new allocs delta BenchmarkReplaceShortcodeTokens-4 5 1 -80.00% benchmark old bytes new bytes delta BenchmarkReplaceShortcodeTokens-4 4816 1152 -76.08% ``` This commit is aso a small spring cleaning of duplicated code in the different `PageConvert` methods. Fixes #1516
2015-11-16Fix trivial typos in codeAnthony Fok
2015-11-15simplify rssuri logicspf13
2015-11-13Get rid of allocation in the BenchmarkReplaceShortcodeTokens itselfBjørn Erik Pedersen
So we can see the real numbers. See #1516
2015-11-10Fix GroupByParam to return original param stringTatsushi Demachi
Page.GroupByParam function internally uses Page.GetParam to get a parameter value for a key of a page group but now Page.GetParam returns a lowercase character string every time. It has no need to using lowercase character string as a group key value and it confuse a function user. This fixes it to keep and return an original parameter string as a group key value. Fix #1564
2015-11-09Use Identifier as last sort resort for default menu sortBjørn Erik Pedersen
Fixes #1562
2015-11-04Add internal Google Analytics templatedigitalcraftsman
This commits also adds the GoogleAnalytics variable to insert the tracking code. Fixes #1424.
2015-11-02Export Page.LayoutBjørn Erik Pedersen
And at the same time rename and unexport the badly named `Layout()` func. That method is not very usable outside the package. Fixes #1539
2015-10-15Disable LiveReload when Hugo is not running as a serverKato Kazuyoshi
This change fixes #1410.
2015-10-15Fix typo in shortcode testsNathan Youngman
2015-10-12Add Param(key) to Node and PageBjørn Erik Pedersen
This is a convenience method to do lookups in Page's (Page only) and Site's Params map (Page and Node), in that order. Fixes #1462
2015-10-07WordCount and Summary support CJK Languagecoderzh
* add global `hasCJKLanguage` flag, if true, turn on auto-detecting CJKLanguage * add `isCJKLanguage` frontmatter to force specify whether is CJKLanguage or not * For .Summary: If isCJKLanguage is true, use the runes as basis for truncation, else keep as today. * For WordCount: If isCJKLanguage is true, use the runes as basis for calculation, else keep as today. * Unexport RuneCount Fixes #1377
2015-09-30Use filepath as the last default sort key for pagesBjørn Erik Pedersen
2015-09-25Allow for any (short) line begining or ending with html commentSven Dowideit
Fixes #1428
2015-09-13Validate aliases to prevent directory traversal etc.Anthony Fok
Add validation before creating aliases: * Prevent creating aliases outside webroot (public/ dir) * Skip empty "" alias * Skip "/" → "/index.html", which gets overwritten anyway * Refuse to create Windows-invalid filenames on Windows; warn on other platforms * In case of invalid aliases, after skipping them, return `err = nil` to prevent the error passing up all the way to `hugolib.Render()` and causing Hugo to abort. * Update alias tests. Fixes #701: Add support for alias with whitespace Fixes #1418: Add validation for alias
2015-09-13Complete the Url-to-URL transition in testsAnthony Fok
See #959
2015-09-12WordCount Summary support UTF-8 stringcoderzh
2015-09-01Add config option "disablePathToLower"chrongzhang
Enabling this prevents lowercasing of the path/url. Fixes #557
2015-08-31Correct check of published booleanJeff Hodges
2015-08-30Add undocumented published setting to front matterJeff Hodges
A new "published" setting that is the opposite of "draft" is added and left intentionally undocumented. This setting comes from jekyll and eases the transition to hugo greatly. We leave it undocumented so that folks don't rely on it, but also don't shoot themselves in the foot during a jekyll migration. The foot-shooting occurs if they have only a few documents that were drafts ("published: false") in the jekyll version of their site and don't notice that they were published in the migration to hugo.
2015-08-07Reset Scratch for 404Bjørn Erik Pedersen
The 404 pages etc. need a better solution, but fix this issue for now. Fixes #1336
2015-08-07Avoid panic in shortcode param handlingBjørn Erik Pedersen
Fixes #1337
2015-08-07Do not panic on index out of range in shortcode.GetBjørn Erik Pedersen
Fixes #1335
2015-08-04Strip trailing whitespace in codeAnthony Fok
2015-08-02Add map support to scratchMarek Janda
2015-07-30Remove deprecated fields and methods for v0.15Anthony Fok
Special thanks to @bep for his guidance and for making sure all of the Hugo themes get updated. Fixes #1172
2015-07-29Always use the template provided in page.RenderBjørn Erik Pedersen
Fixes #1306
2015-07-26Fix inconsistent front matter handlingBjørn Erik Pedersen
Fixes #768
2015-07-25Fix periods in taxonomies create bad pathsRyan Clarke
Fixes #1188
2015-07-25Replace strings.CompareBjørn Erik Pedersen
Which is a Go 1.5 func. See #1299
2015-07-25Fix sort test and title sortBjørn Erik Pedersen
See #1299
2015-07-25Fall back to link title for default page sortBjørn Erik Pedersen
Fixes #1299