brevno-suite/hugo
7 years agocommands: Make first letter of flags' usage lowercase
Albert Nigmatzianov [Wed, 26 Apr 2017 19:58:10 +0000 (21:58 +0200)]
commands: Make first letter of flags' usage lowercase

7 years agovendor: Update cobra and pflag
Albert Nigmatzianov [Wed, 26 Apr 2017 19:26:20 +0000 (21:26 +0200)]
vendor: Update cobra and pflag

* Faster help message
* Faster docs
* Adds help flag in usage

7 years agoreleaser: Fix some of the fpm fields for deb
Anthony Fok [Wed, 26 Apr 2017 16:51:05 +0000 (10:51 -0600)]
releaser: Fix some of the fpm fields for deb

7 years agohugolib: Make missing GitInfo a WARNING
Bjørn Erik Pedersen [Wed, 26 Apr 2017 09:03:12 +0000 (11:03 +0200)]
hugolib: Make missing GitInfo a WARNING

And not an ERROR.

Fixes #3376

7 years agodocs: Add notes about some output format behaviour
Jordan [Tue, 25 Apr 2017 17:37:35 +0000 (14:37 -0300)]
docs: Add notes about some output format behaviour

7 years agoreleaser: Fix ldflags setting
Bjørn Erik Pedersen [Tue, 25 Apr 2017 12:30:48 +0000 (14:30 +0200)]
releaser: Fix ldflags setting

Closes #3382

7 years agodocs: Remove temp release notes
Bjørn Erik Pedersen [Tue, 25 Apr 2017 07:48:23 +0000 (09:48 +0200)]
docs: Remove temp release notes

7 years agodocs: Add relase notes for 0.20.5
Bjørn Erik Pedersen [Tue, 25 Apr 2017 07:17:06 +0000 (09:17 +0200)]
docs: Add relase notes for 0.20.5

[ci skip]

7 years agodocs: Add a time to 0.20.4 release docs
Bjørn Erik Pedersen [Mon, 24 Apr 2017 19:46:00 +0000 (21:46 +0200)]
docs: Add a time to 0.20.4 release docs

To make it newer than the one earlier today :-)

7 years agoreleaser: Add relase notes for release of 0.20.4 v0.20.4
Bjørn Erik Pedersen [Mon, 24 Apr 2017 18:30:20 +0000 (20:30 +0200)]
releaser: Add relase notes for release of 0.20.4

[ci skip]

7 years agoAdd -linkmode external
James Munnelly [Mon, 24 Apr 2017 14:36:18 +0000 (15:36 +0100)]
Add -linkmode external

7 years agoSet extldflags to static when building
James Munnelly [Mon, 24 Apr 2017 14:22:23 +0000 (15:22 +0100)]
Set extldflags to static when building

7 years agoreleaser: Add relase notes to /docs for release of 0.20.3
Ubuntu [Mon, 24 Apr 2017 11:07:47 +0000 (11:07 +0000)]
releaser: Add relase notes to /docs for release of 0.20.3

[ci skip]

7 years agorelease: Adjust release notes for 0.20.3
Bjørn Erik Pedersen [Mon, 24 Apr 2017 10:55:18 +0000 (12:55 +0200)]
release: Adjust release notes for 0.20.3

7 years agoreleaser: Add relase notes draft for release of 0.20.3
Bjørn Erik Pedersen [Mon, 24 Apr 2017 10:47:32 +0000 (12:47 +0200)]
releaser: Add relase notes draft for release of 0.20.3

[ci skip]

7 years agoreleaser: Fix a Go vet complaint
Bjørn Erik Pedersen [Mon, 24 Apr 2017 10:41:47 +0000 (12:41 +0200)]
releaser: Fix a Go vet complaint

See #3358

7 years agoAutomate the Hugo release process
Bjørn Erik Pedersen [Thu, 13 Apr 2017 14:59:05 +0000 (16:59 +0200)]
Automate the Hugo release process

This commit adds a work flow aroung GoReleaser to get the Hugo release process automated and more uniform:

* It can be run fully automated or in two steps to allow for manual edits of the relase notes.
* It supports both patch and full releases.
* It fetches author, issue, repo info. etc. for the release notes from GitHub.
* The file names produced are mainly the same as before, but we no use tar.gz as archive for all Unix versions.
* There isn't a fully automated CI setup in place yet, but the release tag is marked in the commit message with "[ci deploy]"

