Skip to content

Commit

Permalink
Working on official Stasis site
Browse files Browse the repository at this point in the history
  • Loading branch information
winton committed Jul 3, 2011
1 parent 6ffd6a1 commit f670b8b
Show file tree
Hide file tree
Showing 7 changed files with 150 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -3,5 +3,7 @@
coverage
docs
pkg
site/.sass-cache
site/public
spec/fixtures/project/public
tmp
2 changes: 1 addition & 1 deletion config/gemsets.yml
Expand Up @@ -5,5 +5,5 @@ stasis:
rocco: ~>0.6
rspec: ~>1.0
slop: ~>1.6.0
tilt: ~>1.2
tilt: ~>1.3
yajl-ruby: ~>0.8.2
8 changes: 4 additions & 4 deletions lib/stasis/auto.rb
Expand Up @@ -9,8 +9,7 @@ def initialize(dir)

puts "\nAuto-regenerating enabled: #{dir}"

@stasis = Stasis.new(dir)
generate
generate(dir)

dw = DirectoryWatcher.new(@stasis.root)
dw.interval = 1
Expand All @@ -28,7 +27,7 @@ def initialize(dir)

dw.add_observer do |*events|
modified = events.detect { |e| e[:type] == :modified }
generate if modified
generate(dir) if modified
end

dw.start
Expand All @@ -37,9 +36,10 @@ def initialize(dir)

private

def generate
def generate(dir)
puts "\n[#{Time.now.strftime("%Y-%m-%d %H:%M:%S")}] Auto-regenerating project..."
begin
@stasis = Stasis.new(dir)
@stasis.generate
rescue Exception => e
puts "\n[#{Time.now.strftime("%Y-%m-%d %H:%M:%S")}] Error: #{e.message}`"
Expand Down
10 changes: 10 additions & 0 deletions site/controller.rb
@@ -0,0 +1,10 @@
require 'nokogiri'

before 'index.html.haml' do
@readme = Nokogiri::HTML(render('../README.md')).css('body')
@readme.children.each do |node|
break if node.name == 'h2'
node.remove
end
@readme = @readme.inner_html
end
36 changes: 36 additions & 0 deletions site/index.html.haml
@@ -0,0 +1,36 @@
!!! 5
%html
%head
%title Stasis - Static Sites Made Powerful
%link{ :href => "stasis.css", :media => "screen", :rel => "stylesheet", :type => "text/css" }
%link{ :href => "http://fonts.googleapis.com/css?family=Amaranth|Open+Sans:400,600,700&v2", :rel => "stylesheet", :type => "text/css" }
%body
%ul
%li
%a{ :href => '#install' } Install
%li
%a{ :href => '#templates' } Templates
%li
%a{ :href => '#controllers' } Controllers
%li
%a{ :href => '#before' } Before
%li
%a{ :href => '#layouts' } Layouts
%li
%a{ :href => '#ignore' } Ignore
%li
%a{ :href => '#render' } Render
%li
%a{ :href => '#instead' } Instead
%li
%a{ :href => '#helpers' } Helpers
%li
%a{ :href => '#priority' } Priority
%li
%a{ :href => '#more' } More
#title
%img{ :src => 'stasis.png' }>
stasis
%img.reverse{ :src => 'stasis.png' }>
#tm Static Sites Made Powerful
#body~ @readme
97 changes: 97 additions & 0 deletions site/stasis.css.scss
@@ -0,0 +1,97 @@
// normal: 400, semi-bold: 600, bold: 700
// font-family: 'Amaranth', sans-serif;
// font-family: 'Open Sans', sans-serif;

a {
color: #2281D1;
text-decoration: none;
}

a:hover {
text-decoration: underline;
}

body {
background-color: #333435;
color: #CCD7E1;
font-family: 'Open Sans', sans-serif;
font-weight: 400;
margin: 0;
}

ul {
background-color: #CCD7E1;
font-size: 13px;
font-weight: 600;
margin: 0;
padding: 0;
text-align: center;

li {
display: inline;
line-height: 25px;
padding: 0 12px;
}
}

#title {
color: #3393E4;
font-family: 'Amaranth', sans-serif;
font-size: 110px;
font-weight: 400;
margin-top: 25px;
text-align: center;
text-shadow: 0px 5px 1px rgba(0,0,0,0.07);

-webkit-mask-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0, rgba(7,59,102,0.6)),
color-stop(0.6, rgba(255,255,255,1))
);

img {
margin: 0 10px;
}

img.reverse {
-moz-transform: scaleX(-1);
-webkit-transform: scaleX(-1);
-o-transform: scaleX(-1);
transform: scaleX(-1);
filter: fliph;
}
}

#tm {
font-size: 19.4px;
font-weight: 700;
margin-top: 30px;
text-align: center;
}

#body {
margin: 60px auto 0;
width: 800px;

h2 {
border-bottom: 1px solid #484C4F;
clear: both;
font-size: 19.4px;
padding: 20px 0 5px;
}

pre {
background-color: #282929;
clear: both;
float: right;
padding: 10px 15px 10px 20px;
width: 390px;

-webkit-box-shadow: rgba(0, 0, 0, 0.25) 0 1px 2px inset;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
}
Binary file added site/stasis.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f670b8b

Please sign in to comment.