hugo/hugolib
Bjørn Erik Pedersen 3eb313fef4 Simplify .Site.GetPage etc.
This commit is a follow up to a recent overhaul of the GetPage/ref/relref implemenation.

The most important change in this commit is the update to `.Site.GetPage`:

* To reduce the amount of breakage in the wild to its minimum, I have reworked .Site.GetPage with some rules:

* We cannot support more than 2 arguments, i.e. .Site.GetPage "page" "posts" "mypage.md" will now throw an error. I think this is the most uncommon syntax and should be OK. It is an easy fix to change the above to .Site.GetPage "/posts/mypage.md" or similar.
* .Site.GetPage "home", .Site.GetPage "home" "" and .Site.GetPage "home" "/" will give you the home page. This means that if you have page in root with the name home.md you need to do .Site.GetPage "/home.md" or similar

This commit also fixes some multilingual issues, most notable it is now possible to do cross-language ref/relref lookups by prepending the language code to the path, e.g. `/jp/posts/mypage.md`.

This commit also reverts the site building tests related to this to "Hugo 0.44 state", to get better control of the changes made.

Closes #4147
Closes #4727
Closes #4728
Closes #4728
Closes #4726
Closes #4652
2018-07-18 00:07:20 +02:00
..
filesystems hugolib: Fix static filesystem for themed multihost sites 2018-07-12 12:18:56 +02:00
pagemeta Refactor the GitInfo into the date handlers 2018-03-11 21:32:05 +01:00
paths Add Hugo Piper with SCSS support and much more 2018-07-06 11:46:12 +02:00
testdata hugolib: Add test for image processing from shortcodes 2018-01-01 12:11:36 +01:00
testsite/content Refactor the GitInfo into the date handlers 2018-03-11 21:32:05 +01:00
404_test.go Spring test cleaning, take 2 2018-03-18 09:54:32 +01:00
alias.go Add Hugo Piper with SCSS support and much more 2018-07-06 11:46:12 +02:00
alias_test.go Add Hugo Piper with SCSS support and much more 2018-07-06 11:46:12 +02:00
author.go Revert the "standardize author data" 2016-09-18 19:16:39 +02:00
case_insensitive_test.go Add support for theme composition and inheritance 2018-06-10 23:55:20 +02:00
config.go hugolib: Only set 'allThemes' if there are themes in the config file 2018-07-15 16:13:48 +02:00
config_test.go hugolib: Only set 'allThemes' if there are themes in the config file 2018-07-15 16:13:48 +02:00
datafiles_test.go Add support for theme composition and inheritance 2018-06-10 23:55:20 +02:00
disableKinds_test.go Simplify .Site.GetPage etc. 2018-07-18 00:07:20 +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 Refactor the GitInfo into the date handlers 2018-03-11 21:32:05 +01:00
hugo_info.go Make ge, le etc. work with the Hugo Version number 2018-02-22 09:15:12 +01:00
hugo_info_test.go Make ge, le etc. work with the Hugo Version number 2018-02-22 09:15:12 +01:00
hugo_sites.go Add Hugo Piper with SCSS support and much more 2018-07-06 11:46:12 +02:00
hugo_sites_build.go Flush partialCached cache on rebuilds 2018-07-11 20:40:04 +02:00
hugo_sites_build_failures_test.go hugolib: Fix freeze in invalid front matter error case 2018-03-24 10:06:58 +01:00
hugo_sites_build_test.go Simplify .Site.GetPage etc. 2018-07-18 00:07:20 +02:00
hugo_sites_multihost_test.go Simplify .Site.GetPage etc. 2018-07-18 00:07:20 +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 Simplify .Site.GetPage etc. 2018-07-18 00:07:20 +02:00
media.go Fix copyright headers in source files 2015-12-07 19:57:01 +01:00
menu.go hugolib: Remove unused code 2018-01-25 17:14:03 +01:00
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 Simplify .Site.GetPage etc. 2018-07-18 00:07:20 +02:00
page_bundler.go Add Hugo Piper with SCSS support and much more 2018-07-06 11:46:12 +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 Hugo Piper with SCSS support and much more 2018-07-06 11:46:12 +02:00
page_bundler_handlers.go Add Hugo Piper with SCSS support and much more 2018-07-06 11:46:12 +02:00
page_bundler_test.go Simplify .Site.GetPage etc. 2018-07-18 00:07:20 +02:00
page_collections.go Simplify .Site.GetPage etc. 2018-07-18 00:07:20 +02:00
page_collections_test.go Simplify .Site.GetPage etc. 2018-07-18 00:07:20 +02:00
page_output.go media: Allow multiple file suffixes per media type 2018-07-10 22:13:52 +02:00
page_paths.go media: Allow multiple file suffixes per media type 2018-07-10 22:13:52 +02:00
page_paths_test.go media: Allow multiple file suffixes per media type 2018-07-10 22:13:52 +02:00
page_permalink_test.go all: Update import paths to gohugoio/hugo 2017-06-13 18:42:45 +02:00
page_resource.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
page_taxonomy_test.go hugolib: Do not tolower result from Page.GetParam 2017-12-29 08:58:38 +01:00
page_test.go Add a newScratch template func 2018-07-06 17:51:38 +02:00
page_time_integration_test.go all: Update textual references in Go source to point to gohugoio/hugo 2017-06-13 18:47:17 +02:00
page_without_content.go Make .Content (almost) always available in shortcodes 2018-04-21 22:02:56 +02:00
pageCache.go Add a way to merge pages by language 2018-03-16 10:10:01 +01:00
pageCache_test.go Add a way to merge pages by language 2018-03-16 10:10:01 +01:00
pageGroup.go hugolib: Do not tolower result from Page.GetParam 2017-12-29 08:58:38 +01:00
pageGroup_test.go resource: Add front matter metadata to Resource 2018-01-17 16:22:33 +01:00
pages_language_merge.go Add a way to merge pages by language 2018-03-16 10:10:01 +01:00
pages_language_merge_test.go Simplify .Site.GetPage etc. 2018-07-18 00:07:20 +02:00
pages_related.go hugolib: Fix typo in aquired 2017-09-07 16:21:33 +02:00
pages_related_test.go resource: Add front matter metadata to Resource 2018-01-17 16:22:33 +01:00
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 hugolib: Simplify Prev/Next 2018-03-12 22:13:25 +01:00
pagesPrevNext_test.go all: Refactor to nonglobal Viper, i18n etc. 2017-02-17 17:15:26 +01:00
pagination.go Add Hugo Piper with SCSS support and much more 2018-07-06 11:46:12 +02:00
pagination_test.go media: Allow multiple file suffixes per media type 2018-07-10 22:13:52 +02:00
path_separators_test.go hugolib, output: Incorporate suffix and type in layout resolve 2017-03-27 15:43:56 +02:00
permalinker.go hugolib: Add optional outputFormat to Ref/RelRef 2017-04-04 23:09:01 +02:00
permalinks.go resource: Add front matter metadata to Resource 2018-01-17 16:22:33 +01:00
permalinks_test.go all: Refactor to nonglobal Viper, i18n etc. 2017-02-17 17:15:26 +01:00
prune_resources.go Add Hugo Piper with SCSS support and much more 2018-07-06 11:46:12 +02:00
resource_chain_test.go resource: Fix resources.Concat for transformed resources 2018-07-12 19:36:12 +02:00
robotstxt_test.go Spring test cleaning, take 2 2018-03-18 09:54:32 +01:00
rss_test.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
shortcode.go media: Allow multiple file suffixes per media type 2018-07-10 22:13:52 +02:00
shortcode_test.go Simplify .Site.GetPage etc. 2018-07-18 00:07: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 Simplify .Site.GetPage etc. 2018-07-18 00:07:20 +02:00
site_benchmark_test.go Add a GetPage to the site benchmarks 2018-01-24 09:08:26 +01:00
site_output.go Allow partial redefinition of the ouputs config 2018-03-10 16:57:25 +01:00
site_output_test.go Simplify .Site.GetPage etc. 2018-07-18 00:07:20 +02:00
site_render.go media: Allow multiple file suffixes per media type 2018-07-10 22:13:52 +02:00
site_sections.go Revert "Consider root and current section's content type if set in front matter" 2018-07-09 10:29:18 +02:00
site_sections_test.go Simplify .Site.GetPage etc. 2018-07-18 00:07:20 +02:00
site_stats_test.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
site_test.go Simplify .Site.GetPage etc. 2018-07-18 00:07:20 +02:00
site_url_test.go Simplify .Site.GetPage etc. 2018-07-18 00:07:20 +02:00
siteJSONEncode_test.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
sitemap.go hugolib: Fix some more Golint warnings 2016-03-23 10:10:28 +01:00
sitemap_test.go all: Update import paths to gohugoio/hugo 2017-06-13 18:42:45 +02:00
taxonomy.go resource: Add front matter metadata to Resource 2018-01-17 16:22:33 +01:00
taxonomy_test.go Simplify .Site.GetPage etc. 2018-07-18 00:07:20 +02:00
template_engines_test.go Fix broken shortcodes for Ace and Amber 2017-11-18 10:41:31 +01:00
template_test.go hugolib: Add additional test to TestTemplateLookupOrder 2018-02-05 08:38:04 +01:00
testhelpers_test.go Add Hugo Piper with SCSS support and much more 2018-07-06 11:46:12 +02:00
translations.go hugolib: Fix .IsTranslated with identical filenames 2017-11-17 19:46:32 +01:00