{"id":18889724,"url":"https://github.com/middleman/middleman-sprockets","last_synced_at":"2026-02-25T09:30:20.904Z","repository":{"id":3286735,"uuid":"4327383","full_name":"middleman/middleman-sprockets","owner":"middleman","description":"Sprockets support for Middleman","archived":false,"fork":false,"pushed_at":"2017-08-28T17:16:32.000Z","size":828,"stargazers_count":62,"open_issues_count":13,"forks_count":52,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-01-31T09:04:15.141Z","etag":null,"topics":["middleman-extension"],"latest_commit_sha":null,"homepage":"http://middlemanapp.com","language":"Gherkin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/middleman.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-05-14T18:26:24.000Z","updated_at":"2024-08-05T02:52:59.000Z","dependencies_parsed_at":"2022-09-02T14:10:35.985Z","dependency_job_id":null,"html_url":"https://github.com/middleman/middleman-sprockets","commit_stats":null,"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/middleman%2Fmiddleman-sprockets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/middleman%2Fmiddleman-sprockets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/middleman%2Fmiddleman-sprockets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/middleman%2Fmiddleman-sprockets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/middleman","download_url":"https://codeload.github.com/middleman/middleman-sprockets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239861055,"owners_count":19709146,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["middleman-extension"],"created_at":"2024-11-08T07:50:30.090Z","updated_at":"2026-02-25T09:30:20.845Z","avatar_url":"https://github.com/middleman.png","language":"Gherkin","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e The master branch is the 4.x version of Middleman-Sprockets.\n\u003e - If you're upgrading from 3.x, the [upgrading guide](docs/upgrade-3-to-4.md) should get you started.\n\u003e - For 3.x stable usage please see the [`v3-stable-real` branch](https://github.com/middleman/middleman-sprockets/tree/v3-stable-real)\n\n# Middleman-Sprockets\n\n`middleman-sprockets` is an extension for the [Middleman] static site generator that allows support for [Sprockets](https://github.com/sstephenson/sprockets) in your assets.\n\n\n## Installation\n\nIf you're just getting started, install the `middleman` gem and generate a new project:\n\n```\ngem install middleman\nmiddleman init MY_PROJECT\n```\n\nThen add `gem \"middleman-sprockets\"` to your `Gemfile` and run `bundle install`\n\nTo activate the extension, in your `config.rb` add:\n\n```ruby\nactivate :sprockets\n```\n\n### Usage\n\n- [Basic Usage](features/basic_usage.feature)\n- [With Rails Assets](docs/usage-with-rails-assets.md)\n- [With Asset Gems](features/asset_gems.feature)\n- [With Bower](features/bower.feature)\n- [Linked Assets](features/linked_assets.feature)\n- [Helpers](features/middleman_helpers.feature)\n\n### Configuration\n\nThere are currently two options for configuration, `imported_asset_path` and `expose_middleman_helpers`.\n\n**`imported_asset_path` [default: 'assets']**\n\nThis is the path imported/linked assets will be added to the sitemap. For example, in the bower fixture app, the `/javascripts/core.js` file has `//= link \"lightbox2/img/close.png\"`. This linked asset will be added to the sitemap at `/assets/lightbox2/img/close.png`.\n\nTo configure, in `config.rb`:\n\n```ruby\nactivate :sprockets do |c|\n  c.imported_asset_path = \"YOUR_PATH\"\nend\n```\n\nYou can also pass an object (proc/lambda/class) that responds to `#call` to `imported_asset_path` to conditionally determine where assets go.\n\n```ruby\nactivate :sprockets do |c|\n  c.imported_asset_path = -\u003e(sprockets_asset) do\n    if sprockets_asset.logical_path =~ /\\.js$/\n      # all files ending with .js get put in /vendor-js\n      File.join('vendor-js', sprockets_asset.logical_path)\n    else\n      # other assets head to /imported\n      File.join('imported', sprockets_asset.logical_path)\n    end\n  end\nend\n```\n\n[View the imported_asset_processor test](features/test_cases/imported_asset_processor.feature) for an example using a class.\n\n\n**`expose_middleman_helpers` [default: false]**\n\nSometimes you might need sprockets to have access helpers (for example using different keys depending on deployment environment). Getting this to happen is bound to be full of edge cases, so for now it's behind a configuration option.\n\nIf you need [Middleman helpers in your Sprockets](http://i.imgur.com/fINMSsz.jpg), in `config.rb`:\n\n```ruby\nactivate :sprockets do |c|\n  c.expose_middleman_helpers = true\nend\n```\n\n\n## Build \u0026 Dependency Status\n\n[![Gem Version](https://badge.fury.io/rb/middleman-sprockets.svg)][gem]\n[![Build Status](https://travis-ci.org/middleman/middleman-sprockets.svg)][travis]\n[![Dependency Status](https://gemnasium.com/middleman/middleman-sprockets.svg?travis)][gemnasium]\n[![Code Quality](https://codeclimate.com/github/middleman/middleman-sprockets.svg)][codeclimate]\n\n\n## Community\n\nThe official community forum is available at: http://forum.middlemanapp.com\n\n\n## Bug Reports\n\nGithub Issues are used for managing bug reports and feature requests. If you run into issues, please search the issues and submit new problems: https://github.com/middleman/middleman-sprockets/issues\n\nThe best way to get quick responses to your issues and swift fixes to your bugs is to submit detailed bug reports, include test cases and respond to developer questions in a timely manner. Even better, if you know Ruby, you can submit [Pull Requests](https://help.github.com/articles/using-pull-requests) containing Cucumber Features which describe how your feature should work or exploit the bug you are submitting.\n\n\n## How to Run Cucumber Tests\n\n1. Checkout Repository: `git clone https://github.com/middleman/middleman-sprockets.git`\n2. Install Bundler: `gem install bundler`\n3. Run `bundle install` inside the project root to install the gem dependencies.\n4. Run test cases: `bundle exec rake test`\n\nTo run specs for an individual feature, `cucumber features/PATH_TO_FEATURE`\n\n## Donate\n\n[Click here to lend your support to Middleman](https://spacebox.io/s/4dXbHBorC3)\n\n\n## License\n\nCopyright (c) 2012-2016 Thomas Reynolds. MIT Licensed, see [LICENSE] for details.\n\n[middleman]: http://middlemanapp.com\n[gem]: https://rubygems.org/gems/middleman-sprockets\n[travis]: http://travis-ci.org/middleman/middleman-sprockets\n[gemnasium]: https://gemnasium.com/middleman/middleman-sprockets\n[codeclimate]: https://codeclimate.com/github/middleman/middleman-sprockets\n[LICENSE]: https://github.com/middleman/middleman-sprockets/blob/master/LICENSE.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiddleman%2Fmiddleman-sprockets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiddleman%2Fmiddleman-sprockets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiddleman%2Fmiddleman-sprockets/lists"}