middleman-core 4.4.3 → 4.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gemtest +0 -0
- data/.simplecov +2 -2
- data/features/i18n_builder.feature +2 -0
- data/features/i18n_link_to.feature +94 -0
- data/fixtures/asset-hash-app/source/apple-touch-icon.png +0 -0
- data/fixtures/asset-hash-app/source/favicon.ico +0 -0
- data/fixtures/asset-hash-app/source/fonts/fontawesome-webfont.woff +0 -0
- data/fixtures/asset-hash-app/source/fonts/fontawesome-webfont.woff2 +0 -0
- data/fixtures/asset-hash-app/source/images/100px.gif +0 -0
- data/fixtures/asset-hash-app/source/images/100px.jpg +0 -0
- data/fixtures/asset-hash-app/source/images/100px.png +0 -0
- data/fixtures/asset-hash-app/source/images/200px.jpg +0 -0
- data/fixtures/asset-hash-app/source/images/300px.jpg +0 -0
- data/fixtures/asset-hash-host-app/source/images/100px.gif +0 -0
- data/fixtures/asset-hash-host-app/source/images/100px.jpg +0 -0
- data/fixtures/asset-hash-host-app/source/images/100px.png +0 -0
- data/fixtures/asset-hash-minified-app/source/images/100px.jpg +0 -0
- data/fixtures/asset-hash-prefix/source/javascripts/application.js.map +0 -0
- data/fixtures/asset-hash-remove-filename/source/javascripts/application.js.map +0 -0
- data/fixtures/asset-hash-source-map/source/javascripts/application.js.map +0 -0
- data/fixtures/asset-host-app/source/.htaccess +0 -0
- data/fixtures/asset-host-app/source/images/blank0.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank1.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank10.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank100.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank101.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank1010.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank102.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank1020.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank1021.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank1022.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank1023.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank1024.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank103.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank1030.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank1031.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank1032.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank1033.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank1034.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank104.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank1043.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank1054.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank2.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank20.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank21.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank22.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank23.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank24.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank3.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank30.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank31.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank32.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank33.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank34.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank4.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank43.gif +0 -0
- data/fixtures/asset-host-app/source/images/blank54.gif +0 -0
- data/fixtures/auto-css-app/source/stylesheets/auto-css/index.css +0 -0
- data/fixtures/auto-js-directory-index-app/config.rb +0 -0
- data/fixtures/automatic-alt-tags-app/config.rb +0 -0
- data/fixtures/automatic-directory-matcher-app/source/root-plain.html +0 -0
- data/fixtures/automatic-directory-matcher-app/source/root.html.erb +0 -0
- data/fixtures/automatic-directory-matcher-app/source/sub--sub--sub-plain.html +0 -0
- data/fixtures/automatic-directory-matcher-app/source/sub--sub--sub.html.erb +0 -0
- data/fixtures/automatic-directory-matcher-app/source/sub--sub-plain.html +0 -0
- data/fixtures/automatic-directory-matcher-app/source/sub--sub.html.erb +0 -0
- data/fixtures/automatic-image-size-app/config.rb +0 -0
- data/fixtures/build-with-errors-app/source/index.html.erb +0 -0
- data/fixtures/cache-buster-app/config.rb +0 -0
- data/fixtures/chained-app/config.rb +0 -0
- data/fixtures/clean-app/config-empty.rb +0 -0
- data/fixtures/clean-app/source/real.html +0 -0
- data/fixtures/clean-app/source/should_be_ignored.html +0 -0
- data/fixtures/clean-app/source/should_be_ignored2.html +0 -0
- data/fixtures/clean-app/source/should_be_ignored3.html +0 -0
- data/fixtures/clean-dir-app/source/about.html +0 -0
- data/fixtures/clean-nested-app/config.rb +0 -0
- data/fixtures/clean-nested-app/source/about.html +0 -0
- data/fixtures/clean-nested-app/source/nested/nested.html +0 -0
- data/fixtures/coffeescript-app/config.rb +0 -0
- data/fixtures/content-for-app/source/content_for_haml.html.haml +2 -2
- data/fixtures/content-type-app/source/.htaccess +0 -0
- data/fixtures/content-type-app/source/README +0 -0
- data/fixtures/content-type-app/source/javascripts/app.js +0 -0
- data/fixtures/content-type-app/source/stylesheets/site.css +0 -0
- data/fixtures/csspie/config.rb +0 -0
- data/fixtures/custom-layout-app2/config.rb +0 -0
- data/fixtures/custom-src-app/src/index.html +0 -0
- data/fixtures/default-alt-tags-app/config.rb +0 -0
- data/fixtures/default-alt-tags-app/source/images/blank.gif +0 -0
- data/fixtures/different-engine-layout/config.rb +0 -0
- data/fixtures/different-engine-partial/config.rb +0 -0
- data/fixtures/different-engine-partial/source/index.html.erb +0 -0
- data/fixtures/different-engine-partial/source/shared/_footer.str +0 -0
- data/fixtures/different-engine-partial/source/shared/_header.erb +0 -0
- data/fixtures/dynamic-pages-app/source/real.html +0 -0
- data/fixtures/dynamic-pages-app/source/should_be_ignored.html +0 -0
- data/fixtures/dynamic-pages-app/source/should_be_ignored2.html +0 -0
- data/fixtures/dynamic-pages-app/source/should_be_ignored3.html +0 -0
- data/fixtures/dynamic-pages-app/source/should_be_ignored4.html +0 -0
- data/fixtures/dynamic-pages-app/source/should_be_ignored5.html +0 -0
- data/fixtures/dynamic-pages-app/source/should_be_ignored6.html +0 -0
- data/fixtures/dynamic-pages-app/source/should_be_ignored7.html +0 -0
- data/fixtures/dynamic-pages-app/source/should_be_ignored8.html +0 -0
- data/fixtures/ember-cli-app/source/javascripts/file.js +0 -0
- data/fixtures/ember-cli-app/test-app/app/components/.gitkeep +0 -0
- data/fixtures/ember-cli-app/test-app/app/controllers/.gitkeep +0 -0
- data/fixtures/ember-cli-app/test-app/app/helpers/.gitkeep +0 -0
- data/fixtures/ember-cli-app/test-app/app/models/.gitkeep +0 -0
- data/fixtures/ember-cli-app/test-app/app/routes/.gitkeep +0 -0
- data/fixtures/ember-cli-app/test-app/app/styles/.gitkeep +0 -0
- data/fixtures/ember-cli-app/test-app/app/templates/.gitkeep +0 -0
- data/fixtures/ember-cli-app/test-app/app/templates/components/.gitkeep +0 -0
- data/fixtures/ember-cli-app/test-app/app/views/.gitkeep +0 -0
- data/fixtures/ember-cli-app/test-app/public/.gitkeep +0 -0
- data/fixtures/ember-cli-app/test-app/tests/unit/.gitkeep +0 -0
- data/fixtures/empty-app/not-config.rb +0 -0
- data/fixtures/engine-matching-layout/config.rb +0 -0
- data/fixtures/env-app/config.rb +0 -0
- data/fixtures/extensionless-text-files-app/config.rb +0 -0
- data/fixtures/extensionless-text-files-app/source/CNAME +0 -0
- data/fixtures/extensionless-text-files-app/source/LICENSE +0 -0
- data/fixtures/extensionless-text-files-app/source/README +0 -0
- data/fixtures/extensionless-text-files-app/source/index.html +0 -0
- data/fixtures/external-helpers/source/automatic.html.erb +0 -0
- data/fixtures/external-helpers/source/index.html.erb +0 -0
- data/fixtures/external-pipeline-error/source/javascripts/file.js +0 -0
- data/fixtures/fonts-app/config.rb +0 -0
- data/fixtures/fonts-app/source/fonts/blank/blank.otf +0 -0
- data/fixtures/frontmatter-neighbor-app/source/raw-front-matter-toml.html +0 -0
- data/fixtures/frontmatter-neighbor-app/source/raw-front-matter.php +0 -0
- data/fixtures/frontmatter-settings-app/source/layouts/override.erb +0 -0
- data/fixtures/frontmatter-settings-neighbor-app/source/layouts/override.erb +0 -0
- data/fixtures/frontmatter-settings-neighbor-app/source/override_layout.html.erb +0 -0
- data/fixtures/frontmatter-settings-neighbor-app/source/page_mentioned.html.erb +0 -0
- data/fixtures/gzip-app/source/index.html +0 -0
- data/fixtures/i18n-alt-root-app/source/lang_data/hello.html.erb +0 -0
- data/fixtures/i18n-alt-root-app/source/lang_data/index.html.erb +0 -0
- data/fixtures/i18n-alt-root-app/source/layout.erb +0 -0
- data/fixtures/i18n-test-app/data/defaults_en.yml +0 -0
- data/fixtures/i18n-test-app/data/defaults_es.yml +0 -0
- data/fixtures/i18n-test-app/data/en_defaults.yml +0 -0
- data/fixtures/i18n-test-app/locales/en.yml +2 -1
- data/fixtures/i18n-test-app/source/_country.en.erb +0 -0
- data/fixtures/i18n-test-app/source/_country.es.erb +0 -0
- data/fixtures/i18n-test-app/source/_site.erb +0 -0
- data/fixtures/i18n-test-app/source/images/president.en.svg +0 -0
- data/fixtures/i18n-test-app/source/images/president.es.svg +0 -0
- data/fixtures/i18n-test-app/source/localizable/_state.en.erb +0 -0
- data/fixtures/i18n-test-app/source/localizable/_state.es.erb +0 -0
- data/fixtures/i18n-test-app/source/localizable/fallback.html.erb +1 -0
- data/fixtures/i18n-test-app/source/localizable/hello.html.erb +0 -0
- data/fixtures/i18n-test-app/source/localizable/images/flag.en.svg +0 -0
- data/fixtures/i18n-test-app/source/localizable/images/flag.es.svg +0 -0
- data/fixtures/i18n-test-app/source/localizable/index.html.erb +0 -0
- data/fixtures/i18n-test-app/source/localizable/partials/_greeting.en.erb +0 -0
- data/fixtures/i18n-test-app/source/localizable/partials/_greeting.es.erb +0 -0
- data/fixtures/ignore-app/source/about.html.erb +0 -0
- data/fixtures/ignore-app/source/images/icon/messages.png +0 -0
- data/fixtures/ignore-app/source/images/pic.png +0 -0
- data/fixtures/ignore-app/source/images/portrait.jpg +0 -0
- data/fixtures/ignore-app/source/index.html.erb +0 -0
- data/fixtures/ignore-app/source/plain.html +0 -0
- data/fixtures/ignore-app/source/reports/another.html +0 -0
- data/fixtures/ignore-app/source/reports/index.html +0 -0
- data/fixtures/import-app/bower_components/jquery/dist/jquery.min.map +0 -0
- data/fixtures/import-app/bower_components/jquery/src/sizzle/dist/sizzle.min.map +0 -0
- data/fixtures/import-app/source/test.html +0 -0
- data/fixtures/import-app/static.html +0 -0
- data/fixtures/indexable-app/source/.htaccess +0 -0
- data/fixtures/indexable-app/source/.htpasswd +0 -0
- data/fixtures/indexable-app/source/.nojekyll +0 -0
- data/fixtures/indexable-app/source/a_folder/needs_index.html +0 -0
- data/fixtures/indexable-app/source/leave_me_alone.html +0 -0
- data/fixtures/indexable-app/source/needs_index.html +0 -0
- data/fixtures/indexable-app/source/regular/index.html +0 -0
- data/fixtures/javascript-app/config.rb +0 -0
- data/fixtures/large-build-app/source/.htaccess +0 -0
- data/fixtures/large-build-app/source/.htpasswd +0 -0
- data/fixtures/large-build-app/source/other_layout.erb +0 -0
- data/fixtures/large-build-app/source/spaces in file.html.erb +0 -0
- data/fixtures/link-to-app/config.rb +0 -0
- data/fixtures/liquid-app/config.rb +0 -0
- data/fixtures/liquid-app/source/_liquid_partial.liquid +0 -0
- data/fixtures/liquid-app/source/liquid_master.html.liquid +0 -0
- data/fixtures/markdown-app/source/filter_html.html.markdown +0 -0
- data/fixtures/markdown-app/source/highlighted.html.markdown +0 -0
- data/fixtures/markdown-app/source/img.html.markdown +0 -0
- data/fixtures/markdown-app/source/link.html.markdown +0 -0
- data/fixtures/markdown-app/source/mailto.html.markdown +0 -0
- data/fixtures/markdown-app/source/quote.html.markdown +0 -0
- data/fixtures/markdown-app/source/safe_links.html.markdown +0 -0
- data/fixtures/markdown-app/source/underline.html.markdown +0 -0
- data/fixtures/markdown-in-haml-app/config.rb +0 -0
- data/fixtures/markdown-in-slim-app/config.rb +0 -0
- data/fixtures/minify-css-app/source/stylesheets/bourbon/css3/_selection.scss +0 -0
- data/fixtures/minify-css-app/source/stylesheets/report.css +0 -0
- data/fixtures/minify-js-app/config.rb +0 -0
- data/fixtures/missing-tilt-library-app/source/danger-zone/more-wiki.html.wiki +0 -0
- data/fixtures/missing-tilt-library-app/source/safe-zone/my-wiki.html.wiki +0 -0
- data/fixtures/missing-tilt-library-app/source/textile-source.html.textile +0 -0
- data/fixtures/missing-tilt-library-app/source/wiki-source.html.wiki +0 -0
- data/fixtures/more-extensionless-text-files-app/source/CNAME +0 -0
- data/fixtures/more-extensionless-text-files-app/source/LICENSE +0 -0
- data/fixtures/more-extensionless-text-files-app/source/README +0 -0
- data/fixtures/more-extensionless-text-files-app/source/index.html +0 -0
- data/fixtures/more-ignore-app/source/about.html.erb +0 -0
- data/fixtures/more-ignore-app/source/images/icon/messages.png +0 -0
- data/fixtures/more-ignore-app/source/images/pic.png +0 -0
- data/fixtures/more-ignore-app/source/images/portrait.jpg +0 -0
- data/fixtures/more-ignore-app/source/index.html.erb +0 -0
- data/fixtures/more-ignore-app/source/plain.html +0 -0
- data/fixtures/more-ignore-app/source/reports/another.html +0 -0
- data/fixtures/more-ignore-app/source/reports/index.html +0 -0
- data/fixtures/more-preview-app/config.rb +0 -0
- data/fixtures/more-preview-app/source/content.html.erb +0 -0
- data/fixtures/more-preview-app/source/layout.erb +0 -0
- data/fixtures/more-traversal-app/source/directory-indexed/sub2/index.html.erb +0 -0
- data/fixtures/more-traversal-app/source/directory-indexed/sub3/deep.html.erb +0 -0
- data/fixtures/more-traversal-app/source/directory-indexed.html.erb +0 -0
- data/fixtures/more-traversal-app/source/index.html.erb +0 -0
- data/fixtures/more-traversal-app/source/proxied.html.erb +0 -0
- data/fixtures/more-traversal-app/source/root.html.erb +0 -0
- data/fixtures/more-traversal-app/source/sub/index.html.erb +0 -0
- data/fixtures/more-traversal-app/source/sub/sibling.html.erb +0 -0
- data/fixtures/more-traversal-app/source/sub/sibling2.html.erb +0 -0
- data/fixtures/more-traversal-app/source/sub/sub2/index.html.erb +0 -0
- data/fixtures/more-traversal-app/source/sub/sub3/deep.html.erb +0 -0
- data/fixtures/multiple-data-sources-app/data/two.yml +0 -0
- data/fixtures/multiple-data-sources-app/data1/data1.yml +0 -0
- data/fixtures/multiple-data-sources-app/data2/data2.yml +0 -0
- data/fixtures/multiple-data-sources-app/data2/two.yml +0 -0
- data/fixtures/multiple-layouts/config.rb +0 -0
- data/fixtures/multiple-sources-app/source/index.html.erb +0 -0
- data/fixtures/multiple-sources-app/source/override-in-two.html.erb +0 -0
- data/fixtures/multiple-sources-app/source0/override-in-one.html.erb +0 -0
- data/fixtures/multiple-sources-app/source1/index1.html.erb +0 -0
- data/fixtures/multiple-sources-app/source1/override-in-one.html.erb +0 -0
- data/fixtures/multiple-sources-app/source2/index2.html.erb +0 -0
- data/fixtures/multiple-sources-app/source2/override-in-two.html.erb +0 -0
- data/fixtures/multiple-sources-with-duplicate-file-names-app/source/index.html.erb +0 -0
- data/fixtures/multiple-sources-with-duplicate-file-names-app/source2/index.html.erb +0 -0
- data/fixtures/nested-data-app/data/examples/deeper/stuff.yml +0 -0
- data/fixtures/nested-data-app/data/examples/more.yml +0 -0
- data/fixtures/no-layout/config.rb +0 -0
- data/fixtures/page-classes-app/source/1-folder/1-inside-with-numeric.html.erb +0 -0
- data/fixtures/page-classes-app/source/1-starts-with-numeric.html.erb +0 -0
- data/fixtures/page-classes-app/source/2-starts-with-numeric-custom.html.erb +0 -0
- data/fixtures/page-helper-layout-block-app/source/index.html.erb +0 -0
- data/fixtures/page-helper-layout-block-app/source/path/child.html.erb +0 -0
- data/fixtures/page-helper-layout-block-app/source/path/index.html.erb +0 -0
- data/fixtures/paginate-app/config.rb +0 -0
- data/fixtures/partial-chained_templates-app/config.rb +0 -0
- data/fixtures/partials-app/config.rb +0 -0
- data/fixtures/partials-app/source/_code_snippet.html +0 -0
- data/fixtures/partials-app/source/_locals.erb +0 -0
- data/fixtures/partials-app/source/_main.erb +0 -0
- data/fixtures/partials-app/source/_main.str +0 -0
- data/fixtures/partials-app/source/shared/_footer.erb +0 -0
- data/fixtures/partials-app/source/shared/_header.erb +0 -0
- data/fixtures/partials-app/source/shared/_snippet.html.erb +0 -0
- data/fixtures/partials-app/source/static_underscore.html.erb +0 -0
- data/fixtures/partials-app/source/sub/_local.erb +0 -0
- data/fixtures/partials-app/source/svg.html.erb +0 -0
- data/fixtures/passthrough-app/source/.htaccess +0 -0
- data/fixtures/preview-app/config.rb +0 -0
- data/fixtures/preview-app/source/content.html.erb +0 -0
- data/fixtures/preview-app/source/layout.erb +0 -0
- data/fixtures/proxy-pages-app/source/real.html +0 -0
- data/fixtures/proxy-pages-app/source/should_be_ignored3.html +0 -0
- data/fixtures/proxy-pages-app/source/should_be_ignored6.html +0 -0
- data/fixtures/proxy-pages-app/source/should_be_ignored7.html +0 -0
- data/fixtures/proxy-pages-app/source/should_be_ignored8.html +0 -0
- data/fixtures/related-files-app/config.rb +0 -0
- data/fixtures/related-files-app/source/index.html.erb +0 -0
- data/fixtures/related-files-app/source/partials/_test.erb +0 -0
- data/fixtures/related-files-app/source/partials/_test2.haml +0 -0
- data/fixtures/related-files-app/source/stylesheets/_include3.sass +0 -0
- data/fixtures/related-files-app/source/stylesheets/_include4.scss +0 -0
- data/fixtures/related-files-app/source/stylesheets/include1.css +0 -0
- data/fixtures/related-files-app/source/stylesheets/include2.css.scss +0 -0
- data/fixtures/related-files-app/source/stylesheets/site.css.scss +0 -0
- data/fixtures/relative-app/config.rb +0 -0
- data/fixtures/relative-assets-app/source/fonts/roboto/roboto-regular-webfont.eot +0 -0
- data/fixtures/relative-assets-app/source/fonts/roboto/roboto-regular-webfont.svg +0 -0
- data/fixtures/relative-assets-app/source/fonts/roboto/roboto-regular-webfont.ttf +0 -0
- data/fixtures/relative-assets-app/source/fonts/roboto/roboto-regular-webfont.woff +0 -0
- data/fixtures/relative-assets-app/source/images/blank2.gif +0 -0
- data/fixtures/sass-in-slim-app/config.rb +0 -0
- data/fixtures/scss-app/config.rb +0 -0
- data/fixtures/scss-app/source/stylesheets/error.css.sass +0 -0
- data/fixtures/strip-url-app/config.rb +0 -0
- data/fixtures/stylus-preview-app/config.rb +0 -0
- data/fixtures/traversal-app/source/.htaccess +0 -0
- data/fixtures/traversal-app/source/directory-indexed/sub2/index.html.erb +0 -0
- data/fixtures/traversal-app/source/directory-indexed/sub3/deep.html.erb +0 -0
- data/fixtures/traversal-app/source/directory-indexed.html.erb +0 -0
- data/fixtures/traversal-app/source/index.html.erb +0 -0
- data/fixtures/traversal-app/source/proxied.html.erb +0 -0
- data/fixtures/traversal-app/source/root.html.erb +0 -0
- data/fixtures/traversal-app/source/sub/index.html.erb +0 -0
- data/fixtures/traversal-app/source/sub/sibling.html.erb +0 -0
- data/fixtures/traversal-app/source/sub/sibling2.html.erb +0 -0
- data/fixtures/traversal-app/source/sub/sub2/index.html.erb +0 -0
- data/fixtures/traversal-app/source/sub/sub3/deep.html.erb +0 -0
- data/fixtures/wildcard-app/source/admin/index.html.erb +0 -0
- data/fixtures/wildcard-app/source/admin/page.html.erb +0 -0
- data/fixtures/wildcard-app/source/index.html.erb +0 -0
- data/fixtures/wildcard-directory-index-app/source/admin/index.html.erb +0 -0
- data/fixtures/wildcard-directory-index-app/source/admin/page.html.erb +0 -0
- data/fixtures/wildcard-directory-index-app/source/index.html.erb +0 -0
- data/lib/middleman-core/builder.rb +2 -1
- data/lib/middleman-core/core_extensions/i18n.rb +59 -6
- data/lib/middleman-core/extensions/asset_hash.rb +2 -1
- data/lib/middleman-core/extensions/external_pipeline.rb +2 -1
- data/lib/middleman-core/meta_pages/assets/glyphicons-halflings.png +0 -0
- data/lib/middleman-core/meta_pages/assets/sitemap.js +0 -0
- data/lib/middleman-core/rack.rb +2 -2
- data/lib/middleman-core/renderers/haml.rb +39 -10
- data/lib/middleman-core/step_definitions/server_steps.rb +4 -4
- data/lib/middleman-core/util/data.rb +9 -1
- data/lib/middleman-core/util/paths.rb +1 -2
- data/lib/middleman-core/version.rb +1 -1
- data/middleman-core.gemspec +2 -2
- data/spec/middleman-core/binary_spec/middleman +0 -0
- data/spec/middleman-core/binary_spec/middleman.png +0 -0
- data/spec/middleman-core/binary_spec/stars.svgz +0 -0
- data/spec/spec_helper.rb +1 -1
- metadata +11 -4
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/fixtures/scss-app/config.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'addressable/uri'
|
1
2
|
require 'pathname'
|
2
3
|
require 'fileutils'
|
3
4
|
require 'tempfile'
|
@@ -229,7 +230,7 @@ module Middleman
|
|
229
230
|
if resource.binary?
|
230
231
|
export_file!(output_file, resource.file_descriptor[:full_path])
|
231
232
|
else
|
232
|
-
response = @rack.get(::
|
233
|
+
response = @rack.get(Addressable::URI.encode(resource.request_path))
|
233
234
|
|
234
235
|
# If we get a response, save it to a tempfile.
|
235
236
|
if response.status == 200
|
@@ -151,7 +151,9 @@ class Middleman::CoreExtensions::Internationalization < ::Middleman::Extension
|
|
151
151
|
new_resources = []
|
152
152
|
|
153
153
|
file_extension_resources = resources.select do |resource|
|
154
|
-
|
154
|
+
# Ignore resources which are outside of the localizable directory
|
155
|
+
File.fnmatch?(File.join(options[:templates_dir], '**'), resource.path) &&
|
156
|
+
parse_locale_extension(resource.path)
|
155
157
|
end
|
156
158
|
|
157
159
|
localizable_folder_resources = resources.select do |resource|
|
@@ -190,10 +192,61 @@ class Middleman::CoreExtensions::Internationalization < ::Middleman::Extension
|
|
190
192
|
resource.ignore!
|
191
193
|
end
|
192
194
|
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
195
|
+
# This generates a lookup hash that maps the real path (as seen by the web
|
196
|
+
# page user) to the paths of the localized versions. The lookup is later
|
197
|
+
# used by `url_for '/some/page.html', :locale => :en` and other url
|
198
|
+
# helpers.
|
199
|
+
#
|
200
|
+
# For example (given :mount_at_root => :es) and localized paths:
|
201
|
+
#
|
202
|
+
# @lookup['/en/magic/stuff.html'] = {:en => '/en/magic/stuff.html', :de => '/de/magisches/zeug.html', :es => '/magico/cosas.html'}
|
203
|
+
# @lookup['/de/index.html'] = {:en => '/en/index.html', :de => '/de/index.html', :es => '/index.html'}
|
204
|
+
# @lookup['/en/index.html'] = {:en => '/en/index.html', :de => '/de/index.html', :es => '/index.html'}
|
205
|
+
# @lookup['/index.html'] = {:en => '/en/index.html', :de => '/de/index.html', :es => '/index.html'}
|
206
|
+
#
|
207
|
+
# We do this by grouping by the source paths with the locales removed. All
|
208
|
+
# the localized pages with the same content in different languages get the
|
209
|
+
# same key.
|
210
|
+
#
|
211
|
+
@source_path_group = new_resources.group_by do |resource|
|
212
|
+
# Try to get source path without extension
|
213
|
+
_locale, path, _page_id = parse_locale_extension(resource.source_path)
|
214
|
+
|
215
|
+
# If that fails, there is no extension, so we use the original path. We
|
216
|
+
# can not use resource.path here, because .path may be translated, so the
|
217
|
+
# file names do not match up.
|
218
|
+
path ||= resource.source_path
|
219
|
+
|
220
|
+
# This will contain the localizable/ directory, but that does not matter,
|
221
|
+
# because it will be contained in both alternatives above, so the
|
222
|
+
# grouping key will be correct.
|
223
|
+
path
|
224
|
+
end
|
225
|
+
|
226
|
+
# Then we walk this grouped hash and generate the lookup table as given
|
227
|
+
# above.
|
228
|
+
@lookup = {}
|
229
|
+
@source_path_group.each do |src_path, resources|
|
230
|
+
# For each group we generate a list of the paths the user really sees
|
231
|
+
# (e.g. ['/en/index.html', '/de/index.html', '/index.html'])
|
232
|
+
exposed_paths = resources.map(&:path)
|
233
|
+
|
234
|
+
# We also generate a map with the same infos, but with the locales as keys.
|
235
|
+
# e.g. {:en => '/en/index.html', :de => '/de/index.html', :es => '/index.html'}
|
236
|
+
locale_map = resources.each_with_object({}) do |resource, map|
|
237
|
+
map[resource.locale] = '/' + resource.path
|
238
|
+
end
|
239
|
+
|
240
|
+
# Then we add those to the lookup table, so every path has a
|
241
|
+
# cross-reference to any other path in other locales.
|
242
|
+
exposed_paths.each do |path|
|
243
|
+
@lookup['/' + path] = locale_map
|
244
|
+
end
|
245
|
+
|
246
|
+
if @mount_at_root == false
|
247
|
+
src_path = src_path.sub(options[:templates_dir] + '/', '')
|
248
|
+
@lookup["/#{src_path}"] = locale_map
|
249
|
+
end
|
197
250
|
end
|
198
251
|
|
199
252
|
new_resources.reduce(resources) do |sum, r|
|
@@ -236,7 +289,7 @@ class Middleman::CoreExtensions::Internationalization < ::Middleman::Extension
|
|
236
289
|
|
237
290
|
# Reset fallbacks to fall back to our new default
|
238
291
|
if ::I18n.respond_to?(:fallbacks)
|
239
|
-
::I18n.fallbacks = ::I18n::Locale::Fallbacks.new(
|
292
|
+
::I18n.fallbacks = ::I18n::Locale::Fallbacks.new(::I18n.default_locale)
|
240
293
|
end
|
241
294
|
end
|
242
295
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'addressable/uri'
|
1
2
|
require 'middleman-core/util'
|
2
3
|
require 'middleman-core/rack'
|
3
4
|
|
@@ -87,7 +88,7 @@ class Middleman::Extensions::AssetHash < ::Middleman::Extension
|
|
87
88
|
else
|
88
89
|
# Render through the Rack interface so middleware and mounted apps get a shot
|
89
90
|
response = @rack_client.get(
|
90
|
-
::
|
91
|
+
Addressable::URI.encode(resource.destination_path),
|
91
92
|
'bypass_inline_url_rewriter_asset_hash' => 'true'
|
92
93
|
)
|
93
94
|
|
@@ -6,6 +6,7 @@ class Middleman::Extensions::ExternalPipeline < ::Middleman::Extension
|
|
6
6
|
option :source, nil, 'Path to merge into sitemap', required: true
|
7
7
|
option :latency, 0.25, 'Latency between refreshes of source'
|
8
8
|
option :disable_background_execution, false, "Don't run the command in a separate background thread"
|
9
|
+
option :ignore_exit_code, false, 'Ignore exit code for restart or stop of a command'
|
9
10
|
|
10
11
|
def initialize(app, config={}, &block)
|
11
12
|
super
|
@@ -65,7 +66,7 @@ class Middleman::Extensions::ExternalPipeline < ::Middleman::Extension
|
|
65
66
|
|
66
67
|
@current_thread.wait
|
67
68
|
|
68
|
-
if !@current_thread.exitstatus.nil? && @current_thread.exitstatus != 0
|
69
|
+
if !options[:ignore_exit_code] && !@current_thread.exitstatus.nil? && @current_thread.exitstatus != 0
|
69
70
|
logger.error '== External: Command failed with non-zero exit status'
|
70
71
|
exit(1)
|
71
72
|
end
|
File without changes
|
File without changes
|
data/lib/middleman-core/rack.rb
CHANGED
@@ -3,7 +3,7 @@ require 'rack/file'
|
|
3
3
|
require 'rack/lint'
|
4
4
|
require 'rack/head'
|
5
5
|
require 'rack/utils'
|
6
|
-
require '
|
6
|
+
require 'addressable/uri'
|
7
7
|
|
8
8
|
require 'middleman-core/util'
|
9
9
|
require 'middleman-core/logger'
|
@@ -87,7 +87,7 @@ module Middleman
|
|
87
87
|
def process_request(env, req, res)
|
88
88
|
start_time = Time.now
|
89
89
|
|
90
|
-
request_path =
|
90
|
+
request_path = Addressable::URI.unencode(env['PATH_INFO'].dup)
|
91
91
|
if request_path.respond_to? :force_encoding
|
92
92
|
request_path.force_encoding('UTF-8')
|
93
93
|
end
|
@@ -29,12 +29,18 @@ module Middleman
|
|
29
29
|
def prepare; end
|
30
30
|
|
31
31
|
def evaluate(scope, locals, &block)
|
32
|
-
options = {}.merge!(@options).merge!(
|
32
|
+
options = {}.merge!(@options).merge!(context: @context || scope)
|
33
33
|
if options.include?(:outvar)
|
34
34
|
options[:buffer] = options.delete(:outvar)
|
35
35
|
options[:save_buffer] = true
|
36
36
|
end
|
37
|
-
|
37
|
+
if Object.const_defined?('::Haml::Template') # haml 6+
|
38
|
+
@engine = ::Haml::Template.new(eval_file, line, options) { data }
|
39
|
+
else
|
40
|
+
options[:filename] = eval_file
|
41
|
+
options[:line] = line
|
42
|
+
@engine = ::Haml::Engine.new(data, options)
|
43
|
+
end
|
38
44
|
output = @engine.render(scope, locals, &block)
|
39
45
|
|
40
46
|
output
|
@@ -46,8 +52,12 @@ module Middleman
|
|
46
52
|
def initialize(app, options={}, &block)
|
47
53
|
super
|
48
54
|
|
49
|
-
::Haml::Options
|
50
|
-
|
55
|
+
if Object.const_defined?('::Haml::Options') # Haml 5 and older
|
56
|
+
::Haml::Options.defaults[:context] = nil
|
57
|
+
::Haml::Options.send :attr_accessor, :context
|
58
|
+
else # Haml 6+
|
59
|
+
::Haml::Engine.define_options context: nil
|
60
|
+
end
|
51
61
|
if defined?(::Haml::TempleEngine)
|
52
62
|
::Haml::TempleEngine.define_options context: nil
|
53
63
|
end
|
@@ -55,12 +65,31 @@ module Middleman
|
|
55
65
|
# rubocop:disable NestedMethodDefinition
|
56
66
|
[::Haml::Filters::Sass, ::Haml::Filters::Scss, ::Haml::Filters::Markdown].each do |f|
|
57
67
|
f.class_exec do
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
68
|
+
if respond_to?(:template_class) # Haml 5 and older
|
69
|
+
def self.render_with_options(text, compiler_options)
|
70
|
+
modified_options = options.dup
|
71
|
+
modified_options[:context] = compiler_options[:context]
|
72
|
+
|
73
|
+
text = template_class.new(nil, 1, modified_options) { text }.render
|
74
|
+
super(text, compiler_options)
|
75
|
+
end
|
76
|
+
else # Haml 6+
|
77
|
+
def initialize(options = {})
|
78
|
+
super
|
79
|
+
@context = options[:context]
|
80
|
+
end
|
81
|
+
|
82
|
+
def compile_with_tilt(node, name, indent_width: 0)
|
83
|
+
options = { context: @context }
|
84
|
+
source = node.value[:text]
|
85
|
+
result = ::Tilt["t.#{name}"].new(nil, 1, options) { source }.render
|
86
|
+
|
87
|
+
temple = [:multi, [:static, result.gsub(/^/, ' ' * indent_width)]]
|
88
|
+
source.lines.size.times do
|
89
|
+
temple << [:newline]
|
90
|
+
end
|
91
|
+
temple
|
92
|
+
end
|
64
93
|
end
|
65
94
|
end
|
66
95
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'middleman-core/rack'
|
2
2
|
require 'rspec/expectations'
|
3
3
|
require 'capybara/cucumber'
|
4
|
-
require '
|
4
|
+
require 'addressable/uri'
|
5
5
|
|
6
6
|
Given /^a clean server$/ do
|
7
7
|
@initialize_commands = []
|
@@ -34,7 +34,7 @@ end
|
|
34
34
|
Given /^the Server is running$/ do
|
35
35
|
root_dir = File.expand_path(expand_path("."))
|
36
36
|
|
37
|
-
if File.
|
37
|
+
if File.exist?(File.join(root_dir, 'source'))
|
38
38
|
ENV['MM_SOURCE'] = 'source'
|
39
39
|
else
|
40
40
|
ENV['MM_SOURCE'] = ''
|
@@ -73,11 +73,11 @@ Given /^a template named "([^\"]*)" with:$/ do |name, string|
|
|
73
73
|
end
|
74
74
|
|
75
75
|
When /^I go to "([^\"]*)"$/ do |url|
|
76
|
-
visit(
|
76
|
+
visit(Addressable::URI.encode(url))
|
77
77
|
end
|
78
78
|
|
79
79
|
Then /^going to "([^\"]*)" should not raise an exception$/ do |url|
|
80
|
-
expect{ visit(
|
80
|
+
expect { visit(Addressable::URI.encode(url)) }.to_not raise_exception
|
81
81
|
end
|
82
82
|
|
83
83
|
Then /^the content type should be "([^\"]*)"$/ do |expected|
|