diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2017-01-09 19:19:19 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2017-01-09 19:19:19 -0500 |
commit | f1b364abf455b3654580718972a77572ca29be02 (patch) | |
tree | 875108b3c8c3ca8af7c8430f37f78be00a91684f /lib/page_index.rb | |
parent | 955387e6af782e1dabd4d68ad12904263c4e8023 (diff) |
Implement tag pages (finally!)
Diffstat (limited to 'lib/page_index.rb')
-rw-r--r-- | lib/page_index.rb | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/page_index.rb b/lib/page_index.rb index 66b528a..3c2f504 100644 --- a/lib/page_index.rb +++ b/lib/page_index.rb @@ -82,19 +82,27 @@ class IndexPage < LocalPage def local_outfile local_infile.sub(/^src/, 'out')+"/index.html" end - def local_depends - if @depends.nil? + def index_depends + if @index_depends.nil? basename = local_infile.sub(/^src/, 'out') deps = Set[local_infile] yamlfile = local_infile+"/index.yaml" if File::exist?(yamlfile) deps.add(yamlfile) end - index_pages.select{|p|!p.is_a?(RemotePage)}.each{|p|deps.merge(p.local_depends[''])} + deps.add('config.yaml') + index_pages.select{|p|p.is_a?(LocalPage)}.each{|p|deps.merge(p.local_depends[''])} + @index_depends = deps + end + @index_depends + end + def local_depends + if @depends.nil? + basename = local_infile.sub(/^src/, 'out') @depends = { - '' => deps, - "#{basename}/index.html" => deps.clone.merge(["tmpl/index.md.erb", "tmpl/page.html.erb"]), - "#{basename}/index.atom" => deps.clone.merge(["tmpl/index.atom.erb", "tmpl/page.atom.erb"]), + '' => index_depends, + "#{basename}/index.html" => index_depends.clone.merge(["tmpl/index.md.erb", "tmpl/page.html.erb"]), + "#{basename}/index.atom" => index_depends.clone.merge(["tmpl/index.atom.erb", "tmpl/page.atom.erb"]), } end @depends |