Skip to content

Generate static pages with ease, using a layout for public/404.html, etc

Notifications You must be signed in to change notification settings

hedgeyedev/snow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Generate static pages with ease, using a layout for public/404.html, etc

Resources

Stars

Watchers

Forks

Packages

No packages published