site config in sites.yaml

master
muflax 2012-05-11 23:15:38 +02:00
parent b09cceb7d3
commit 8543ac3e69
2 changed files with 25 additions and 24 deletions

View File

@ -21,6 +21,7 @@ module ::Nanoc
puts "load extended config..."
@name = site
@site_yaml = YAML.load(File.open("sites.yaml"))
@config[:output_dir] = "out/#{site}"
@ -61,21 +62,14 @@ module ::Nanoc
!main_site? # everything is a blog except for the main site
end
def [](attr)
@site_yaml["sites"][@name][attr]
end
def disqus_site
# TODO merge them all?
# site -> disqus shortname
case @name
when "muflax"
"muflax"
when "sutra"
"muflaxsutra"
when "daily"
"dailymuflax"
when "blog"
"muflaxblog"
else # put 'em on the main site
"muflax"
end
self["disqus_site"]
end
def url
@ -87,18 +81,7 @@ module ::Nanoc
end
def title
case @name
when "muflax"
"lies and wonderland"
when "sutra"
"Blogchen"
when "daily"
"muflax becomes a saint"
when "blog"
"muflax' mindstream"
else # placeholder
"muflaxia"
end
self["title"]
end
end
end

18
sites.yaml Normal file
View File

@ -0,0 +1,18 @@
sites:
muflax:
title: lies and wonderland
disqus_site: muflax
blog:
title: muflax\' mindstream
disqus_site: muflaxblog
sutra:
title: Blogchen
disqus_site: muflaxsutra
daily:
title: muflax becomes a saint
disqus_site: dailymuflax
letsread:
title: Let\'s Read
disqus_site: muflaxread