hugo/hugolib
Bjørn Erik Pedersen 4f66f790b1 Add readFile template func
This also includes a refactor of the hugofs package and its usage.

The motivation for that is:

The Afero filesystems are brilliant. Hugo's way of adding a dozen of global variables for the different filesystems was a mistake. In readFile (and also in some other places in Hugo today) we need a way to restrict the access inside the working dir. We could use ioutil.ReadFile and implement the path checking, checking the base path and the dots ("..") etc. But it is obviously better to use an Afero BasePathFs combined witha ReadOnlyFs. We could create a use-once-filesystem and handle the initialization ourselves, but since this is also useful to others and the initialization depends on some other global state (which would mean to create a new file system on every invocation), we might as well do it properly and encapsulate the predefined set of filesystems. This change also leads the way, if needed, to encapsulate the file systems in a struct, making it possible to have several file system sets in action at once (parallel multilanguage site building? With Moore's law and all...)

Fixes #1551
2016-03-31 21:24:18 +02:00
..
author.go Fix copyright headers in source files 2015-12-07 19:57:01 +01:00
benchmark_test.go Add copyright header to that source files that don’t have one. 2015-12-10 15:19:38 -07:00
datafiles_test.go Add copyright header to that source files that don’t have one. 2015-12-10 15:19:38 -07:00
handler_base.go Fix copyright headers in source files 2015-12-07 19:57:01 +01:00
handler_file.go Fix copyright headers in source files 2015-12-07 19:57:01 +01:00
handler_meta.go Fix copyright headers in source files 2015-12-07 19:57:01 +01:00
handler_page.go hugolib: Remove unused Tmpl on Page 2016-03-24 18:34:41 +01:00
handler_test.go Add readFile template func 2016-03-31 21:24:18 +02:00
hugo.go Add copyright header to that source files that don’t have one. 2015-12-10 15:19:38 -07:00
media.go Fix copyright headers in source files 2015-12-07 19:57:01 +01:00
menu.go Spring cleaning of the menu code 2016-03-23 00:29:39 +01:00
menu_test.go Add readFile template func 2016-03-31 21:24:18 +02:00
node.go Fix copyright headers in source files 2015-12-07 19:57:01 +01:00
node_test.go Add Node tests for simple methods 2016-02-07 13:18:16 +01:00
page.go Add readFile template func 2016-03-31 21:24:18 +02:00
page_permalink_test.go Add copyright header to that source files that don’t have one. 2015-12-10 15:19:38 -07:00
page_taxonomy_test.go hugolib: Fix some more Golint warnings 2016-03-23 10:10:28 +01:00
page_test.go hugolib: Even more Golint fixes 2016-03-24 14:42:03 +01:00
page_time_integration_test.go hugoblib: Clean up the time tests 2016-03-24 13:30:08 +01:00
pageCache.go Apply gofmt -s 2016-02-06 13:09:52 +01:00
pageCache_test.go hugolib: Some more GoLint fixes 2016-03-24 14:11:04 +01:00
pageGroup.go hugolib: Some more unexports 2016-03-25 03:12:31 +01:00
pageGroup_test.go Add copyright header to that source files that don’t have one. 2015-12-10 15:19:38 -07:00
pageSort.go hugolib: Some more unexports 2016-03-25 03:12:31 +01:00
pageSort_test.go Remove Printf in test 2016-02-06 22:19:58 +01:00
pagesPrevNext.go Fix copyright headers in source files 2015-12-07 19:57:01 +01:00
pagesPrevNext_test.go hugolib: Remove unused code 2016-03-14 15:41:03 +01:00
pagination.go hugolib: Add missing GoDoc in pagination.go 2016-03-24 14:18:47 +01:00
pagination_test.go Add copyright header to that source files that don’t have one. 2015-12-10 15:19:38 -07:00
path_separators_test.go Add copyright header to that source files that don’t have one. 2015-12-10 15:19:38 -07:00
path_separators_windows_test.go Add copyright header to that source files that don’t have one. 2015-12-10 15:19:38 -07:00
permalinks.go hugolib: Some more unexports 2016-03-25 03:12:31 +01:00
permalinks_test.go hugolib: Some more unexports 2016-03-25 03:12:31 +01:00
planner.go Unexport the target handlers 2016-03-05 20:56:38 +01:00
redis.cn.md [Docs] Copyediting 2015-01-28 18:02:40 -07:00
robotstxt_test.go Add readFile template func 2016-03-31 21:24:18 +02:00
rss_test.go Add readFile template func 2016-03-31 21:24:18 +02:00
scratch.go Do not use defer for unlocking in Scratch 2016-03-24 16:03:31 +01:00
scratch_test.go Be explicit about the type in Scratch test 2016-03-24 19:57:26 +01:00
shortcode.go hugolib: Some more GoLint fixes 2016-03-24 14:11:04 +01:00
shortcode_test.go Add readFile template func 2016-03-31 21:24:18 +02:00
shortcodeparser.go Fix copyright headers in source files 2015-12-07 19:57:01 +01:00
shortcodeparser_test.go Add copyright header to that source files that don’t have one. 2015-12-10 15:19:38 -07:00
site.go Add readFile template func 2016-03-31 21:24:18 +02:00
site_show_plan_test.go hugolib: Even more Golint fixes 2016-03-24 14:42:03 +01:00
site_test.go Add readFile template func 2016-03-31 21:24:18 +02:00
site_url_test.go Add readFile template func 2016-03-31 21:24:18 +02:00
siteinfo_test.go hugolib: Some more GoLint fixes 2016-03-24 14:11:04 +01:00
siteJSONEncode_test.go hugolib: Fix Java-styled all-caps consts 2016-03-22 23:59:07 +01:00
sitemap.go hugolib: Fix some more Golint warnings 2016-03-23 10:10:28 +01:00
sitemap_test.go Add readFile template func 2016-03-31 21:24:18 +02:00
summary.go Add copyright header to that source files that don’t have one. 2015-12-10 15:19:38 -07:00
taxonomy.go hugolib: Taxonomy GoDoc cleanup 2016-03-24 16:01:25 +01:00
taxonomy_test.go hugolib: Fix some more Golint warnings 2016-03-23 10:10:28 +01:00