Project

snow

0.0
No commit activity in last 3 years
No release in over 3 years
Generate static pages with ease, using a layout for public/404.html, etc
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 3.0.0
 Project Readme

Snow¶ ↑

Generate static pages with ease.

Snow makes it easy to use a layout in app/views/layouts/ for pages like public/404.html and public/500.html. Think of it like HighVoltage, but for static files that live in public.

Installation¶ ↑

Snow is currently in alpha. Effectively, there’s just a README right now, as we still need to extract some code from a project.

To install:

gem install snow --pre

Or in your Gemfile:

gem "snow", "~> 0.1.0.alpha.1" # or newer version as appropriate

Tutorial¶ ↑

Snow adds the following rake tasks by default:

rake statics      # Render all statics to files
rake statics:404  # Render static 404 page with layout
rake statics:422  # Render static 422 page with layout
rake statics:500  # Render static 500 page with layout

Snow uses actions in a controller named StaticsController. Essentially, rake statics does this:

app/views/statics/not_found.html.erb      =>  public/404.html
app/views/statics/unprocessable.html.erb  =>  public/422.html
app/views/statics/server_error.html.erb   =>  public/500.html

This is a one time rendering so that you don’t have to resort to any strange ApplicationController/Rails changes just to easily have a layout for your statics.

Did your layout change? Just run rake statics and all the statics will be refreshed.