Phil Pennock [Fri, 3 Jan 2014 23:36:53 +0000 (18:36 -0500)]
Add `canonifyurls` config option.
Be able to inhibit AbsURL canonicalization of content, on a site
configuration basis. Advantages of being able to inhibit this include
making it easier to rendering on other hostnames, and being able to
include resources on http or https depending on how this page was
retrieved, avoiding mixed-mode client complaints without adding latency
for plain http.
spf13 [Fri, 10 Jan 2014 17:50:31 +0000 (12:50 -0500)]
Report error, but don’t fatally stop if pygments has error. Return original string. (+1 squashed commit)
Squashed commits:
[849a7af] if highlighting doesn’t work, just return original string
Egon Elbre [Sun, 15 Dec 2013 15:19:22 +0000 (17:19 +0200)]
Added batching behavior for page building.
Quite often file watcher gets many changes and each change triggered a
build. One build per second should be sufficient. Also added tracking for
new folders.
Egon Elbre [Sun, 15 Dec 2013 14:31:29 +0000 (16:31 +0200)]
Fix static file change detection on Windows.
Fixed windows uses different filepath separator. The filepath.ToSlash
shouldn't be used, because it can cause errors in filepath suffix and prefix
testing since "c:\a" isn't a prefix of "c:/a/b/c".
David Arroyo [Mon, 2 Dec 2013 01:33:52 +0000 (20:33 -0500)]
Create directories in publishdir with mode 0777.
The previous permissions (0764), were unusable (directories must
be executable) when generating files for use by another uid. The
Right Thing™ is to use mode 0777. The OS will subtract the process
umask (usually 022) to the for the final permissions.
Phil Pennock [Mon, 18 Nov 2013 23:31:02 +0000 (18:31 -0500)]
Documentation updates, mostly for my bits
* extras/permalinks.md added, weighted to third in the extras menu
* examples added to layout/go-templates.md, using `.Site.Params`
* mention `.Site.Params` in layout/variables.md
* update meta/release-notes.md to mention `first` and the permalinks
* update overview/configuration.md to use reserved-for-documentation
domains and with another example, nudging towards permalinks and site
parameters, with three different data-types shown for the latter
Phil Pennock [Sun, 10 Nov 2013 20:04:51 +0000 (12:04 -0800)]
Truncated; .Site.Params; First function
* Add `.Truncated` bool to each page; will be set true if the
`.Summary` is truncated and it's worth showing a "more" link of some
kind.
* Add `Params` to the site config, defining `.Site.Params` accessible
to each page; this lets the site maintainer associate arbitrary data
with names, on a site-wide basis.
* Provide a `First` function to templates:
* Use-case: `{{range First 5 .Site.Recent}}` or anything else which
is a simple iterable provided by hugolib
* Tests by me for `.Truncated` and `First`
Also @noahcampbell contributed towards this:
* Add UnitTest for `.Site.Params`:
> Digging into this test case a bit more, I'm realizing that we need
> to create a param test case to ensure that for each type we render
> (page, index, homepage, rss, etc.) that the proper fields are
> represented. This will help us refactor without fear in the
> future.
Noah Campbell [Tue, 5 Nov 2013 22:28:06 +0000 (22:28 +0000)]
Remove the hugo-nav function
Remove the hugo-nav since it relied on a slow library. The current
build reimplements the absurl functionality based on string replace.
Discovered that my prior implementation missed the requirement for
making absolute paths (/path) absolute with the host, whereas a relative
path is left untouched. Updated the test cases to support this if this
is reimplemented.
Noah Campbell [Tue, 5 Nov 2013 05:29:37 +0000 (05:29 +0000)]
Adding RSS test case.
Checks to make sure the xml document starts with <?xml. Previously, the
html translate package would write additional details into the document
that caused it to fail.
spf13 [Fri, 25 Oct 2013 22:03:14 +0000 (18:03 -0400)]
Better error handling when rendering error found when in watch mode
In watch mode it should continue to watch for changes, in any other mode it should exit with a -1 error code so can check for success when scripting