hugo/hugolib
Bjørn Erik Pedersen c790029e1d
Consider root and current section's content type if set in front matter
This should allow for less duplication of templates. Before this commit it was possible to override the content page of a given page/section, but only one page at a time.

Full "template sets" can now be inherited by setting `type: blog` etc. in the section content page's front matter, and that type will be considered when looking for layouts for all pages in that section.

For nested sections, it will use consider both `type` set in the current section first, then `type` set in the first section below home, e.g. `/docs`.

This commit also adds a new Page method: `FirstSection`. This navigates up to the first section below home (e.g. `/docs`). For the home page it will return itself.

Fixes #4891
2018-06-30 13:10:04 +02:00
..
filesystems Add support for theme composition and inheritance 2018-06-10 23:55:20 +02:00
pagemeta
paths Add support for theme composition and inheritance 2018-06-10 23:55:20 +02:00
testdata
testsite/content
404_test.go
alias.go
alias_test.go Add support for theme composition and inheritance 2018-06-10 23:55:20 +02:00
author.go
case_insensitive_test.go Add support for theme composition and inheritance 2018-06-10 23:55:20 +02:00
config.go Add support for theme composition and inheritance 2018-06-10 23:55:20 +02:00
config_test.go Move the privacy config into a parent 2018-05-22 18:11:03 +02:00
datafiles_test.go Add support for theme composition and inheritance 2018-06-10 23:55:20 +02:00
disableKinds_test.go Add support for a content dir set per language 2018-04-02 08:06:21 +02:00
embedded_shortcodes_test.go tplimpl: Remove speakerdeck shortcode 2018-06-09 11:13:36 +02:00
embedded_templates_test.go tpl: Always load GA script over HTTPS 2018-06-09 23:47:44 +02:00
fileInfo.go Add support for a content dir set per language 2018-04-02 08:06:21 +02:00
gitinfo.go
hugo_info.go
hugo_info_test.go
hugo_sites.go Add support for theme composition and inheritance 2018-06-10 23:55:20 +02:00
hugo_sites_build.go Reset the "distinct error logger" on rebuilds 2018-06-05 10:45:24 +03:00
hugo_sites_build_failures_test.go
hugo_sites_build_test.go hugolib: Replace deprecated {Get,}ByPrefix with {Get,}Match 2018-06-15 09:03:56 +02:00
hugo_sites_multihost_test.go hugolib: Replace deprecated {Get,}ByPrefix with {Get,}Match 2018-06-15 09:03:56 +02:00
hugo_themes_test.go Add support for theme composition and inheritance 2018-06-10 23:55:20 +02:00
language_content_dir_test.go Add support for a content dir set per language 2018-04-02 08:06:21 +02:00
media.go
menu.go
menu_test.go Add support for a content dir set per language 2018-04-02 08:06:21 +02:00
multilingual.go Add support for theme composition and inheritance 2018-06-10 23:55:20 +02:00
orderedMap.go hugolib: Defer the unlock in orderedMap.Add 2018-04-22 21:32:05 +02:00
orderedMap_test.go hugolib: Process and render shortcodes in their order of appearance 2018-04-22 17:40:51 +02:00
page.go Consider root and current section's content type if set in front matter 2018-06-30 13:10:04 +02:00
page_bundler.go Add support for a content dir set per language 2018-04-02 08:06:21 +02:00
page_bundler_capture.go Add support for theme composition and inheritance 2018-06-10 23:55:20 +02:00
page_bundler_capture_test.go Add support for theme composition and inheritance 2018-06-10 23:55:20 +02:00
page_bundler_handlers.go Make .Content (almost) always available in shortcodes 2018-04-21 22:02:56 +02:00
page_bundler_test.go hugolib: Replace deprecated {Get,}ByPrefix with {Get,}Match 2018-06-15 09:03:56 +02:00
page_collections.go Add support for a content dir set per language 2018-04-02 08:06:21 +02:00
page_collections_test.go
page_output.go hugolib: Reset the global pages cache on server rebuilds 2018-06-13 12:00:30 +02:00
page_paths.go
page_paths_test.go
page_permalink_test.go
page_resource.go
page_taxonomy_test.go
page_test.go Fix .WordCount, .FuzzyWordCount, .ReadingTime when summary marker is set 2018-04-29 10:58:58 +02:00
page_time_integration_test.go
page_without_content.go Make .Content (almost) always available in shortcodes 2018-04-21 22:02:56 +02:00
pageCache.go
pageCache_test.go
pageGroup.go
pageGroup_test.go
pages_language_merge.go
pages_language_merge_test.go Add language merge support for Pages in resource.Resources 2018-04-19 16:23:00 +02:00
pages_related.go
pages_related_test.go
pageSort.go Make .Content (almost) always available in shortcodes 2018-04-21 22:02:56 +02:00
pageSort_test.go hugolib: Fix some shortcode vs .Content corner cases 2018-04-25 08:56:46 +02:00
pagesPrevNext.go
pagesPrevNext_test.go
pagination.go Add support for theme composition and inheritance 2018-06-10 23:55:20 +02:00
pagination_test.go hugolib: Fix possible .Content cut 2018-05-08 16:52:51 +02:00
path_separators_test.go
permalinker.go
permalinks.go
permalinks_test.go
prune_resources.go Add support for a content dir set per language 2018-04-02 08:06:21 +02:00
robotstxt_test.go
rss_test.go
scratch.go
scratch_test.go
shortcode.go hugolib: A little more on shortcode ordinal 2018-05-28 10:29:48 +02:00
shortcode_test.go Add support for theme composition and inheritance 2018-06-10 23:55:20 +02:00
shortcodeparser.go hugolib: Allow forward slash in shortcode names 2018-06-28 16:06:16 +02:00
shortcodeparser_test.go hugolib: Allow forward slash in shortcode names 2018-06-28 16:06:16 +02:00
site.go hugolib: Reset the global pages cache on server rebuilds 2018-06-13 12:00:30 +02:00
site_benchmark_test.go
site_output.go
site_output_test.go
site_render.go hugolib: Fix possible .Content cut 2018-05-08 16:52:51 +02:00
site_sections.go Consider root and current section's content type if set in front matter 2018-06-30 13:10:04 +02:00
site_sections_test.go Consider root and current section's content type if set in front matter 2018-06-30 13:10:04 +02:00
site_stats_test.go
site_test.go
site_url_test.go config: Add the foundation for GDPR privacy configuration 2018-05-21 00:41:42 +02:00
siteJSONEncode_test.go
sitemap.go
sitemap_test.go
taxonomy.go
taxonomy_test.go Add support for a content dir set per language 2018-04-02 08:06:21 +02:00
template_engines_test.go
template_test.go
testhelpers_test.go Add support for theme composition and inheritance 2018-06-10 23:55:20 +02:00
translations.go