Website/Rakefile

63 lines
1.2 KiB
Ruby

$:.push "lib"
require "gemsmith.rb"
require "jdb.rb"
require "lab_metadata.rb"
require "util.rb"
include GemSmith
$db = JDB.new("db")
LabMetadata::build_people_metadata()
site :odin_lab, out: "build" do
## Splice off header information
for_files(/((\.erb)|(\.md)|(\.html))$/) do
activate extract_headers
end
## Render specialized formats
for_files(/\.md$/) do
activate render_markdown
end
for_files(/\.erb$/) do
activate render_erb
end
## Generate pages for each lab member
LabMetadata::create_people_pages
for_files(/people\/.*\.html$/) do
exclude_files(/index\.html/) do
activate apply_template("templates/person.erb")
end
end
## Apply templating
for_files(/\.html$/) do
activate apply_template("templates/lab.erb")
end
## Specify specialized dependencies (e.g., on the database)
for_files(/people\/.*\.html$/) do
add_dependency "db/lab.json"
end
## Static assets
add_assets([
"bootstrap", "jquery.js",
"odin.css", "seminar.css",
"logos", "favicon", "people"
])
end
task :default => :odin_lab
task :open => :default do
system("open build/index.html")
end
task :clean do
system("rm -r build")
end
file "build/index.html" => "Rakefile"