I'm migrating my current site, which is merely a blog hosted on Typo,
to Webby. I've got the content migrated over correctly, I think, but I
don't see how to generate the blog/2004.txt, blog/2004/01.txt indexes,
etc. As far as I can tell the included rake task only wants to create
new posts and the indices they necessitate. Since my blog is about 5
years old, I'd rather not have to do it manually.
Any tips on what to do about this?
Thanks for this excellent software!
—
Daniel Lyons
task :recreate_indices do |t|
FileList["#{Webby.site.content_dir}/#{Webby.site.blog_dir}/[12]
[0-9][0-9][0-9]"].each do |year|
# determine the filename and template name
dir = File.join(Webby.site.blog_dir, File.basename(year))
fn = File.join(dir, 'index.txt')
tmpl = Dir.glob(File.join(Webby.site.template_dir, 'blog/
year.*')).first.to_s
if test(?f, tmpl) and not test(?f,
File.join(Webby.site.content_dir, fn))
Webby::Builder.create(fn, :from => tmpl,
:locals => {:title => File.basename(year), :directory =>
dir})
end
FileList["#{year}/[0-2][0-9]"].each do |month|
# determine the filename and template name
dir = File.join(Webby.site.blog_dir, File.basename(year),
File.basename(month))
fn = File.join(dir, 'index.txt')
tmpl = Dir.glob(File.join(Webby.site.template_dir, 'blog/
month.*')).first.to_s
if test(?f, tmpl) and not test(?f,
File.join(Webby.site.content_dir, fn))
Webby::Builder.create(fn, :from => tmpl,
:locals => {:title => File.basename(month), :directory
=> dir})
end
end
end
end
I would appreciate comments if I'm doing anything really stupid here. :)
Thanks again,
—
Daniel Lyons