Skip to content

Instantly share code, notes, and snippets.

@rosenfeld
rosenfeld / README.txt
Last active November 15, 2018 09:48
Sprite generator to replace compass (only Ruby and ImageMagick are required)
This was created to replace compass in a Rails project.
The generator supports multiple themes and the sprite dimensions are available in a dimensions.sass file as variables.
There are no other dependencies than Ruby and ImageMagick binaries (or compatible commands with convert and identify).
The image name contains an MD5 hash of all images content and is stored directly into public/assets
so that the resulting CSS doesn't depend on sprockets.
It took about 0.2s to generate two theme sprites for me with about 30 images each.
@egardner
egardner / config.rb
Last active October 7, 2022 09:54
PDF Output for Middleman
# Only the relevant parts of config.rb are included here
require "extensions/pdf"
# ...
configure :build do
activate :pdf do |pdf|
pdf.print_template = "/catalogue/print-template.html"
end
end