Commit graph

645 commits

Author SHA1 Message Date
Thomas Reynolds 10e1fd92d6 add extension helpers block, convert cache buster 2013-04-20 13:32:39 -07:00
Thomas Reynolds b12a7bff3d Switch AssetHost to be a new-style extension. Setup extensions app scope earlier. Add supports_multiple_instances flag for extensions. 2013-04-20 12:59:14 -07:00
Thomas Reynolds c2e2839b79 allow new sprockets 2013-04-14 16:21:36 -07:00
Thomas Reynolds 9af92fa7a3 Fix slim's complaints about extra render options (:layout) 2013-04-14 09:37:23 -07:00
Thomas Reynolds ca333bb306 avoid warning with empty frontmatter 2013-04-14 09:29:34 -07:00
Thomas Reynolds 31651e4296 fix slim 2.0 deprecation warnings 2013-04-14 09:24:48 -07:00
Ben Hollis a2822ce7f5 Fix --clean option to not be an error if it is passed (for backwards compatibility) 2013-04-13 18:58:54 -07:00
Ben Hollis 310eae255e Nice styling for sitemap pages 2013-04-13 18:13:51 -07:00
Ben Hollis b4f131d615 Styling for config meta page 2013-04-13 18:13:51 -07:00
Ben Hollis a2f0cc263a Merge pull request #861 from bhollis/extensions
A bunch of extensions and config meta pages work
2013-04-13 16:38:17 -07:00
Thomas Reynolds 2679b7c506 Default build to cleaning 2013-04-13 13:52:22 -07:00
Ben Hollis 6fcbac0368 Advertise meta pages on startup 2013-04-12 23:32:18 -07:00
Ben Hollis 774361bf89 Add extensions to meta config page 2013-04-12 23:32:18 -07:00
Ben Hollis 2d4668f524 Add in the metadata rack app early so it is there whenever middleware grabs the app 2013-04-12 23:32:18 -07:00
Ben Hollis ee11ccb184 Reorganize Request a bit 2013-04-12 23:32:18 -07:00
Ben Hollis 8001dab258 Save information about extensions in a discoverable way.
This allows us to display extension config information at /__middleman/config/, and also allows users to modify extension
settings after they're activated in config.rb with a statement like "extensions[:asset_hash].options.exts += ['.js']".
2013-04-12 23:32:18 -07:00
Ben Hollis b9b17e3ac5 In general, no need for bundle exec since we call bundle/setup 2013-04-12 23:32:17 -07:00
Ben Hollis f7cd0e231e Update the extension template for the new Extension class. 2013-04-12 23:32:17 -07:00
Ben Hollis b607d70a52 Simplify configuration a bit, and make extensions raise an error if the user tries to set an invalid extension option. 2013-04-12 23:32:17 -07:00
Thomas Reynolds 3f94df1eef prep 3.1 beta 2013-04-12 16:19:47 -07:00
Thomas Reynolds 0574cc3d28 Support sideloading from .frontmatter files. Closes #855 2013-04-12 16:14:16 -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
Thomas Reynolds 9fc06035b1 unrequire osx file watcher 2013-04-11 09:53:38 -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
Ben Hollis fdd52cd640 Remove global access to the rack env and response 2013-04-09 23:06:10 -07:00
Ben Hollis 16ca3d5c17 Make some common shared state, and logging, threadsafe 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 1617875934 Activate Sprockets before user config 2013-04-07 23:33:40 -07:00
Ben Hollis 3e75a10056 Switch default markdown engine to Kramdown 2013-04-06 18:26:41 -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 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 1d869b0c08 Simplify frontmatter by removing its resource_list_manipulator 2013-04-06 14:56:08 -07:00
Ben Hollis c2ffa538ad Undo my previous change, apparently it is no good 2013-04-04 23:28:28 -07:00
Ben Hollis f7d1471edb Handle empty frontmatter without logging an exception 2013-04-04 22:59:05 -07:00
Ben Hollis f89c815868 More agressively set the context for our custom Markdown renderer, and fall back if we still don't manage to get it right. Fixes #662. 2013-04-04 22:48:09 -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
Ben Hollis cc418c7a2d Ruby 2.0 switches to using #inspect instead of #to_s when printing out objects, which brings back the infinite-hang-on-NoMethodError bug from http://bugs.ruby-lang.org/issues/4521. Aliasing #inspect to #to_s for Middleman::Application fixes it again. This fixes #833. 2013-04-02 22:20:37 -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
Capi Etheriel c1c752aa32 Suggest adding middleman-livereload to bundle 2013-03-26 15:07:22 -03:00
Capi Etheriel 00ac776fc4 Document livereload usage in config file 2013-03-26 11:21:17 -03:00
Thomas Reynolds 8aa652713a Merge pull request #836 from tricknotes/directory-as-a-data-key
Support directory name as a data key
2013-03-25 09:53:58 -07:00
Thomas Reynolds 420b4c6087 simplest thing that could work implementation of Middleman::Extension 2013-03-23 15:35:38 -07:00
Ryunosuke SATO 1e64e8022e Support directory name as a data key 2013-03-23 17:17:34 +09:00
Thomas Reynolds cd539f4e91 Merge pull request #835 from artm/need_reload_fix
fix 'needs_to_reload?' regexps
2013-03-22 11:13:07 -07:00
Artem Baguinski e07bd036d1 just call needs_to_reload? once 2013-03-22 18:28:38 +01:00
Artem Baguinski e169f88a5a fix 'needs_to_reload?' regexps
- remove stray ^ that would cause regexp to never match
- remove '_helper' suffix as it isn't required for helpers
2013-03-22 18:22:16 +01:00
Ryunosuke SATO f7f281de39 Fix code comment 2013-03-22 18:14:10 +09:00
Thomas Reynolds f2f3ad21b6 bump tilt requirement, unregister plaintext template. fixes #824 2013-03-18 14:12:49 -07:00
Michael Baudino d8d34b6c74 Changed 'default' and 'html5' templates to use 'current_page.data.title' instead of 'data.page.title'
Related to middleman/middleman-blog#107
2013-03-17 18:18:59 +01:00
Ben Hollis 659f063076 Include file extension in template cache. May fix #798 2013-03-14 23:21:58 -07:00
Ben Hollis 6672c1c324 Merge branch '3.0-stable' 2013-03-10 16:32:55 -07:00
Ben Hollis 46f060ab12 Don't require securerandom - not sure what it was there for, but its not available in JRuby 2013-03-10 16:32:24 -07:00
Ben Hollis 3ce35149ec Merge pull request #806 from kevin8t8/3.0-stable
Fix dynamic multi-byte utf-8 files rebuilding.
2013-03-03 19:07:55 -08:00
Kevin McCarthy 7608275089 Fix dynamic multi-byte utf-8 files rebuilding.
Thor compares the new contents with the existing file by using
File.binread(destination) == new_content.
File.binread returns a string with ASCII_8BIT encoding, which will not
match the new_content if new_content contains multi-byte utf-8.

