Commit graph

219 commits

Author SHA1 Message Date
Ben Hollis 862551c523 Upgrade proxy to be able to take :locals and understand :ignore, and store proxy options and metadata with the proxy list.
This allows users to use proxy directly instead of page to create dynamic pages, and improves performance of dynamic pages for sites that create many proxies. It also allows people to use locals instead of instance variables, which are better for partials and reduce the risk of overwriting Middleman settings.
2012-10-13 14:03:32 -07:00
Ben Hollis 1ee89ac6bf Upgrade proxy to be able to take :locals and understand :ignore, and store proxy options and metadata with the proxy list.
This allows users to use proxy directly instead of page to create dynamic pages, and improves performance of dynamic pages for sites that create many proxies. It also allows people to use locals instead of instance variables, which are better for partials and reduce the risk of overwriting Middleman settings.
2012-10-12 19:46:11 -07:00
Ben Hollis 6c241603ac Delay recalculating sitemap until absolutely necessary, avoiding redundant recalculations. 2012-09-16 19:36:47 -07:00
Thomas Reynolds 446aa6a4ba Clean up whitespace, play with cane for testing style quality and code complexity 2012-08-13 15:41:07 -07:00
Thomas Reynolds 80e36b7c53 Given file-based metadata precedence over config/path metadata. Fixes #552 2012-07-29 10:22:57 -07:00
Tim Bates 99a8723ea6 Fix instance variables in dynamic pages 2012-07-24 23:02:27 +09:30
Ben Hollis 62fa17cf1a Reduce work converting paths from relative to absolute and back again 2012-07-19 01:18:55 -07:00
Thomas Reynolds de6d7980ac Use centralized Logger and add instrument methods 2012-07-18 09:30:39 -07:00
Tim Bates 0fa1bfe675 Tests and a small bug fix to make them pass 2012-07-13 16:00:53 +09:30
Tim Bates 3cbda0ee36 Added strip_index_file option for configuring urls 2012-07-13 10:57:05 +09:30
Tim Bates 692aa10c8b Add trailing_slash option for prettier urls
"set :trailing_slash, false" will cause resource urls that match the
index_file to have the trailing slash stripped off the directory URL,
e.g. instead of "/dir/index.html" becoming "/dir/" it will be "/dir"
2012-07-12 12:03:33 +09:30
Tim Bates d30f883e48 Regenerate @_lookup_cache after each manipulation
Trying to call Resource#metadata from within
MyExtension#manipulate_resource_list generates an exception in
Proxies::ResourceInstanceMethods#get_source_file because @_lookup_cache
is empty. Moving the recalculation inside the loop means regenerating
the cache after each manipulation but allows extensions to examine the
page metadata when manipulating proxied resources.
2012-07-11 15:16:18 +09:30
Tim Bates ffecc3e4cc Optimisation, Hash#delete returns the deleted item 2012-07-11 15:14:08 +09:30
Ben Hollis 12c551228f Don't allow people to proxy a path to itself, or to another proxy. 2012-07-08 15:30:02 -07:00
Ben Hollis 6ac263619a Make :http_prefix work in link_to and asset helpers as long as the linked item is a sitemap resource. Fixes #484. 2012-06-23 17:19:24 -07:00
Thomas Reynolds c3796a9161 :automatic_directory_matcher optionally converts a character sequence in file names into a subdirectory. Closes #491 2012-06-19 20:07:50 -07:00
Thomas Reynolds b02ee61639 Weird block scoping issue in old Ruby 2012-05-28 14:09:43 -07:00
Thomas Reynolds 8d483f882c Move Sprockets into an extension 2012-05-26 13:43:27 -07:00
Thomas Reynolds 2c058ee3de Couple of fixes, specifically an issue with frontmatter layout setting 2012-05-22 19:11:54 -07:00
Ben Hollis c775a9973c Handle relative path urls in link_to, and add an option to produce relative links as well. Or, set :relative_links in config.rb to turn on relative links for all link_to calls. 2012-05-19 19:24:37 -07:00
Thomas Reynolds 7929ed6c75 Refactor Frontmatter to use sitemap manipulators. Also fixes #422 2012-05-08 21:10:41 -07:00
Thomas Reynolds d55fef62b4 Remove usage of autoload statement in favor of require 2012-05-07 14:41:39 -07:00
Thomas Reynolds 2965e3709d Yard doc cleanup 2012-05-02 11:13:48 -07:00
Thomas Reynolds 3d129b8523 Merge pull request #409 from bhollis/metadata
Add Resource#add_metadata for attaching metadata directly to a resource
2012-04-29 23:08:28 -07:00
Ben Hollis bc435cc2e2 Add Resource#add_metadata for attaching metadata directly to a resource 2012-04-29 22:32:52 -07:00
Ben Hollis dee0e616ad Index frontmatter off source_file, allowing us to get rid of Resource#relative_path 2012-04-29 18:51:00 -07:00
Thomas Reynolds 1d583caf40 Merge pull request #381 from bhollis/speedup
Two speedups
2012-04-24 09:57:19 -07:00
Ben Hollis ecf56d8e55 Cache Resource#metadata 2012-04-24 00:22:19 -07:00
Ben Hollis 35037957a6 Get rid of some extraneous sitemap refreshes 2012-04-24 00:22:10 -07:00
Thomas Reynolds 83178031d2 Merge pull request #371 from bhollis/speedup
Speed up builds
2012-04-23 10:29:06 -07:00
Thomas Reynolds 5405af5e0f Merge pull request #372 from bhollis/timing
Add timing info to render logging, and document why we use thin instead of webrick
2012-04-23 10:27:04 -07:00
Ben Hollis c560a0d20e Add timing info to render logging, and document why we use thin instead of webrick 2012-04-23 01:24:16 -07:00
Ben Hollis ab77cb2f34 Add an "origin" parameter to provides_metadata to allow for replacing metadata callbacks rather than always appending 2012-04-23 01:17:24 -07:00
Ben Hollis 9be76da3cf Simplify populating the sitemap lookup cache 2012-04-20 21:59:20 -07:00
Thomas Reynolds b97f681ef1 Move file extension methods up a level 2012-04-19 15:47:47 -07:00
Ben Hollis a0712224c6 Ignore unnecessary ignores and use destination_path in url 2012-04-17 23:55:28 -07:00
Ben Hollis 50b797e0be Get asset_hash working after the sitemap refactor. Part of this required changing the behavior of the OnDisk Sitemap extension to rebuild the sitemap every time a file is touched, instead of just when files are added (even if the file being touched is ignored by the sitemap, like a partial!). This is because asset_hash needs to recalculate hashes whenever any file changes, since partials can affect the output of other files. 2012-04-17 01:05:28 -07:00
Thomas Reynolds d2d40079cc Rename Middleman::Base to Middleman::Application 2012-04-14 14:04:10 -07:00
Thomas Reynolds 0bc35db4a6 move util methods into their own namespace 2012-04-14 13:36:24 -07:00
Thomas Reynolds d935aedd59 Sitemap refactor 2012-04-14 13:17:42 -07:00
Ben Hollis fc79459e61 Fix the asset_hash extension to operate on the hash of the rendered output rather than just the source file. This prevents generating the same hash for a file when partials it uses change, or if a helper it uses produces different output. As part of this change I removed the caching from Sitemap::Page#destination_path and asset_hash since they were preventing recalculation of path/hash when partials changed, and I rewrote the Sprockets extension to expose the Sprockets environment to other extension, which included consolidating the JS and CSS Sprockets environments into one. 2012-04-04 00:00:33 -07:00
Ben Hollis 4a4454fcab Introduce a cache tied to individual sitemap pages. This helps individual extensions avoid having to implement methods to clear the cache whenever a page changes. 2012-04-01 20:37:24 -07:00
Thomas Reynolds 183e9d68f3 Implied extensions. Closes #304 2012-03-29 18:34:25 +01:00
Thomas Reynolds e769477e93 Implied extensions. Closes #304 2012-03-29 18:22:43 +01:00
Ben Hollis b2f6d0db09 Get rid of some unused stuff in sitemap and complete documentation 2012-03-26 21:40:30 -07:00
Ben Hollis 92713dfe92 Make frontmatter always return a hash, and freeze it. This reduces the need for nil checks and prevents users from accidentally trying to modify frontmatter data which may be cached elsewhere. 2012-03-25 12:53:45 -07:00
Ben Hollis 086f05989b Fix ignore with a regex (with a test) and consolidate ignores into a single list of callbacks. 2012-03-24 20:45:17 -07:00
Ben Hollis 73350d6d05 Don't let people (or messed up code) accidentally create sitemap pages through the page method 2012-03-15 00:28:51 -07:00
Thomas Reynolds bba2584c81 Merge pull request #308 from bhollis/master
Test showing variables not getting passed to templates during build
2012-03-12 10:14:00 -07:00
Ben Hollis de92015085 Fix usage of a 1.9-only method in Sitemap::Page 2012-03-11 23:41:48 -07:00
Ben Hollis c6c3021593 Fix issue #302 2012-03-11 23:33:46 -07:00
Ben Hollis 627b6c1462 A url helper that strips directory indexes 2012-03-04 23:26:30 -08:00
Thomas Reynolds 5842bf8e5b allow extensionless files to be previewed and built. fixes #270, but requires alternative layouts be placed in a layouts/ directory now. 2012-02-12 11:45:42 -08:00
Ben Hollis 39046ce029 Remove unused methods from Sitemap::Store. If these end up being needed again it'd be better to just filter the #pages list. 2012-02-10 23:36:06 -08:00
Ben Hollis d483d8bc54 Memoize Sitemap::Page#destination_path 2012-02-09 09:39:24 -08:00
Ben Hollis fdbd301a32 Get rid of Middleman::Sitemap::Store#all_paths and #each in favor of #pages. Dealing with page objects all over the place instead of paths provides a lot of opportunities for cleaner code. 2012-02-08 23:00:29 -08:00
Ben Hollis e136fab77c Use a page_by_destination lookup to make rerouting work both ways, in build and during preview server. 2012-02-04 23:07:02 -08:00
Ben Hollis e27e0cdd44 Directory indexes work completely now, in preview and with dotfiles. 2012-02-03 00:29:07 -08:00
Ben Hollis ca1f3ddf83 Directory indexes now work during build, with the exception of .htaccess files. 2012-02-02 21:47:54 -08:00
Ben Hollis 4ce6913baf The beginnings of refactoring page rerouting. Added methods to Sitemap::Store and Sitemap::Page to collect and execute reroute callbacks, and rework builder to use page methods (simplifying it greatly in the process). All tests that don't involve directory indexes pass - next step is to make the directory index extension register its callbacks with Sitemap::Store#reroute. 2012-01-31 23:43:05 -08:00
Ben Hollis a41bf57f2d Clarify in the documentation what "path" means for Sitemap::Store and Sitemap::Page 2012-01-31 22:57:55 -08:00
Ben Hollis 2eec7e11ba Refactor protected method normalize_path out of Sitemap::Store 2012-01-31 22:38:39 -08:00
Ben Hollis 1fc97d9d7b A minor simplification of Sitemap::Store#path - it can no longer take a block 2012-01-31 22:15:45 -08:00
Eric Skogen 071acadb93 clarify the documentation regarding a page's "eponymous" directory 2012-01-16 16:29:02 -06:00
Thomas Reynolds e3b15366cb ignore globs, mostly working, except with directory indexes 2012-01-14 14:09:20 -08:00
Thomas Reynolds 0ac9c0b662 document sitemap, make ignore accept paths, regexps and blocks 2012-01-07 16:57:50 -08:00
Thomas Reynolds 92319ebffc support glob page instance vars. fixes #230 2012-01-05 21:18:55 -08:00
Thomas Reynolds 4ff52141df port guard vendored libs 2012-01-02 14:22:24 -08:00
Thomas Reynolds c8a134a386 split into middleman-core and middleman-more 2011-12-29 15:09:51 -08:00