mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
4f66f790b1
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 |
||
---|---|---|
.. | ||
author.go | ||
benchmark_test.go | ||
datafiles_test.go | ||
handler_base.go | ||
handler_file.go | ||
handler_meta.go | ||
handler_page.go | ||
handler_test.go | ||
hugo.go | ||
media.go | ||
menu.go | ||
menu_test.go | ||
node.go | ||
node_test.go | ||
page.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 | ||
path_separators_windows_test.go | ||
permalinks.go | ||
permalinks_test.go | ||
planner.go | ||
redis.cn.md | ||
robotstxt_test.go | ||
rss_test.go | ||
scratch.go | ||
scratch_test.go | ||
shortcode.go | ||
shortcode_test.go | ||
shortcodeparser.go | ||
shortcodeparser_test.go | ||
site.go | ||
site_show_plan_test.go | ||
site_test.go | ||
site_url_test.go | ||
siteinfo_test.go | ||
siteJSONEncode_test.go | ||
sitemap.go | ||
sitemap_test.go | ||
summary.go | ||
taxonomy.go | ||
taxonomy_test.go |