mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-26 14:13:41 +00:00
8b5b558bb5
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 |
||
---|---|---|
.. | ||
testdata | ||
404_test.go | ||
alias.go | ||
alias_test.go | ||
author.go | ||
case_insensitive_test.go | ||
config.go | ||
config_test.go | ||
datafiles_test.go | ||
disableKinds_test.go | ||
embedded_shortcodes_test.go | ||
gitinfo.go | ||
handler_base.go | ||
handler_file.go | ||
handler_meta.go | ||
handler_page.go | ||
handler_test.go | ||
hugo_info.go | ||
hugo_sites.go | ||
hugo_sites_build.go | ||
hugo_sites_build_test.go | ||
media.go | ||
menu.go | ||
menu_old_test.go | ||
menu_test.go | ||
multilingual.go | ||
node_as_page_test.go | ||
page.go | ||
page_collections.go | ||
page_output.go | ||
page_paths.go | ||
page_paths_test.go | ||
page_permalink_test.go | ||
page_taxonomy_test.go | ||
page_test.go | ||
page_time_integration_test.go | ||
pageCache.go | ||
pageCache_test.go | ||
pageGroup.go | ||
pageGroup_test.go | ||
pageSort.go | ||
pageSort_test.go | ||
pagesPrevNext.go | ||
pagesPrevNext_test.go | ||
pagination.go | ||
pagination_test.go | ||
path_separators_test.go | ||
permalinks.go | ||
permalinks_test.go | ||
robotstxt_test.go | ||
rss_test.go | ||
scratch.go | ||
scratch_test.go | ||
shortcode.go | ||
shortcode_test.go | ||
shortcodeparser.go | ||
shortcodeparser_test.go | ||
site.go | ||
site_output.go | ||
site_output_test.go | ||
site_render.go | ||
site_test.go | ||
site_url_test.go | ||
siteJSONEncode_test.go | ||
sitemap.go | ||
sitemap_test.go | ||
taxonomy.go | ||
taxonomy_test.go | ||
template_engines_test.go | ||
template_test.go | ||
testhelpers_test.go | ||
translations.go |