-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-- Add forgery for fake data generation during template creation -- Add sitemap_generator gem to help with creating XML sitemaps -- Add automatic sitemap generation on successful build via custom extension -- Add wrapped layout for blog articles -- Compress js and css during build -- Add article partial -- Add pagination partial -- Refactor index, calendar, tag templates to use pagination and article partials -- Use CDN for jquery
- Loading branch information
Showing
14 changed files
with
213 additions
and
84 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require 'sitemap_generator' | ||
|
||
module GoogleSitemapGenerator | ||
class << self | ||
def registered(app) | ||
app.after_build do |builder| | ||
app_sitemap = sitemap # avoid name conflict | ||
SitemapGenerator::Sitemap.default_host = "http://mattolson.com" | ||
SitemapGenerator::Sitemap.create(:public_path => 'build', :verbose => true) do | ||
app_sitemap.resources.each do |r| | ||
add(r.url) if r.ext == '.html' | ||
end | ||
end | ||
end | ||
end | ||
alias :included :registered | ||
end | ||
end | ||
|
||
::Middleman::Extensions.register(:sitemap_generator, GoogleSitemapGenerator) | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<div class="row"> | ||
<article class="nine columns"> | ||
<h3> | ||
<% if digest %> | ||
<%= link_to article.title, article %> | ||
<% else %> | ||
<%= article.title %> | ||
<% end %> | ||
</h3> | ||
|
||
<% if digest %> | ||
<%= article.summary %> | ||
<% else %> | ||
<%= article.body %> | ||
<% end %> | ||
|
||
<% if digest && article.summary.length < article.body.length %> | ||
<%= link_to 'Read more →', article.url, :class => 'secondary button radius' %> | ||
<% end %> | ||
|
||
<% unless digest %> | ||
<ul class="read_next"> | ||
<li><%= article.previous_article ? link_to("« #{article.previous_article.title}", article.previous_article) : " " %></li> | ||
<li><%= article.next_article ? link_to("#{article.next_article.title} »", article.next_article) : " " %></li> | ||
</ul> | ||
|
||
<div id="disqus_thread"></div> | ||
<script type="text/javascript"> | ||
var disqus_shortname = ''; | ||
(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">comments powered by <span class="logo-disqus">Disqus</span></a> | ||
<% end %> | ||
</article> | ||
<aside class="three columns"> | ||
<ul class="credit"> | ||
<li class="time">Posted on <time datetime="<%= article.date.strftime('%Y-%m-%d') %>"><%= article.date.strftime('%A %b %e, %Y') %></time></li> | ||
</ul> | ||
<ul class="tags"> | ||
<% article.tags.each do |tag| %> | ||
<li><%= link_to tag, tag_path(tag), :class => 'tiny button secondary round' %></li> | ||
<% end %> | ||
</ul> | ||
</aside> | ||
</div> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<% if paginate && num_pages > 1 %> | ||
<div class="pagination-centered"> | ||
<ul class="pagination"> | ||
<% if prev_page %> | ||
<li class="arrow<%= prev_page.nil? ? ' unavailable' : '' %>"><%= link_to '« Newer', prev_page %></li> | ||
<% end %> | ||
<% | ||
(1..num_pages).each do |i| | ||
if i == page_number %> | ||
<li class="current unavailable"><%= link_to "#{i}", '#' %></li> | ||
<% else | ||
p = nil | ||
if i < page_number | ||
(i...page_number).each do p = p ? p.metadata[:locals]['prev_page'] : prev_page; end | ||
else | ||
(page_number...i).each do p = p ? p.metadata[:locals]['next_page'] : next_page; end | ||
end | ||
%> | ||
<li><%= link_to "#{i}", p && p.url %></li> | ||
<% end %> | ||
<% end %> | ||
<% if next_page %> | ||
<li class="arrow<%= next_page.nil? ? ' unavailable' : '' %>"><%= link_to 'Older »', next_page %></li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
<% end %> |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,24 @@ | ||
--- | ||
pageable: true | ||
per_page: 12 | ||
--- | ||
<h1>Articles tagged '<%= tagname %>'</h1> | ||
|
||
<% if paginate %> | ||
<p>Page <%= page_number %> of <%= num_pages %></p> | ||
|
||
<% if prev_page %> | ||
<p><%= link_to 'Previous page', prev_page %></p> | ||
<% end %> | ||
<% end %> | ||
<ul class="breadcrumbs"> | ||
<li><a href="/">Home</a></li> | ||
<li class="current"><a href="<%= tag_path tagname %>"><%= tagname %></a></li> | ||
</ul> | ||
|
||
<ul> | ||
<div class="articles"> | ||
<% page_articles.each_with_index do |article, i| %> | ||
<li><%= link_to article.title, article %> <span><%= article.date.strftime('%b %e') %></span></li> | ||
<% if i > 0 %> | ||
<hr /> | ||
<% end %> | ||
<%= partial '/blog/article', :locals => {:article => article, :digest => true} %> | ||
<% end %> | ||
</ul> | ||
</div> | ||
|
||
<% if paginate %> | ||
<% if next_page %> | ||
<p><%= link_to 'Next page', next_page %></p> | ||
<% end %> | ||
<% end %> | ||
<%= partial '/blog/pagination', :locals => { | ||
:paginate => paginate, | ||
:next_page => next_page, | ||
:prev_page => prev_page, | ||
:num_pages => num_pages, | ||
:page_number => page_number | ||
} %> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
--- | ||
pageable: true | ||
per_page: 10 | ||
--- | ||
<% page_articles.each_with_index do |article, i| %> | ||
<h3><%= link_to article.title, article %></h3> | ||
<p><%= article.date.strftime('%b %e') %></p> | ||
<p><%= article.summary %></p> | ||
<% end %> | ||
|
||
<% if paginate %> | ||
<% if prev_page %> | ||
<p><%= link_to 'Previous page', prev_page %></p> | ||
<div class="articles"> | ||
<% page_articles.each_with_index do |article, i| %> | ||
<% if i > 0 %> | ||
<hr /> | ||
<% end %> | ||
<%= partial '/blog/article', :locals => {:article => article, :digest => true} %> | ||
<% end %> | ||
</div> | ||
|
||
<p>Page <%= page_number %> of <%= num_pages %></p> | ||
|
||
<% if next_page %> | ||
<p><%= link_to 'Next page', next_page %></p> | ||
<% end %> | ||
<% end %> | ||
<%= partial '/blog/pagination', :locals => { | ||
:paginate => paginate, | ||
:next_page => next_page, | ||
:prev_page => prev_page, | ||
:num_pages => num_pages, | ||
:page_number => page_number | ||
} %> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
//= require jquery | ||
//= require foundation | ||
//= require jquery.fancybox | ||
//= require jquery.fancybox-media | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<% wrap_layout :layout do %> | ||
<%= partial '/blog/article', :locals => {:article => current_article, :digest => false} %> | ||
<% end %> |
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
Oops, something went wrong.