Skip to content

Commit

Permalink
Revert "Added Slim gem"
Browse files Browse the repository at this point in the history
This reverts commit 4ff1f9f.

reverting this commit
  • Loading branch information
kgrz committed Feb 11, 2013
1 parent 4ff1f9f commit d66800a
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 143 deletions.
2 changes: 1 addition & 1 deletion Gemfile
@@ -1,7 +1,7 @@
source :rubygems
gem "sinatra"
gem "sass"
gem "rdiscount"
gem "rack-cache"
gem "thin"
gem "json"
gem "slim"
178 changes: 99 additions & 79 deletions app.rb
@@ -1,9 +1,9 @@
require 'sinatra'
require 'rdiscount'
require 'erb'
require 'sass'
require 'json'
require 'open-uri'
require 'slim'

set :public_folder, File.dirname(__FILE__) + '/public'
configure :production do
Expand All @@ -19,7 +19,7 @@
end
end

set :markdown, :layout_engine => :slim
set :markdown, :layout_engine => :erb
set :views, File.dirname(__FILE__)
set :ignored_dirs, %w[tmp log config public bin]

Expand All @@ -31,12 +31,10 @@
end

get '/' do
begin
open("https://api.github.com/repos/sinatra/sinatra-recipes/contributors") do |api|
@contributors = JSON.parse(api.read)
end
rescue SocketError => e
end
open("https://api.github.com/repos/sinatra/sinatra-recipes/contributors") { |api|
@contributors = JSON.parse(api.read)
}

markdown :README
end

Expand All @@ -59,78 +57,100 @@
__END__

@@ layout
doctype 5
html
head
meta charset="utf-8"
meta http-equiv="X-UA-Compatible" content="chrome=1"
title Sinatra Recipes
link rel="stylesheet" type="text/css" href="/stylesheets/styles.css"
link rel="shortcut icon" href="https://github.com/sinatra/resources/raw/master/logo/favicon.ico"
script src="/javascripts/scale.fix.js"
script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"
body
#wrapper
aside
header
img src="https://github.com/sinatra/resources/raw/master/logo/sinatra-classic-156.png"
h1 Sinatra Recipes
p Comunity contributed recipes and techniques
p.view
a href="http://github.com/sinatra/sinatra-recipes"
| View the Project on GitHub <small>sinatra/sinatra</small>
ul
li
a href="https://github.com/sinatra/sinatra-recipes/zipball/master"
| Download <strong>ZIP File</strong>
li
a href="https://github.com/sinatra/sinatra-recipes/tarall/master"
| Download <strong>TAR File</strong>
li
a href="https://github.com/sinatra/sinatra-recipes"
| Fork on <strong>GitHub</strong>

nav
h2 Topics
dl
- @menu.each do |me|
dt
a href="/p/#{me}" #{me.capitalize.sub('_', ' ')}
p
small Theme by <a href="https://github.com/orderedlist">orderedlist</a>
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>Sinatra Recipes</title>
<link rel="stylesheet" type="text/css" href="/stylesheets/styles.css" />
<link rel="stylesheet" type="text/css" href="/stylesheets/pygment_trac.css" />
<link rel="shortcut icon" href="https://github.com/sinatra/resources/raw/master/logo/favicon.ico">
<script src="/javascripts/scale.fix.js"/>
<script type='text/javascript'
src='https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js'>
</script>
</head>
<body>
<div class="wrapper">
<aside>
<header>
<img src="https://github.com/sinatra/resources/raw/master/logo/sinatra-classic-156.png" />
<h1>
Sinatra Recipes
</h1>
<p>Community contributed recipes and techniques</p>
<p class="view"><a href="http://github.com/sinatra/sinatra-recipes">View the Project on GitHub <small>sinatra/sinatra-recipes</small></a></p>
<ul>
<li><a href="https://github.com/sinatra/sinatra-recipes/zipball/master">Download <strong>ZIP File</strong></a></li>
<li><a href="https://github.com/sinatra/sinatra-recipes/tarball/master">Download <strong>TAR Ball</strong></a></li>
<li><a href="http://github.com/sinatra/sinatra-recipes">Fork On <strong>GitHub</strong></a></li>
</ul>
</header>
<nav>
<h2>Topics</h2>
<dl>
<% @menu.each do |me| %>
<dt>
<a href='/p/<%= "#{me}" %>'>
<%= me.capitalize.sub('_', ' ') %>
</a>
</dt>
<% end %>
</dl>
</nav>
</aside>
<section>
<div id="post">
<%= yield %>
<% if @children %>
<div id="children">
<ul>
<% @children.each do |child| %>
<li>
<a href='/p/<%= "#{params[:topic]}/#{child}" %>'>
<%= child.capitalize.sub('_', ' ') %>
</a>
</li>
<% end %>
</ul>
</div>
<% end %>

