This file contains hidden or 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 'home.rb' | |
# | |
# Default | |
# | |
include Nanoc3::Helpers::Rendering | |
include Nanoc3::Helpers::Capturing | |
# | |
# Custom |
This file contains hidden or 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
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| |
This file contains hidden or 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
include Nanoc3::Helpers::Formatting | |
# load rake tasks | |
Dir['tasks/**/*.rake'].sort.each { |rakefile| load rakefile } | |
This file contains hidden or 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 Nanoc3::Helpers::Formatting | |
# load rake tasks | |
Dir['tasks/**/*.rake'].sort.each { |rakefile| load rakefile } |
This file contains hidden or 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 'nanoc3' | |
include Nanoc3::Helpers::Formatting | |
# load rake tasks | |
Dir['tasks/**/*.rake'].sort.each { |rakefile| load rakefile } | |
This file contains hidden or 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
<% 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 %> |
This file contains hidden or 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
<% 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 %> |
This file contains hidden or 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
# 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 |
This file contains hidden or 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
--- | |
--- | |
/* | |
Typography | |
-------------------------------------------------------------- */ |
This file contains hidden or 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
def initialize item | |
# set the item instance variable | |
@item = item | |
# grab the item's attributes from its yaml file | |
attributes = File.expand_path('content' + item.identifier.gsub(/\/$/,'') + '.yaml') | |
# load the yaml data into a hash and grab just the attribute | |
# names, not the values | |
attributes = File.open(attributes) { |a| YAML::load(a) }.keys |
OlderNewer