Commit graph

67 commits

Author SHA1 Message Date
Thomas Reynolds 2f545cefbe Attempt to allow i18n to override partial lookup. #1333 2014-07-24 11:11:27 -07:00
Thomas Reynolds f0603ddf2f work with static partials. Closes #1206 2014-07-18 10:54:48 -07:00
Thomas Reynolds 72b945682a Fix threadsafety issue with assignment. Fixes #501. Also, WTF? 2014-05-24 19:18:12 +09:00
Thomas Reynolds 610716ee80 Work around possible mutable data issue #501 2014-05-22 19:20:43 +09:00
Ben Hollis dc33f6b3fa Fix before_render after change to hooks-0.4.0. Related to #1278. 2014-05-15 23:55:39 -07:00
bootstraponline 3f0373adf2 Fix after_render
Example usage from config.rb:

after_render do |content, path, locs, template_class|
  # restore character entities such as `
  content ||= ''
  content.gsub! '&', '&'
  content
end
2014-05-11 14:06:04 -04:00
Thomas Reynolds 8eabe4d354 rubocop 2: the reckoning 2014-04-29 10:44:24 -07:00
Thomas Reynolds 04dc48f13d Great rubocop-ing 2014-04-28 16:02:18 -07:00
Ben Hollis 477f87e98a Prefer loading layouts from layouts_dir over layouts with the same name in the source root. This also includes a bunch of refactoring/cleanup of rendering.rb. Fixes #1176. 2014-02-20 08:50:07 -08:00
Karl Freeman a31aa5d8be TrailingWhitespace 'cop' fix 2013-12-28 18:14:15 +00:00
Karl Freeman 03d6e6c990 Implemented Rubocop
- just took a stab at running the StringLiterals cop to get a taste.
2013-12-28 00:47:39 +00:00
Dan Allen 55d844f667 resolves #1043 added a renderer for AsciiDoc files 2013-10-17 00:49:53 -06:00
Linus Pettersson e77e615314 Fixed encoding for new buffer 2013-08-18 00:07:26 +02:00
Ben Hollis f92ae94728 Escape filenames in regexes. Fixes #942. 2013-08-15 22:04:18 -07:00
Thomas Reynolds 37752dc291 fix layouts with implied extensions 2013-06-24 13:39:14 -07:00
Thomas Reynolds 7d7d5e683e Set current_engine on the context, not self, since we dup self and use that for each render loop. Closes #860 2013-06-12 15:21:31 -07:00
Thomas Reynolds 69c36e691f use latest padrino 2013-06-04 09:56:33 -07:00
Thomas Reynolds d0cd3e3cf9 layouts_dir is now configurable. Closes #899 2013-06-01 15:25:44 -07:00
Thomas Reynolds c9d151ba66 The file watcher knows which files exist, so don't use slow File.exists?
Possible solution for #903
2013-05-22 17:38:01 -07:00
Thomas Reynolds 4964022998 rollback some versions 2013-05-03 11:24:05 -07:00
Thomas Reynolds ab2f37d2e6 make I18n optional in core 2013-04-22 22:09:33 -07:00
Thomas Reynolds 8a54645de5 bump padrino to 0.11.x 2013-04-22 22:07:35 -07:00
Thomas Reynolds 9af92fa7a3 Fix slim's complaints about extra render options (:layout) 2013-04-14 09:37:23 -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 f0449229a9 Unregister .csv from Tilt as well. Fixes #822. 2013-04-09 23:15:05 -07:00
Ben Hollis 283576af1a Refactor some trivial extensions back into application. 2013-04-09 23:06:10 -07:00
Artem Baguinski 91e7033d54 a first stab at partials_dir setting
re #252
2013-04-09 08:46:18 +02:00
Ben Hollis 397ccd2c1e Fix a bunch of Ruby warnings, including a bug in the not_found method 2013-04-06 14:56:08 -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
Thomas Reynolds f2f3ad21b6 bump tilt requirement, unregister plaintext template. fixes #824 2013-03-18 14:12:49 -07:00
Ben Hollis 659f063076 Include file extension in template cache. May fix #798 2013-03-14 23:21:58 -07:00
Ben Hollis 978b981e11 Merge remote-tracking branch 'origin/3.0-stable' 2013-02-10 17:05:18 -08:00
Ben Hollis 5a585dd3ab Copy/paste error 2013-02-10 17:04:53 -08: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 3bdbc11db2 Change the behavior of before_render and after_render hooks from #761.
This changes the before_render and after_render hooks so that the callbacks
given to them each get to modify the template source / the rendered output
in turn, instead of having to modify them in-place. It also changes the arguments
provided to the callbacks - now, they are given the source/output, the template path,
the locals hash, and the Tilt template *class*, wheras previously they were given the source/output
and the Tilt template *instance*. The locals hash is there in case pron case hooks want to
pay attention to the locals in some way. The before_render hook is also run before
compiling the template and caching it, which should prevent weird data mismatches
and save some template compilation effort.
2013-02-10 15:18:57 -08:00
Ben Hollis 923697b517 Micro-optimizations around string comparisons 2013-02-09 15:21:52 -08:00
Ben Hollis bb2f40cc72 Merge branch '3.0-stable'
Conflicts:
	README.md
2013-02-05 22:07:05 -08:00
Leon Bogaert cc988ee302 Added before_render & after_render hook
Can be used for pre-processing content
2013-01-31 23:04:49 +01:00
Ben Hollis c0c14f4eab Merge remote-tracking branch 'origin/3.0-stable'
Conflicts:
	CHANGELOG.md
	middleman-core/lib/middleman-core/cli/build.rb
	middleman-core/lib/middleman-core/core_extensions/rendering.rb
	middleman-core/lib/middleman-core/preview_server.rb
	middleman-core/lib/middleman-core/renderers/sass.rb
	middleman-core/lib/middleman-core/sitemap/store.rb
	middleman-core/lib/middleman-core/util.rb
	middleman-core/lib/middleman-core/version.rb
	middleman-more/lib/middleman-more/core_extensions/compass.rb
	middleman-more/lib/middleman-more/core_extensions/default_helpers.rb
	middleman-more/lib/middleman-more/extensions/asset_hash.rb
2013-01-25 21:43:30 -08:00
Thomas Reynolds eccda125e5 Remove Tilt mappings for missing libraries. Fixes #713 2013-01-08 10:24:07 -08:00
Thomas Reynolds 0eb906efac Stylus support and tests. Fixes #649 2012-10-28 12:19:47 -07:00
Thomas Reynolds 01e9c336b0 Stylus support and tests. Fixes #649 2012-10-28 12:18:29 -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 a50ca56fbc Switch over to new config methods 2012-10-13 21:37:02 -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
Tim Bates 99a8723ea6 Fix instance variables in dynamic pages 2012-07-24 23:02:27 +09:30
Ben Hollis 89afc86a5b Friendlier error message when a non-default layout is not in the layouts directory. 2012-07-03 00:01:11 -07:00
Thomas Reynolds 286c7352b6 Fix Less load paths, simplify builder error output. Fixes #461 2012-06-05 10:24:00 -07:00
Thomas Reynolds e26b68635f Haml wrap_layout passes again 2012-06-02 14:19:45 -07:00
Thomas Reynolds 2ab294c602 Fix wrap_layout for all know templating engines. Fixes #417 2012-06-01 20:08:28 -07:00