section
#post
== yield
- if @children
ul
- @children.each do |child|
li
a href="/p/#{params[:topic]}/#{child}"
== child.capitalize.sub('_', ' ')
<% if @readme %>
<div id="footer">
<h2>Did we miss something?</h2>
<p>It's very possible we've left something out, thats why we need your help! This
is a community driven project after all. Feel free to fork the project and send
us a pull request to get your recipe or tutorial included in the book.</p>
<p>See the <a href="http://github.com/sinatra/recipes/blob/master/README.md">README</a> for more details.</p>
</div>
<% end %>

- if @readme
#footer
h2 Did we miss something?
p
| It's very possible we've left something out, that's why we need your help!
| This is a community driven project after all. Feel free to fork the project
| and send us a pull request to get your recipe or tutorial included in the book.
p
| See the <a href="http://github.com/sinatra/recipes/blob/master/README.md">README</a>
| for more details.

- if @contributors
h2 Contributors
p
| These recipes are provided by the following outsanding members of the Sinatra
| community:
ul id="contributors"
- @contributors.each do |contributor|
li
a href="http://github.com/#{contributor["login"]}"
img src="http://www.gravatar.com/avatar/#{contributor["gravatar_id"]}?s=50"
<% if @contributors %>
<h2>Contributors</h2>
<p>These recipes are provided by the following outstanding members of the Sinatra community:</p>
<ul id="contributors">
<% @contributors.each do |contributor| %>
<li>
<a href="http://github.com/<%= contributor["login"] %>">
<img src="http://www.gravatar.com/avatar/<%= contributor["gravatar_id"] %>?s=50" />
</a>
</li>
<% end %>
</ul>
<% end %>
</div>
</section>

<footer>
<p><small>Theme by <a href="https://github.com/orderedlist">orderedlist</a></small></p>
</footer>
<a href="http://github.com/sinatra/sinatra-recipes">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub" />
</a>
</div>
</body>
</html>

a href="http://github.com/sinatra/sinatra-recipes"
img style="position: absolute;top:0;right:0;border:0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"

72 changes: 9 additions & 63 deletions public/stylesheets/styles.css
Expand Up @@ -106,9 +106,7 @@ img {
aside {
float:left;
position:fixed;
/* width:270px; */
min-width: 270px;
max-width: 440px;
width:270px;
}

header ul {
Expand Down Expand Up @@ -219,7 +217,7 @@ footer {
width:270px;
float:left;
position:fixed;
bottom:10px;
bottom:50px;
}

@media print, screen and (max-width: 960px) {
Expand All @@ -230,47 +228,36 @@ footer {
}

header, section, footer {
float:left;
float:none;
position:static;
width:auto;
}

header {
padding-right:120px;
padding-right:320px;
}

section {
border:0px solid #e5e5e5;
border-width:0px 0;
border:1px solid #e5e5e5;
border-width:1px 0;
padding:20px 0;
margin:0 0 20px;
float: right;
}

header a small {
display:inline;
}

header ul {
position:relative;
}

nav {
float: left;
padding-left: 20px;
position:absolute;
right:50px;
top:52px;
}
aside {
position: relative;
max-width: 920px;
min-width: 400px;
}

}

@media print, screen and (max-width: 720px) {
body {
word-wrap:break-word;
padding: 15px;
}

header {
Expand All @@ -284,57 +271,16 @@ footer {
pre, code {
word-wrap:normal;
}

nav {
float: left;
}

section {
float:none;
min-width: 440px;
max-width: 440px;
border-width: 0 0;
width: auto;
}

aside {
max-width: 150px;
float: left;
}

}

@media print, screen and (max-width: 480px) {
body {
padding:15px;
}

aside {
float: left;
}

nav {
float: left;
}

section {
border-width: 0 0;
max-width: 380px;
min-width: 50px;
float:none;
width: auto;
}

header ul {
display:none;
}

aside {
min-width: 50px;
max-width: 320px;
float:left;
}

}

@media print {
Expand Down

0 comments on commit d66800a

Please sign in to comment.