Skip to content

Commit cdcc842

Browse files
author
aeoth
committed
fixed up post layout
1 parent 723a3bb commit cdcc842

File tree

4 files changed

+44
-5
lines changed

4 files changed

+44
-5
lines changed

_layouts/post.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
layout: default
2+
layout: layout
33
---
44
<div class="entry-container">
55
<div class='entry'>

_site/config.ru

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ require "rack/rewrite"
44

55
use Rack::Static, :urls => ["/css", "/img", "/js" ]
66
use Rack::Rewrite do
7-
#rewrite %r{/(.*)}, '/$1.html', :if => lambda { File.exists?('/$1.html')}
7+
rewrite %r{/(.+)}, lambda { |match, rack_env|
8+
if File.exists?('_site/' + match[1] + '.html')
9+
return '/' + match[1] + '.html'
10+
else
11+
return '/' + match[1]
12+
end
13+
}
814
end
915

1016
run Rack::Jekyll.new

_site/idea1.html

+29-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,26 @@
1-
<div class="entry-container">
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2+
<html xmlns="http://www.w3.org/1999/xhtml">
3+
<head>
4+
<meta content="en-au" http-equiv="Content-Language" />
5+
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
6+
<title>Code52</title>
7+
<link rel="stylesheet" type="text/css" href="/css/style.css" />
8+
</head>
9+
<body>
10+
<div id="container">
11+
<div id="side">
12+
code
13+
<h1>52</h1>
14+
<h2>a new coding project every week</h2>
15+
16+
<ul>
17+
<li><a href="#">about</a></li>
18+
<li><a href="#">submit an idea</a></li>
19+
<li><a href="#">past ideas</a></li>
20+
</ul>
21+
</div>
22+
<div id="content">
23+
<div class="entry-container">
224
<div class='entry'>
325
<h1> Idea 1: Cupcake ipsum dolor sit amet marshmallow. </h1>
426
<span class="postdate">14 December, 2011
@@ -34,4 +56,9 @@ <h1> Idea 1: Cupcake ipsum dolor sit amet marshmallow. </h1>
3456
})();
3557
</script>
3658
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
37-
<a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
59+
<a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
60+
</div>
61+
62+
</div>
63+
</body>
64+
</html>

config.ru

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ require "rack/rewrite"
44

55
use Rack::Static, :urls => ["/css", "/img", "/js" ]
66
use Rack::Rewrite do
7-
#rewrite %r{/(.*)}, '/$1.html', :if => lambda { File.exists?('/$1.html')}
7+
rewrite %r{/(.+)}, lambda { |match, rack_env|
8+
if File.exists?('_site/' + match[1] + '.html')
9+
return '/' + match[1] + '.html'
10+
else
11+
return '/' + match[1]
12+
end
13+
}
814
end
915

1016
run Rack::Jekyll.new

0 commit comments

Comments
 (0)