Proton is the cleanest way to create static sites for any occassion.
Proton solves the common problems plaguing
creating sites.
Here's how:
<html> <head> <title> <%= meta.title %> </title> </head> <body><%= yield %></body> </html>
Create a layout in _layouts/default.html
.
title: Hello world! ---<h1>Welcome!</h1><p>This is my page.</p>
Never repeat yourself again by creating layouts. Just create a layout page, and use the tag <%= yield %> to mark where the content should go.
<html> <head> <title>Hello world!</title> </head> <body> <div id='container'><h1>Welcome!</h1><p>This is my page.</p></div> </body> </html>
Notice how the layout’s <%= meta.title %> tag pulled what’s in the title: Hello world! line. You can define metadata in your files.
proton build
LOL
Once you have your output folder, simply upload it to a server, send it to your client, whatever—it’s ready to work.
h1(hello). Hello from Proton via textile! Lorem *ipsum* dolor sit amet, consecteteur...
%div.article %h1 Hello from Proton via HAML! %p Lorem ipsum dolor sit amet, consecteteur...
Write your HTML in terse, error-resistant HAML. HAML lets you generate HTML files from a simpler syntax.
$red: #833; .article { h1 { color: $red; } p { line-height: 1.5; } }
You can use variables, nested rules, mixins, and other conveniences in your CSS files! Powered by Sass CSS.
$ proton build
After typing proton build
, Proton will create the output folder for you. Anything that’s not supported is simply copied over.
<div class='article'> <h1>Hello from Proton via Textile!</h1> <p>Lorem <em>ipsum</em> dolor sit amet, consecteteur...</p> </div>
Proton automatically guesses file extensions. Textile files, for instance, become .html
files…
.article h1 { color: #833; } .article p { line-height: 1.5; }
…and SCSS files become .css
. You may specify your own extensions if need be.
Proton works by taking a folder with files in any template format (Markdown, HAML, etc), and magically creating the output files (HTML, CSS, etc) for you.
Proton takes this folder of files and crunches them.
You may write your pages with the simple markup styles of Markdown, and let Proton take care of converting it to HTML for you. It will even apply layouts to it.
|
→ | HTML |
You can take advantage of the beautiful syntax of HAML in your sites.
|
→ | HTML |
Ever wanted to have nested CSS rules? Variables? Mixins? Now you can do these with static sites.
|
→ | CSS |
And finally...
Yes, all these benefits are optional!
$ gem install proton
$ proton
Also, read the manual.
Proton manual →