Skip to content

Instantly share code, notes, and snippets.

View jdlich's full-sized avatar

Jacob Lichner jdlich

View GitHub Profile
---
---
/*
Typography
-------------------------------------------------------------- */
# encoding: utf-8
desc 'Removes all stray files from the output directory'
task :clean_all do
puts '=== Removing stray files from output directory…'
# Get static files
static_files = Dir['assets/**/*'].select { |f| File.file?(f) }.map { |f| f.sub(/^assets\//, 'output/') }
# Get compiled files
<% for home in homes do %>
<div>
<a href="<%= home.path %>">
<img src="<%= home.image_folder %>/thumbnail.jpg" alt="<%= home.thumbnail_alt_text %>" />
</a>
</div>
<% end %>
<% for home in homes do %>
<div>
<a href="<%= home.path %>">
<img src="<%= home.image_folder %>/thumbnail.jpg" alt="<%= home.thumbnail_alt_text %>" />
</a>
</div>
<% end %>
require 'nanoc3'
include Nanoc3::Helpers::Formatting
# load rake tasks
Dir['tasks/**/*.rake'].sort.each { |rakefile| load rakefile }
require Nanoc3::Helpers::Formatting
# load rake tasks
Dir['tasks/**/*.rake'].sort.each { |rakefile| load rakefile }
include Nanoc3::Helpers::Formatting
# load rake tasks
Dir['tasks/**/*.rake'].sort.each { |rakefile| load rakefile }
class Home
require 'yaml'
def initialize item
@item = item
attributes = File.expand_path('content' + @item.identifier.gsub(/\/$/,'') + '.yaml')
attributes = File.open(attributes) { |a| YAML::load(a) }.keys
attributes.map do |attribute|
require 'home.rb'
#
# Default
#
include Nanoc3::Helpers::Rendering
include Nanoc3::Helpers::Capturing
#
# Custom