Created
March 18, 2012 17:35
-
-
Save heatherm/2078289 to your computer and use it in GitHub Desktop.
toto with github highlights and disqus
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<article class="post"> | |
<header> | |
<h1><%= title %></h1> | |
<span class="date"><%= date %></span> | |
</header> | |
<section class="content"> | |
<%= body %> | |
</section> | |
<section class="comments"> | |
<% if @config[:disqus] %> | |
<div id="disqus_thread"></div> | |
<script type="text/javascript"> | |
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */ | |
var disqus_shortname = 'heathrmoor'; // required: replace example with your forum shortname | |
/* * * DON'T EDIT BELOW THIS LINE * * */ | |
(function() { | |
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; | |
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js'; | |
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); | |
})(); | |
</script> | |
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> | |
<a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a> | |
<% end %> | |
</section> | |
</article> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'toto' | |
require File.expand_path('../config/environment.rb', __FILE__) | |
use Rack::Static, :urls => ['/stylesheets', '/javascripts', '/images', | |
'/favicon.ico'], :root => 'public' | |
use Rack::ShowExceptions | |
use Rack::CommonLogger | |
toto = Toto::Server.new do | |
Toto::Paths = { | |
:templates => 'blog/templates', | |
:pages => 'blog/templates/pages', | |
:articles => 'blog/articles' | |
} | |
set :date, lambda {|now| now.strftime("%B #{now.day.ordinal} %Y") } | |
set :summary, :max => 500 | |
set :prefix, "blog" | |
set :disqus, "heathrmoor" | |
set :title, 'Heather Moore' | |
set :url, 'http://heathrmoor.com/blog' | |
end | |
app = Rack::Builder.new do | |
use Rack::Logger | |
map '/blog' do | |
run toto | |
end | |
map '/' do | |
run MyAppThatHasTotoInside::Application | |
end | |
end.to_app | |
run app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section id="articles"> | |
<% for article in articles[0...3] %> | |
<article class="post"> | |
<header> | |
<h1><a href="<%= article.path %>"><%= article.title %></a></h1> | |
<div><a href="<%= article.path %>#disqus_thread"></a></div> | |
<span class="date"><%= article.date %></span> | |
</header> | |
<section class="content"> | |
<%= article.summary %> | |
</section> | |
<div class="more"><a href="<%= article.path %>">read on »</a></div> | |
</article> | |
<% end %> | |
</section> | |
<section id="archives"> | |
<%= archives[3..-1] %> | |
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<link rel="alternate" type="application/atom+xml" title="<%= title %> - feed" href="/index.xml" /> | |
<script src="http://yandex.st/highlightjs/6.1/highlight.min.js"></script> | |
<link rel="stylesheet" href="http://yandex.st/highlightjs/6.1/styles/github.min.css"> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | |
<title>hm | blog</title> | |
</head> | |
<body class="blog"> | |
<section> | |
<%= yield %> | |
</section> | |
<script type="text/javascript"> | |
hljs.initHighlighting(); | |
</script> | |
<footer> | |
powered by <a href="http://cloudhead.io/toto">toto</a> | |
</footer> | |
<script type="text/javascript"> | |
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */ | |
var disqus_shortname = 'heathrmoor'; // required: replace example with your forum shortname | |
/* * * DON'T EDIT BELOW THIS LINE * * */ | |
(function () { | |
var s = document.createElement('script'); s.async = true; | |
s.type = 'text/javascript'; | |
s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; | |
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); | |
}()); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment