Commit Graph
5719 Commits
Author SHA1 Message Date
Bjørn Erik Pedersen c9aee467d3 output: Add output formats decoder
And clean up the output package.
2017-04-04 15:12:30 +02:00
Bjørn Erik Pedersen d6e8b86f66 output: Add CSV to the global output formats list 2017-04-04 15:12:30 +02:00
Ryan Watters 2cf2b4832e Add language-hugo Atom plugin to dev-tools editors 2017-04-03 13:44:38 -05:00
Ryan Watters dba7e38a74 Add embedded SVGs example to dict function 2017-04-03 11:00:06 -05:00
Ryan Watters af3230aa5b Fix typos and add explanation on configuration.md 2017-04-03 10:34:58 -05:00
Ryan Watters 77647be7ff Expand static dir explanation in dir structure 2017-04-03 10:16:25 -05:00
Albert Nigmatzianov a098081c4a vendor: Update go-i18n 2017-04-03 08:34:12 +02:00
Kamil Samigullin 706c2d512e docs: Remove localhost part from link
Fixes #3264
2017-04-03 01:29:53 +02:00
Kamil Samigullin 5d7eeeadf0 docs: Remove localhost part from link
Fixes #3264
2017-04-03 01:29:53 +02:00
Bjørn Erik Pedersen 8b5b558bb5 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
2017-04-02 23:13:10 +02:00
Ryan Watters 53eee8a4cc Update Mmark info to show ease of use with MathJax and KaTeX 2017-04-02 15:25:02 -05:00
Ryan Watters b3819aa003 Add esaezgil.com to showcase 2017-04-02 15:07:35 -05:00
Albert Nigmatzianov bc701e075d docs, examples: Use TOML for i18n config files
Fix #3200
2017-04-02 18:43:32 +02:00
Albert Nigmatzianov 27610ddd01 hugolib: Don't ignore errors from applyDepsIfNeeded 2017-04-02 18:43:32 +02:00
Albert Nigmatzianov 6b29bccfee hugolib, i18n: Update tests with flat format and TOML files 2017-04-02 18:43:32 +02:00
Albert Nigmatzianov 28fdd71c29 vendor: Update go-i18n
Fix #2577
2017-04-02 18:43:32 +02:00
Albert Nigmatzianov fe8462b205 docs, examples: Use TOML for i18n config files
Fix #3200
2017-04-02 18:43:32 +02:00
Chase Adams d122260de7 vendor: update goorgeous 2017-04-02 18:34:17 +02:00
Enrique Saez 5e414819e3 docs: Add blog of Enrique Saez Gil to the site showcase 2017-04-02 18:29:24 +02:00
Enrique Saez a037b855dd docs: Add blog of Enrique Saez Gil to the site showcase 2017-04-02 18:29:24 +02:00
Bjørn Erik Pedersen 7eb71ee064 Revert "tpl: Rework to handle both text and HTML templates"
Will have to take another stab at this ...

This reverts commit 5c5efa03d2.

Closes #3260
2017-04-02 14:20:34 +02:00
Bjørn Erik Pedersen c97dae40d9 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.
2017-04-02 12:22:54 +02:00
Bjørn Erik Pedersen 0aeadfd02d tplimpl: Add test with failing partial
Main motivation to see that the containing template name is included in the error message name.

It is.
2017-04-02 12:06:21 +02:00
Bjørn Erik Pedersen 5c5efa03d2 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
2017-04-02 11:37:30 +02:00
Ryan Watters 631833e982 Add missing comma in Supported Content Formats page 2017-04-01 17:08:35 -05:00
Ryan Watters 561edc0c16 Add fm-specific Mmark syntax per bep suggestion 2017-04-01 15:34:22 -05:00
Ryan Watters 8d65b3605a Add fm-specific Mmark syntax per bep suggestion 2017-04-01 15:33:26 -05:00
Ryan Watters 484bbd1e3f Add fm-specific Mmark syntax per bep suggestion 2017-04-01 15:32:51 -05:00
Ryan Watters 3d7960e1ed Fix typos in Mmark section in content formats 2017-04-01 15:03:37 -05:00
Ryan Watters 969178b6c7 Fix typos in Mmark section in content formats 2017-04-01 15:01:39 -05:00
Ryan Watters 5a59b0fd19 Add Mmark section to content formats 2017-04-01 14:57:18 -05:00
Ryan Watters e491b309dc Add Mmark section to content formats 2017-04-01 14:56:40 -05:00
Albert Nigmatzianov 73c1c7b69d vendor: Update cobra
Really fix #2349
b7a672f didn't actually the issue.
2017-04-01 20:28:18 +02:00
Ryan Watters 67076e5838 Add example to "now" function
Closes rdwatters/hugo-docs-concept#63
2017-04-01 10:38:27 -05:00
Bjørn Erik Pedersen f911b107ef media, output: Add CSV type and format
And make CSS correclty behave as plain text.
2017-04-01 15:12:31 +02:00
Ryan Watters ab07457e4a Update with temp GA code 2017-04-01 01:00:06 -05:00
Ryan Watters d1709df3e8 Fix broken link at the bottom of shortcodes.md 2017-03-31 20:13:20 -05:00
Ryan Watters 904eaa8d9a Fix incorrect syntax decl in cm-shortcodes 2017-03-31 20:11:43 -05:00
Ryan Watters 7e3805b5d2 Fix odd formatting in cross-references 2017-03-31 20:09:14 -05:00
Ryan Watters 45aad24e66 Add note on Mmark with MathJax to formats doc 2017-03-31 19:53:13 -05:00
Ryan Watters d98cfe1059 Update nginx config in 404 templates 2017-03-31 19:46:21 -05:00
Ryan Watters fb94d4c933 Fix terms template lookup order 2017-03-31 19:33:59 -05:00
Ryan Watters 4d27a27bb8 Update broken links in customizing themes 2017-03-31 19:25:44 -05:00
Ryan Watters bf4015d693 Fix typos in vimeo sc description 2017-03-31 19:10:21 -05:00
Ryan Watters 001cd27c90 Clarify custom class to yt and vimeo shortcodes 2017-03-31 19:09:12 -05:00
Ryan Watters 0c770e40be Add warning to isset function for lowercase site config keys 2017-03-31 18:46:14 -05:00
Ryan Watters a649a7ae86 Add firstname.club to showcase 2017-03-31 18:24:23 -05:00
Ryan Watters 763dd22ce7 Remove how-to-use docs-page 2017-03-31 17:59:58 -05:00
Ryan Watters d2829694b3 Fix inconsistencies in FM categories 2017-03-31 17:58:14 -05:00
Ryan Watters 530002e6a2 Update GitHub deploy 2017-03-31 17:57:06 -05:00