Fixes #3358

7 years agohugolib: Fix handling of zero-length files
Bjørn Erik Pedersen [Sun, 23 Apr 2017 20:03:25 +0000 (22:03 +0200)]
hugolib: Fix handling of zero-length files

This was a regression in Hugo 0.20. This commit makes sure that zeron-length files are not rendered to file.

Fixes #3355

7 years agohugolib: Prevent decoding pageParam in common cases
Albert Nigmatzianov [Thu, 6 Apr 2017 20:29:37 +0000 (22:29 +0200)]
hugolib: Prevent decoding pageParam in common cases

7 years agohelpers: Delete RenderingContext.getConfig
Albert Nigmatzianov [Thu, 6 Apr 2017 20:24:27 +0000 (22:24 +0200)]
helpers: Delete RenderingContext.getConfig

7 years agohugolib: Ignore non-source files on partial rebuild
xofyarg [Sat, 22 Apr 2017 20:38:54 +0000 (21:38 +0100)]
hugolib: Ignore non-source files on partial rebuild

Partial rebuild does not have the same logic as normal rebuild on
selecting which file to build. This change makes it possible to
share the file select logic between two kinds of build.

Fix #3325.

7 years agotplimpl: Add translation links to the default sitemap template
Jack Taylor [Sat, 22 Apr 2017 20:37:14 +0000 (05:37 +0900)]
tplimpl: Add translation links to the default sitemap template

For pages with translations, add links with hreflang attributes to the
default sitemap template. This helps Google to show the correct
language page in its search results. The syntax used is based on
Google's example at [1].

Also update the sitemap template docs to reflect the changes in the
default template.

[1]
https://support.google.com/webmasters/answer/2620865?hl=en&topic=2370587&ctx=topic

Fixes #2569

7 years agocommands: Import Octopress image tag in Jekyll importer
Stefan Buynov [Sat, 22 Apr 2017 20:35:52 +0000 (23:35 +0300)]
commands: Import Octopress image tag in Jekyll importer

7 years agoFix check-vendor logic in Makefile
Cameron Moore [Wed, 19 Apr 2017 18:41:52 +0000 (13:41 -0500)]
Fix check-vendor logic in Makefile

7 years agoRemove check-vendor from make check
Bjørn Erik Pedersen [Wed, 19 Apr 2017 16:12:01 +0000 (18:12 +0200)]
Remove check-vendor from make check

I suspect there are some false negatives in this one.

7 years agovendor: Fix go-toml
Bjørn Erik Pedersen [Wed, 19 Apr 2017 16:09:51 +0000 (18:09 +0200)]
vendor: Fix go-toml

7 years agoAdd check-vendor target to Makefile
Cameron Moore [Wed, 19 Apr 2017 13:05:20 +0000 (08:05 -0500)]
Add check-vendor target to Makefile

The check-vendor target will exit with an error if any files in vendor/
differ from what's checked into git.

