Open cloudhead opened 14 years ago
from a usability point of view, I must agree — not having to worry about the filename is a plus. I'm not sure the extra complexity is worth it though, I'd have to think about it.. Maybe if it was in the form of a 'module', separate from toto.rb
, it could work.
As I understand, this wouldn't only solve the file-name problem though, but would give the ability to have multiple indices on the articles. This is the part which I think would add complexity.
to index slug -> filename
mappings would probably be pretty simple, and could indeed be refreshed with a rake index
command. It should be an optional module though.. I think people will forget to regenerate the index pretty often.
Thanks for the reply.
I think the extra complexity could be worth the effort, and I'm willing to put that effort in. Specifically, making these changes will allow me to omit the post day from my permalinks but still load the articles properly and in order. (And perhaps faster.)
It will also make queries based on article metadata much easier/faster, for example selecting all pages with a certain tag or author.
A couple of thoughts:
index
problem, one might:
rake new
--not perfect, but a good startrake publish
if the index file is older than the latest article file--this obviously doesn't help people who use git
commands insteadWhat do you think?
Maybe I'll try to whip up a module that implements pseudo-database functionality and see where things go.
What if you dynamically created an article index file (YAML or something) via the
rake publish
command? (Or earlier via some sort of arake index
command.) This file would contain indexes for each file name (specifically for determining file order and possibly including metadata), which would free us from putting the date in each file's name?I'm thinking that people who want to use Ruby to blog need several options, from static frameworks/generators (like Webby) to dynamic, database-free solutions (like Toto) to simple database solutions (like Sinatra + ActiveRecord) to full solutions (like Rails).
It seems to me that Toto could expand its scope just a little bit to give database-like functionality (via an index file) without actually using any databases. This kind of a setup wouldn't even require write access on a server (like Heroku), as the file is generated when before uploading/
git push
.What do you think? Should we abstract metadata (like date and order) away from the file name?