Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

start local server (sinatra) with 'ruby app.rb'

  • Loading branch information...
commit fe81c88a836d68b6800d01637a76c77e59ad3604 1 parent 74d343b
@tlossen tlossen authored
View
4 .gitignore
@@ -1,5 +1,5 @@
-dump.rdb
*~
*.pyc
*.swp
-www/*
+dump.rdb
+public/*
View
12 Rakefile
@@ -5,17 +5,17 @@ require 'yaml'
task :default do
# copy static stuff
- `rm -rf www
- mkdir www
- cp -r site/* www
- rm -rf www/_*`
+ `rm -rf public
+ mkdir public
+ cp -r site/* public
+ rm -rf public/_*`
# generate recipe pages
layout = Liquid::Template.parse(open('site/_views/layout.liquid').read())
recipes = Dir['recipes/*/*/recipe.md'].map do |source|
meta = YAML.load(open(source.sub('/recipe.md', '/meta.yml')).read())
name = source.split('/')[-2] + '.html'
- puts dest = "www/#{name}"
+ puts dest = "public/#{name}"
open(dest, 'w') do |out|
content = RDiscount.new(open(source).read()).to_html
out.write layout.render('meta' => meta, 'content' => content)
@@ -25,7 +25,7 @@ task :default do
# generate index page
index = Liquid::Template.parse(open('site/_views/index.liquid').read())
- puts dest = 'www/index.html'
+ puts dest = 'public/index.html'
open(dest, 'w') do |out|
content = index.render('recipes' => recipes)
meta = { 'title' => 'Recipes' }
View
6 app.rb
@@ -0,0 +1,6 @@
+require 'rubygems'
+require 'sinatra'
+
+get '/' do
+ redirect '/index.html'
+end
View
4 site/_views/layout.liquid
@@ -2,14 +2,14 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Redis Cookbook</title>
- <link rel="stylesheet" href="css/style.css" />
+ <link rel="stylesheet" href="/css/style.css" />
</head>
<body>
<a href="http://github.com/rediscookbook/rediscookbook"><img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png" alt="Fork me on GitHub" /></a>
<div class='header'>
- <h1><a href='index.html'><img src="img/header1.png" border="0" alt="Redis Cookbook"></a></h1>
+ <h1><a href='index.html'><img src="/img/header1.png" border="0" alt="Redis Cookbook"></a></h1>
</div>
<div class='main'>
View
4 site/css/style.css
@@ -46,7 +46,7 @@ h4 {
padding-left: 100px;
top: 0px;
height: 100px;
- background-image:url('img/bg3.png');
+ background-image:url('/img/bg3.png');
background-color: #B30415;
border-bottom:2px solid #999;
}
@@ -69,7 +69,7 @@ h4 {
}
.content li {
- list-style-image: url("img/icon1.png");
+ list-style-image: url("/img/icon1.png");
list-style-type: square;
}
Please sign in to comment.
Something went wrong with that request. Please try again.