Commit graph

96 commits

Author SHA1 Message Date
Ben Hollis 7bdf28a421 Fix ignoring layouts from the sitemap when the source directory has been set to something other than 'source'. Fixes #896. 2013-05-30 20:17:58 -07:00
Jonathan Allard 56f16c2488 Fix #823-2 to allow only one extension on localized views
Make Sitemap::Store#strip_away_locale actually do something
2013-05-30 13:37:31 -04:00
Ben Hollis e03ef4226a Cache the filtered resource list to avoid calling Resource#ignored? a ton 2013-05-26 16:38:28 -07:00
Ben Hollis 5970333ca2 Fixups for localizable files 2013-05-02 22:03:28 -07:00
Ben Hollis d58acae939 Progress towards making localizable pages work 2013-05-02 21:17:50 -07:00
Jonathan Allard 23b6efbb06 Store#extensionless_path: Change implementation to make overrides easier 2013-05-02 19:14:59 -07:00
Ben Hollis 513e6dc2ad Attempt a fix for #837 2013-04-30 19:52:33 -07:00
Thomas Reynolds a0445e405a Allow frontmatter renderer_options key to overwrite renderer options on a per-file basis. closes #859 2013-04-11 10:13:36 -07:00
Ben Hollis fdd52cd640 Remove global access to the rack env and response 2013-04-09 23:06:10 -07:00
Ben Hollis 7a4aa109a6 Overhaul content-type handling, making it configurable via page/proxy commands as well as frontmatter with the 'content_type' parameter.
Now, users can set content type explicitly for their files in a number of ways, or rely on automatic file-extension content types. Proxied files default to automatic file-extension content types, but then fall back to the content type of the resource they proxy to. There is also a bug fixed around correctly setting content type inside send_file. Fixes #821.
2013-04-06 15:11:25 -07:00
Ben Hollis 4d5c509688 Fix several issues around i18n and resource metadata.
There are a few things changing here. One is that we always dup metadata before using it - this prevents a class of nasty bugs where after the first resource list build, blocks had been deleted from metadata hashes, meaning they would no longer be applied. Now they will always stick around. Then, I made sure that whenever we render a file, we save the previous I18n.locale and restore it afterwards, in case people change locale from blocks. This should help in some weird cases where files are rendered recursively. Finally, I've added a :lang option that can be used from "page" or "proxy" to allow people to specify the language for one or more files without having to pass a block that sets I18n.locale directly, which should make that pattern much cleaner. This fixes #809 and may also fix middleman/middleman-blog#106.
2013-04-03 00:07:31 -07:00
Ryunosuke SATO 3de491981a Fix method comments
`rake doc` shows some warnings.
I fixed method comments to suppress it.
2013-03-29 03:15:33 +09:00
Ben Hollis 52c4677391 Merge remote-tracking branch 'origin/3.0-stable'
Conflicts:
	middleman-core/lib/middleman-core/core_extensions/data.rb
	middleman-core/lib/middleman-core/core_extensions/front_matter.rb
	middleman-core/lib/middleman-core/util.rb
	middleman-core/middleman-core-x86-mingw32.gemspec
	middleman-more/lib/middleman-more/core_extensions/default_helpers.rb
	middleman-more/lib/middleman-more/core_extensions/i18n.rb
2013-02-10 15:41:36 -08:00
Ben Hollis 923697b517 Micro-optimizations around string comparisons 2013-02-09 15:21:52 -08:00
Ben Hollis 16b3a729cd Serve extensionless files or dotfiles with text/plain MIME type, and remove Sitemap::Resource#mime_type. 2013-01-17 19:40:39 -08:00
Thomas Reynolds a76b02a55b Don't look for frontmatter on binary files. Fixes #728 2013-01-11 17:25:45 -08:00
Thomas Reynolds 2e2516b95a Don't look for frontmatter on binary files. Fixes #728 2013-01-11 16:58:02 -08:00
Thomas Reynolds e82aa6cc61 make blksize work on windows. 2013-01-09 09:49:23 -08:00
Thomas Reynolds fbb2a355d7 Copy binary files instead of rendering through MM. Closes #643. Closes #699 2012-12-30 20:44:29 -08:00
Thomas Reynolds 6253c91610 Allow non-templates to have frontmatter. Closes #698 2012-12-30 20:40:20 -08:00
Thomas Reynolds 4eca29866b Copy binary files instead of rendering through MM. Closes #643. Closes #699 2012-12-30 20:37:40 -08:00
Thomas Reynolds e97d0ad0e4 Allow non-templates to have frontmatter. Closes #698 2012-12-30 20:29:39 -08:00
Thomas Reynolds 45ddc0c344 Make Sitemap metadata queryable with arel-style API 2012-12-25 16:05:54 -08:00
Ben Hollis bb12e2a0d4 Make Sitemap::Store more thread-safe. 2012-10-22 22:22:54 -07:00
Ben Hollis c40102cf53 Make Sitemap::Store more thread-safe. 2012-10-20 21:19:13 -07:00
Thomas Reynolds af81b588d5 Merge pull request #620 from bhollis/config
Move config settings into a separate object
2012-10-14 12:52:19 -07:00
Ben Hollis 4fe22e3fb5 Move more things over to new configs. Don't let root be configured 2012-10-13 22:37:24 -07:00
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