govendor checksums can get out of sync if extraneous files are in the
local, third-party repo (see kardianos/govendor#129).  govendor also
updates the vendor.json upon "sync."  We can use that quirk to detect
out of sync checksums in CI, so I've added check-vendor to the check
target dependencies.

7 years agohugolib: Log WARNING only on unknown /data files
Bjørn Erik Pedersen [Tue, 18 Apr 2017 16:47:37 +0000 (18:47 +0200)]
hugolib: Log WARNING only on unknown /data files

Fixes #3361

7 years agodocs: Add txtpen as alternative commenting service
Ricky Han [Mon, 10 Apr 2017 18:28:12 +0000 (14:28 -0400)]
docs: Add txtpen as alternative commenting service

7 years agodocs: Fix .Data.Pages range in sample
Rachel Simone Weil [Sun, 16 Apr 2017 05:51:57 +0000 (00:51 -0500)]
docs: Fix .Data.Pages range in sample

7 years agodocs: Add 0.20.2 release notes
Bjørn Erik Pedersen [Sun, 16 Apr 2017 08:56:50 +0000 (10:56 +0200)]
docs: Add 0.20.2 release notes

7 years agotplimpl: Allow text partials in HTML templates
Bjørn Erik Pedersen [Sat, 15 Apr 2017 09:33:53 +0000 (11:33 +0200)]
tplimpl: Allow text partials in HTML templates

Most obvius benefit of this is to include CSS partials with css file suffix into HTML templates.

A valid workaround would be to rename the file `mystyles.html`, but that doesn't work too good for external editors etc.

The css partial is  a method used in some themes before Hugo 0.20, but then it stopped working.

This commit reintroduces that behaviour.

Note that the regular layout lookups for text templates, i.e. "single.json" will be
prefixed with "_text/" on lookup and will only match in the text collection.

Fixes #3273

7 years agovendor: Update dependencies
Bjørn Erik Pedersen [Thu, 13 Apr 2017 22:35:14 +0000 (00:35 +0200)]
vendor: Update dependencies

7 years agodocs: Add Netlify badge if on Netlify
Bjørn Erik Pedersen [Fri, 14 Apr 2017 07:35:51 +0000 (09:35 +0200)]
docs: Add Netlify badge if on Netlify

7 years agoGet versions back to 0.20-DEV
Bjørn Erik Pedersen [Thu, 13 Apr 2017 14:19:50 +0000 (16:19 +0200)]
Get versions back to 0.20-DEV

This reverts commit 8ac1fcd0ceb5d2e55e16a9caa7f6f0d646a07668.

7 years agoPrepare release 0.20.1 v0.20.1
Bjørn Erik Pedersen [Thu, 13 Apr 2017 14:00:30 +0000 (16:00 +0200)]
Prepare release 0.20.1

7 years agodocs: Add 0.20.1 release notes
Bjørn Erik Pedersen [Thu, 13 Apr 2017 09:38:55 +0000 (11:38 +0200)]
docs: Add 0.20.1 release notes

7 years agooutput: Fix base theme vs project base template logic
Bjørn Erik Pedersen [Wed, 12 Apr 2017 18:40:36 +0000 (20:40 +0200)]
output: Fix base theme vs project base template logic

Fixes #3323

7 years agodocs: Add sanjay-saxena.github.io to the showcase
Sanjay Saxena [Tue, 11 Apr 2017 22:03:28 +0000 (15:03 -0700)]
docs: Add sanjay-saxena.github.io to the showcase

7 years agohugolib, output: Do not lower case template names
Bjørn Erik Pedersen [Wed, 12 Apr 2017 19:01:22 +0000 (21:01 +0200)]
hugolib, output: Do not lower case template names

This regression was introduced in Hugo 0.20.

Fixes #3333

7 years agohugolib: Must recreate Paginator on live-reload
Bjørn Erik Pedersen [Wed, 12 Apr 2017 16:11:37 +0000 (18:11 +0200)]
hugolib: Must recreate Paginator on live-reload

The structure may potentially have changed, and then it fails.

Fixes #3315

7 years agohugolib: Avoid recreating the Paginator on copy
Bjørn Erik Pedersen [Wed, 12 Apr 2017 11:00:44 +0000 (13:00 +0200)]
hugolib: Avoid recreating the Paginator on copy

See #3315

7 years agohugolib: Avoid processing the same notify event twice
Bjørn Erik Pedersen [Wed, 12 Apr 2017 08:07:08 +0000 (10:07 +0200)]
hugolib: Avoid processing the same notify event twice

On `macOS`, at least, we've seen multiple WRITE events for same file, and no need to do the same job twice.

7 years agosnapcraft: Go 1.8.1
Anthony Fok [Wed, 12 Apr 2017 09:05:01 +0000 (03:05 -0600)]
snapcraft: Go 1.8.1

7 years agohugolib: Final fix of rssURI deprecation
Bjørn Erik Pedersen [Mon, 10 Apr 2017 19:26:55 +0000 (21:26 +0200)]
hugolib: Final fix of rssURI deprecation

Fixes #3319

7 years agohugolib: Only show rssUri deprecation WARNING if it is actually set
Bjørn Erik Pedersen [Mon, 10 Apr 2017 15:54:55 +0000 (17:54 +0200)]
hugolib: Only show rssUri deprecation WARNING if it is actually set

Fixes #3319

7 years agoall Bump to 0.21-DEV
Bjørn Erik Pedersen [Mon, 10 Apr 2017 07:33:21 +0000 (09:33 +0200)]
all Bump to 0.21-DEV

7 years agoall: Prepare Hugo 0.20 release version v0.20
Bjørn Erik Pedersen [Mon, 10 Apr 2017 07:10:53 +0000 (09:10 +0200)]
all: Prepare Hugo 0.20 release version

7 years agodocs: AddHugo 0.20 Release Notes
Bjørn Erik Pedersen [Mon, 10 Apr 2017 07:07:01 +0000 (09:07 +0200)]
docs: AddHugo 0.20 Release Notes

7 years agodocs: Add Emacs plugin easy-hugo
Masashi Miyaura [Sat, 8 Apr 2017 19:08:41 +0000 (04:08 +0900)]
docs: Add Emacs plugin easy-hugo

7 years agodocs: Add siba.ai to the showcase
ssc2015 [Sat, 8 Apr 2017 15:47:28 +0000 (15:47 +0000)]
docs: Add siba.ai to the showcase

7 years agohugolib: Remove unused line
Bjørn Erik Pedersen [Sat, 8 Apr 2017 16:04:12 +0000 (18:04 +0200)]
hugolib: Remove unused line

7 years agohugolib: Delay deletion of Page.Now()
Bjørn Erik Pedersen [Sat, 8 Apr 2017 16:02:36 +0000 (18:02 +0200)]
hugolib: Delay deletion of Page.Now()

Looking at the state of the themes, it will be too painful to log ERROR now.

7 years agodocs: Add docs about output format linking
Bjørn Erik Pedersen [Sat, 8 Apr 2017 14:33:20 +0000 (16:33 +0200)]
docs: Add docs about output format linking

Fixes #3301
Fixes #3302

7 years agohugolib, output: Add NotAlternative to OutputFormat
Bjørn Erik Pedersen [Sat, 8 Apr 2017 09:15:28 +0000 (11:15 +0200)]
hugolib, output: Add NotAlternative to OutputFormat

To make sure CSS and similar does not appear in the AlternativeOutputFormats list.

7 years agohugolib: Deprecate rssURI
Bjørn Erik Pedersen [Sat, 8 Apr 2017 08:45:11 +0000 (10:45 +0200)]
hugolib: Deprecate rssURI

8 years agotravis: Go 1.8.1
Bjørn Erik Pedersen [Fri, 7 Apr 2017 18:30:45 +0000 (20:30 +0200)]
travis: Go 1.8.1

8 years agohubolib: Do not add missing trailing slash to command line baseURL
Bjørn Erik Pedersen [Fri, 7 Apr 2017 16:33:28 +0000 (18:33 +0200)]
hubolib: Do not add missing trailing slash to command line baseURL

This makes it consistent with how it behaves when it's set in config.toml.

This commit also unifies BaseURL in Site.Info so we now have one source for this value.

Fixes #3262

8 years agoUpdate press.md
Li-Wen Yip [Thu, 6 Apr 2017 21:24:53 +0000 (22:24 +0100)]
Update press.md

Add "Getting started with Hugo and the plain-blog theme, on NearlyFreeSpeech.Net"

8 years agohugolib: Add .Site.Params.mainSections
Bjørn Erik Pedersen [Fri, 7 Apr 2017 11:03:34 +0000 (13:03 +0200)]
hugolib: Add .Site.Params.mainSections

Fixes #3206

8 years agohugolib: Only do link transforms etc. on HTML type of pages
Bjørn Erik Pedersen [Fri, 7 Apr 2017 09:01:36 +0000 (11:01 +0200)]
hugolib: Only do link transforms etc. on HTML type of pages

See #2828

8 years agoall: Document the Output Formats feature
Bjørn Erik Pedersen [Wed, 5 Apr 2017 14:18:53 +0000 (16:18 +0200)]
all: Document the Output Formats feature

This commit also adds a new command, docshelper, with some utility funcs that adds a JSON datafiles to /docs/data that would be a pain to create and maintain by hand.

Fixes #3242

8 years agohugolib: Update deprecation vs Hugo 0.20
Bjørn Erik Pedersen [Fri, 7 Apr 2017 08:48:09 +0000 (10:48 +0200)]
hugolib: Update deprecation vs Hugo 0.20

Fixes #3271

8 years agooutput: Add some sane defaults for output format
Bjørn Erik Pedersen [Fri, 7 Apr 2017 08:43:48 +0000 (10:43 +0200)]
output: Add some sane defaults for output format

Fixes #3290

8 years agotpl: Set RenderingContext.Config in markdownify
Albert Nigmatzianov [Thu, 6 Apr 2017 17:38:24 +0000 (19:38 +0200)]
tpl: Set RenderingContext.Config in markdownify

8 years agohelpers: Add new properties to ContentSpec
Albert Nigmatzianov [Thu, 6 Apr 2017 17:37:41 +0000 (19:37 +0200)]
helpers: Add new properties to ContentSpec

8 years agoall: Handle all errors
Bjørn Erik Pedersen [Thu, 6 Apr 2017 15:39:20 +0000 (17:39 +0200)]
all: Handle all errors

As reported by `errcheck`.

8 years agomedia, output: Fix spelling
Bjørn Erik Pedersen [Thu, 6 Apr 2017 13:28:56 +0000 (15:28 +0200)]
media, output: Fix spelling

8 years agodocs: Disable GitInfo by default
Bjørn Erik Pedersen [Thu, 6 Apr 2017 11:49:06 +0000 (13:49 +0200)]
docs: Disable GitInfo by default

Use `--enableGitInfo` when publishing.

This gives a much better out-of-the-box editing experience.

8 years agodocs: Add info about Pygments installation in installing.md
Chris Hager [Thu, 6 Apr 2017 11:48:22 +0000 (13:48 +0200)]
docs: Add info about Pygments installation in installing.md

Additional information about the Pygments dependency in the "installing from source" chapter.

8 years agodocs: Add article by Li-Wen Yip to press section
Li-Wen Yip [Thu, 6 Apr 2017 11:38:32 +0000 (12:38 +0100)]
docs: Add article by Li-Wen Yip to press section

8 years agotpl: Fix nil pointer in Tree()
Bjørn Erik Pedersen [Wed, 5 Apr 2017 20:11:24 +0000 (22:11 +0200)]
tpl: Fix nil pointer in Tree()

Fixes #3285

8 years agodocs: Properly capitalize GitHub
Ricardo N Feliciano [Wed, 5 Apr 2017 16:41:23 +0000 (12:41 -0400)]
docs: Properly capitalize GitHub

8 years agohugolib: Add optional outputFormat to Ref/RelRef
Bjørn Erik Pedersen [Tue, 4 Apr 2017 16:14:41 +0000 (18:14 +0200)]
hugolib: Add optional outputFormat to Ref/RelRef

Fixes #3224

8 years agoRegister all media types when in server mode
Bjørn Erik Pedersen [Tue, 4 Apr 2017 16:05:19 +0000 (18:05 +0200)]
Register all media types when in server mode

Fixes #3274

8 years agotplimpl: Reintroduce the double template lookup in Partial
Bjørn Erik Pedersen [Tue, 4 Apr 2017 15:21:04 +0000 (17:21 +0200)]
tplimpl: Reintroduce the double template lookup in Partial

So it works as before without the html suffix.

Fixes #3272

8 years agoall: Use the configured output types to resolve template type
Bjørn Erik Pedersen [Tue, 4 Apr 2017 12:10:20 +0000 (14:10 +0200)]
all: Use the configured output types to resolve template type

Closes #320

8 years agohugolib: Improve render error handling
Bjørn Erik Pedersen [Tue, 4 Apr 2017 11:32:29 +0000 (13:32 +0200)]
hugolib: Improve render error handling

Catch and return the "template not found" error earlier.

8 years agocommands, helpers: Add correct verbose log level to the global loggers
Bjørn Erik Pedersen [Tue, 4 Apr 2017 09:02:12 +0000 (11:02 +0200)]
commands, helpers: Add correct verbose log level to the global loggers

We still use those in some cases.

8 years agooutput: Make template name lower cased
Bjørn Erik Pedersen [Tue, 4 Apr 2017 08:29:26 +0000 (10:29 +0200)]
output: Make template name lower cased

8 years agohugolib: Read media types and output formats from site config
Bjørn Erik Pedersen [Tue, 4 Apr 2017 07:12:33 +0000 (09:12 +0200)]
hugolib: Read media types and output formats from site config

Closes #3222
Closes #3223

8 years agomedia: Add DecodeTypes
Bjørn Erik Pedersen [Mon, 3 Apr 2017 20:39:37 +0000 (22:39 +0200)]
media: Add DecodeTypes

And clean up the media package.

8 years agooutput: Add output formats decoder
Bjørn Erik Pedersen [Mon, 3 Apr 2017 15:00:23 +0000 (17:00 +0200)]
output: Add output formats decoder

And clean up the output package.

8 years agooutput: Add CSV to the global output formats list
Bjørn Erik Pedersen [Mon, 3 Apr 2017 10:16:32 +0000 (12:16 +0200)]
output: Add CSV to the global output formats list

8 years agovendor: Update go-i18n
Albert Nigmatzianov [Mon, 3 Apr 2017 06:34:12 +0000 (08:34 +0200)]
vendor: Update go-i18n

8 years agodocs: Remove localhost part from link
Kamil Samigullin [Sun, 2 Apr 2017 23:29:53 +0000 (02:29 +0300)]
docs: Remove localhost part from link

Fixes #3264

8 years agotpl: Rework to handle both text and HTML templates
Bjørn Erik Pedersen [Mon, 27 Mar 2017 18:43:49 +0000 (20:43 +0200)]
tpl: Rework to handle both text and HTML templates

Before this commit, Hugo used `html/template` for all Go templates.

While this is a fine choice for HTML and maybe also RSS feeds, it is painful for plain text formats such as CSV, JSON etc.

This commit fixes that by using the `IsPlainText` attribute on the output format to decide what to use.

A couple of notes:

* The above requires a nonambiguous template name to type mapping. I.e. `/layouts/_default/list.json` will only work if there is only one JSON output format, `/layouts/_default/list.mytype.json` will always work.
* Ambiguous types will fall back to HTML.
* Partials inherits the text vs HTML identificator of the container template. This also means that plain text templates can only include plain text partials.
* Shortcode templates are, by definition, currently HTML templates only.

Fixes #3221

8 years agohugolib: Don't ignore errors from applyDepsIfNeeded
Albert Nigmatzianov [Sun, 2 Apr 2017 12:50:13 +0000 (14:50 +0200)]
hugolib: Don't ignore errors from applyDepsIfNeeded

8 years agohugolib, i18n: Update tests with flat format and TOML files
Albert Nigmatzianov [Sat, 1 Apr 2017 20:36:07 +0000 (22:36 +0200)]
hugolib, i18n: Update tests with flat format and TOML files

8 years agovendor: Update go-i18n
Albert Nigmatzianov [Sat, 1 Apr 2017 20:34:59 +0000 (22:34 +0200)]
vendor: Update go-i18n

Fix #2577

8 years agodocs, examples: Use TOML for i18n config files
Albert Nigmatzianov [Fri, 31 Mar 2017 13:04:52 +0000 (15:04 +0200)]
docs, examples: Use TOML for i18n config files

Fix #3200

8 years agovendor: update goorgeous
Chase Adams [Sun, 2 Apr 2017 16:16:55 +0000 (09:16 -0700)]
vendor: update goorgeous

8 years agodocs: Add blog of Enrique Saez Gil to the site showcase
Enrique Saez [Sun, 2 Apr 2017 10:06:31 +0000 (12:06 +0200)]
docs: Add blog of Enrique Saez Gil to the site showcase

8 years agoRevert "tpl: Rework to handle both text and HTML templates"
Bjørn Erik Pedersen [Sun, 2 Apr 2017 12:20:34 +0000 (14:20 +0200)]
Revert "tpl: Rework to handle both text and HTML templates"

Will have to take another stab at this ...

This reverts commit 5c5efa03d2512749950b0d05a7d4bde35ecbdc37.

Closes #3260

8 years agohugolib: Use Page Kind in template errors to prevent log spam
Bjørn Erik Pedersen [Sun, 2 Apr 2017 10:22:54 +0000 (12:22 +0200)]
hugolib: Use Page Kind in template errors to prevent log spam

Having the content page name in the log key for the distinct error logger isnt't very usable when you have an error in a commonly used partial.

Using the Page Kind reduces the amount of log entries. Here is an example from an error in the partial menu.html, used in all the page templates:

```
Started building sites ...
ERROR 2017/04/02 12:19:43 Error while rendering "page": template: /Users/bep/sites/bepsays.com/layouts/_default/single.html:17:7: executing "/Users/bep/sites/bepsays.com/layouts/_default/single.html" at <partial "menu.html" ...>: error calling partial: template: partials/menu.html:9:11: executing "partials/menu.html" at <.DoesNotExist>: can't evaluate field DoesNotExist in type *hugolib.PageOutput
ERROR 2017/04/02 12:19:43 Error while rendering "section": template: /Users/bep/sites/bepsays.com/layouts/_default/section.html:17:7: executing "/Users/bep/sites/bepsays.com/layouts/_default/section.html" at <partial "menu.html" ...>: error calling partial: template: partials/menu.html:9:11: executing "partials/menu.html" at <.DoesNotExist>: can't evaluate field DoesNotExist in type *hugolib.PageOutput
ERROR 2017/04/02 12:19:43 Error while rendering "taxonomy": template: /Users/bep/sites/bepsays.com/layouts/_default/list.html:17:7: executing "/Users/bep/sites/bepsays.com/layouts/_default/list.html" at <partial "menu.html" ...>: error calling partial: template: partials/menu.html:9:11: executing "partials/menu.html" at <.DoesNotExist>: can't evaluate field DoesNotExist in type *hugolib.PageOutput
ERROR 2017/04/02 12:19:43 Error while rendering "home": template: /Users/bep/sites/bepsays.com/layouts/index.html:17:7: executing "/Users/bep/sites/bepsays.com/layouts/index.html" at <partial "menu.html" ...>: error calling partial: template: partials/menu.html:9:11: executing "partials/menu.html" at <.DoesNotExist>: can't evaluate field DoesNotExist in type *hugolib.PageOutput
ERROR 2017/04/02 12:19:43 Error while rendering "404": template: 404.html:2:3: executing "404.html" at <partial "menu.html" ...>: error calling partial: template: partials/menu.html:9:11: executing "partials/menu.html" at <.DoesNotExist>: can't evaluate field DoesNotExist in type *hugolib.PageOutput
Built site for language nn:
```
Which is pretty good.

8 years agotplimpl: Add test with failing partial
Bjørn Erik Pedersen [Sun, 2 Apr 2017 10:06:21 +0000 (12:06 +0200)]
tplimpl: Add test with failing partial

Main motivation to see that the containing template name is included in the error message name.

It is.

8 years agotpl: Rework to handle both text and HTML templates
Bjørn Erik Pedersen [Mon, 27 Mar 2017 18:43:49 +0000 (20:43 +0200)]
tpl: Rework to handle both text and HTML templates

Before this commit, Hugo used `html/template` for all Go templates.

While this is a fine choice for HTML and maybe also RSS feeds, it is painful for plain text formats such as CSV, JSON etc.

This commit fixes that by using the `IsPlainText` attribute on the output format to decide what to use.

A couple of notes:

* The above requires a nonambiguous template name to type mapping. I.e. `/layouts/_default/list.json` will only work if there is only one JSON output format, `/layouts/_default/list.mytype.json` will always work.
* Ambiguous types will fall back to HTML.
* Partials inherits the text vs HTML identificator of the container template. This also means that plain text templates can only include plain text partials.
* Shortcode templates are, by definition, currently HTML templates only.

Fixes #3221

8 years agovendor: Update cobra
Albert Nigmatzianov [Sat, 1 Apr 2017 18:17:42 +0000 (20:17 +0200)]
vendor: Update cobra

Really fix #2349
b7a672f didn't actually the issue.

8 years agomedia, output: Add CSV type and format
Bjørn Erik Pedersen [Sat, 1 Apr 2017 13:12:31 +0000 (15:12 +0200)]
media, output: Add CSV type and format

And make CSS correclty behave as plain text.

8 years agodocs: Fix typo/source link in firstname.club showcase addition
digitalcraftsman [Fri, 31 Mar 2017 20:49:09 +0000 (22:49 +0200)]
docs: Fix typo/source link in firstname.club showcase addition