This patch simply encodes the new_content to ASCII_8BIT before passing
it to Thor.
2013-03-03 18:13:41 -08:00
Ben Hollis 34fe18e56c Don't use the logger from a trap context. Fixes #801. 2013-03-03 12:33:30 -08:00
Ben Hollis a10c8aa194 Don't use the logger from a trap context. Fixes #801. 2013-03-03 12:31:42 -08:00
Ben Hollis 4745418200 Merge remote-tracking branch 'origin/3.0-stable'
Conflicts:
	.travis.yml
	Gemfile
	middleman-core/lib/middleman-core/version.rb
	middleman-core/middleman-core-x86-mingw32.gemspec
	middleman-core/middleman-core.gemspec
2013-03-02 22:32:03 -08:00
Ben Hollis 3928b209ef Serve extensionless files or dotfiles with text/plain MIME type, and remove Sitemap::Resource#mime_type. 2013-03-02 22:28:27 -08:00
Thomas Reynolds 6cee2d74f5 adapt to bundler changes, add ruby 2.0 to tests, prep release 2013-02-24 13:44:24 -08:00
Thomas Reynolds dd63ba164e Merge branch '3.0-stable' of github.com:middleman/middleman into 3.0-stable 2013-02-24 13:37:30 -08:00
Thomas Reynolds 0f80965ae3 latest listen supports new wdm 2013-02-24 13:34:07 -08:00
Thomas Reynolds 8d5ac575f6 prep pre 2013-02-20 13:15:38 -08:00
Thomas Reynolds aa2102cbb7 update listen dep 2013-02-19 17:14:10 -08:00
Ben Hollis 9057b7a85e Support Haml 4. Tests only run with Haml 4 now. Fixes #783 2013-02-17 19:40:17 -08:00
Ben Hollis c48ac06526 Merge pull request #776 from bhollis/config_meta
Add a metadata page for inspecting configuration.
2013-02-14 08:52:07 -08:00
Ben Hollis ff971dd327 Merge pull request #775 from bhollis/console
Add an experimental "console" CLI command.
2013-02-14 08:51:48 -08:00
Ben Hollis b4aa33fe22 Typo in merge 2013-02-10 18:43:38 -08:00
Ben Hollis 51a494b343 Merge remote-tracking branch 'origin/3.0-stable' 2013-02-10 18:05:24 -08:00
Ben Hollis d553c6a88e Protect against unset current_path 2013-02-10 17:51:47 -08: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 fede3449b6 Merge branch '3.0-stable' 2013-02-10 16:54:02 -08:00
Ben Hollis cf51fe6a20 Fix binary_spec test for svgz - it's binary 2013-02-10 16:53:38 -08:00
Ben Hollis d6110e2ff1 Add a metadata page for inspecting configuration.
This is another metadata page that uses the new configuration system to
show all the available options, their current values, and their defaults.
This is still unstyled, but the info is there. I still need to add on a
method for extensions to register their configuration with the global
config so they show up (stuff like blog) but this is a start.
2013-02-10 16:43:37 -08:00
Ben Hollis 2a5513dcc9 Add an experimental "console" CLI command.
The "console" command drops you into an IRB session in the context of the
Middleman application instance. You can look at configuration, poke around
at the sitemap and data, try out handlers (after calling self.current_path = "foo"), etc.
2013-02-10 16:12:32 -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 42320ade8d Force svgz to be binary 2013-02-10 15:23:39 -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 700b844e67 Add a spec for testing Middleman::Util#binary? 2013-02-09 15:49:10 -08:00
Thomas Reynolds 559265140d Stub out rspec tests for public APIs: Rack and Sitemap for now 2013-02-09 15:32:32 -08:00
Ben Hollis 923697b517 Micro-optimizations around string comparisons 2013-02-09 15:21:52 -08:00
Ben Hollis 1af96fe305 Fix gemspecs 2013-02-09 10:28:55 -08:00
Thomas Reynolds dd80d22b6a Merge pull request #767 from bhollis/deps
Revert the more-flexible Thor dependency since it breaks bundle install
2013-02-08 23:15:49 -08:00
Ben Hollis de7e621766 Revert the more-flexible Thor dependency since it breaks bundle install for JRuby and we will need to update Padrino when it gets upgraded anyway 2013-02-08 00:05:34 -08:00
Thomas Reynolds c9290c6b11 Allow frontmatter to be parsed on templates outside the project root 2013-02-06 13:19:09 -08:00
Ben Hollis 8d5dd8e8ce Merge pull request #763 from zuf/patch-1
Fix huge files regression (for undetected mime)
2013-02-06 00:28:37 -08:00
Egor Vakhromtsev 4e88414478 blksize was replaced with fixed value because windows issues 2013-02-06 12:14:24 +04:00
Ben Hollis 137ce94d23 Restore indifferent-access behavior to page data and fix broken caching 2013-02-05 23:34:18 -08:00
Ben Hollis bb2f40cc72 Merge branch '3.0-stable'
Conflicts:
	README.md
2013-02-05 22:07:05 -08:00
Egor 83c8f9a2ce Fix huge files regression (for undetected mime)
Note that binary_bytes is an array of bytes that never never appears in text. Array taken from encoding.c source from 'file' utility (http://www.darwinsys.com/file/).
2013-02-02 00:26:58 +04: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 aa6564f038 Don't catch Exception when parsing YAML frontmatter 2013-01-27 17:11:54 -08:00
Ben Hollis 5cedd4c37c Merge remote-tracking branch 'origin/3.0-stable'
Conflicts:
	middleman-core/middleman-core-x86-mingw32.gemspec
2013-01-26 01:01:01 -08:00
Thomas Reynolds 5f84833fc5 loosening our thor dependency in advance of padrino updating to 0.16. Closes #751 2013-01-25 23:04:52 -08:00
Ben Hollis 6dbe7f7a5a Update Gemfile to allow bundler to ever complete. Also simplify Gemfile, update dependencies, and remove $LOAD_PATH hacking from gemspecs. 2013-01-25 22:31:40 -08: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
Ben Hollis 7c9c4d03db Make build error message code a bit more compact 2013-01-25 20:22:45 -08:00
Seth Vargo 95fa217cec Say middleman build instead of just middleman 2013-01-25 21:23:24 -05:00
Seth Vargo 12753c5759 add quotes and bundle exec to error message 2013-01-24 12:40:24 -05:00
Thomas Reynolds 1af216240a prep 2013-01-22 23:14:35 -08:00
Thomas Reynolds 2d28272396 Merge pull request #736 from bhollis/master
Serve extensionless files or dotfiles with text/plain MIME type, and remove Sitemap::Resource#mime_type.
2013-01-22 23:14:15 -08:00
Ben Hollis da39484767 Mitigate major perf regression caused by the Middleman::Util#binary? method 2013-01-22 23:13:31 -08:00
Thomas Reynolds c34b425f45 prep 2013-01-21 11:42:34 -08:00
Steven Sloan 17ad2caf11 also "build" .htpasswd files 2013-01-21 11:21:48 -08:00
Steven Sloan c121c407df also "build" .htpasswd files 2013-01-18 20:13:49 -05: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 80fb3ff06f merge 2013-01-13 15:25:35 -08:00
Thomas Reynolds c7e35b95ba use .sass-cache everywhere 2013-01-13 15:22:36 -08:00
Daniel Bayerlein e3bb956649 Update installation command for susy-gem. 2013-01-13 11:59:41 -08:00
Thomas Reynolds 1b1a5c086e Add --force-polling flag to server. Closes #730. Closes #644 2013-01-13 11:57:18 -08:00
Thomas Reynolds d4f5e4db29 Add --force-polling flag to server. Closes #730. Closes #644 2013-01-13 11:56:53 -08:00
Daniel Bayerlein 2dca9e5787 Update installation command for susy-gem. 2013-01-12 16:40:00 +01: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 aa633a1cd3 make windows rack generic again 2013-01-09 10:28:47 -08:00
Thomas Reynolds e82aa6cc61 make blksize work on windows. 2013-01-09 09:49:23 -08:00
Ben Hollis 3d00e91605 Fix Middleman::Util.extract_response_text to follow the Rack spec (and thus work with rack 1.4.3) 2013-01-08 22:52:40 -08:00
Ben Hollis e3b9a41d3b Fix Middleman::Util.extract_response_text to follow the Rack spec (and thus work with rack 1.4.3) 2013-01-08 20:35:57 -08:00
Thomas Reynolds d6c2cf305b prep 3.0.9 2013-01-08 10:33:19 -08:00
Thomas Reynolds eccda125e5 Remove Tilt mappings for missing libraries. Fixes #713 2013-01-08 10:24:07 -08:00
Thomas Reynolds 84239f04a2 lock rack version 2013-01-08 10:23:13 -08:00
Thomas Reynolds 0a580c8b9a prep 3.0.8 2013-01-07 22:56:36 -08:00
Thomas Reynolds 7cd6cd233e Manually copy the file instead of asking Thor to do it 2013-01-02 16:40:42 -08:00
Thomas Reynolds aefcdabb52 prep pre 2013-01-01 19:10:54 -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 a537b434e3 Coerce all paths in sitemap to Pathname 2012-12-30 19:59:41 -08:00
Thomas Reynolds 1c62dd68a7 Simplify bundler init. Closes #700 2012-12-30 19:58:37 -08:00
Thomas Reynolds e08eb280fa Coerce all paths in sitemap to Pathname 2012-12-30 15:26:38 -08:00
Thomas Reynolds 55291edc65 Merge pull request #374 from middleman/metapages
Idea: Metadata pages
2012-12-25 16:12:27 -08:00
Ben Hollis a00d507de3 Clean up styling a bit, add extension hooks 2012-12-25 16:11:52 -08:00
Ben Hollis 142abe027e Switch to using view classes isntead of partials 2012-12-25 16:11:52 -08:00
Ben Hollis b8eb932a73 Hierarchical sitemap 2012-12-25 16:11:52 -08:00
Ben Hollis 22fcc3c108 Initial spike for meta pages 2012-12-25 16:11:52 -08:00
Ben Hollis ae743ac4db Conform to the rack specs, with help from Rack::Lint 2012-12-25 16:11:13 -08:00
Thomas Reynolds 45ddc0c344 Make Sitemap metadata queryable with arel-style API 2012-12-25 16:05:54 -08:00
Thomas Reynolds 41ae1053eb Remove dependency on compiled file watchers, will fall back to polling by default. This keeps Middleman from needing a compiler to install. Will ask user to upgrade to a compiled watcher on install. 2012-12-19 14:01:05 -08:00
Avia Aharon b084982923 fix Middleman::Util.path_match to work with string matchers 2012-12-18 12:32:13 +02:00
Thomas Reynolds eea45095b8 version bump 2012-12-15 14:59:32 -08:00
Thomas Reynolds 12a604d69e Fix html5bp test 2012-12-15 14:56:22 -08:00
Capi Etheriel 4805c11d49 turn html5 boilerplate into a layout
set hbp5 as the DEFAULT layout

use titles from YAML options
2012-12-15 14:53:01 -08:00
Casey Leask dd4c07d9d1 Added fix for empty YAML 2012-12-15 14:52:55 -08:00
Kunal Parikh 6f8ada6639 Using 'Socket.gethostname' to get default hostname
As suggested by @bhollis in https://github.com/middleman/middleman/pull/665#issuecomment-10262763
2012-12-15 14:52:40 -08:00
Kunal Parikh f6cf8de141 Changed log message when middleman starts.
Old message: == The Middleman is standing watch on port 4567
New message: == The Middleman is standing watch at http://0.0.0.0:4567

The URL in the message makes it clickable if the terminal supports it.
2012-12-15 14:52:31 -08:00
Alex Peattie 816bca9643 Fix for embedded Markdown in Slim w/ Redcarpet 2012-12-15 14:52:15 -08:00
Thomas Reynolds 054ce83d35 Fix html5bp test 2012-12-15 14:49:50 -08:00
Capi Etheriel 60fc4ce43a turn html5 boilerplate into a layout
set hbp5 as the DEFAULT layout

use titles from YAML options
2012-12-14 11:39:35 -02:00