Comments (4)
What if you dynamically created an article index file (YAML or something) via the rake publish
command? (Or earlier via some sort of a rake 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?
from toto.
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.
from toto.
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.
from toto.
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:
- I agree the changes should be modular and optional
- I agree that the slug and filename could be mapped
- To solve the
index
problem, one might:- update the index after a person first creates and saves an article with
rake new
--not perfect, but a good start - warn the user during
rake publish
if the index file is older than the latest article file--this obviously doesn't help people who usegit
commands instead
- update the index after a person first creates and saves an article with
What do you think?
Maybe I'll try to whip up a module that implements pseudo-database functionality and see where things go.
from toto.
Related Issues (20)
- 404 Error with Phusion Passenger HOT 1
- HTML tags are ignored HOT 4
- RSS xml malformation on Heroku.
- Dorothy - read on link does not work from fresh clone HOT 2
- Invalid ATOM Xml using default builder HOT 2
- How to cache the page and at the same time offer dynamic redirects
- Access 'articles' from outside of index page
- not working on heroku cedar? HOT 10
- non-blog usage, custom URLs
- Respond to HEAD requests with 200, not 400 HOT 1
- Smart-mode of markdown not documented
- Unmaintained repository HOT 2
- Error with routing to more Info HOT 1
- Having a lot of trouble getting toto to work on heroku
- a issue using thin with toto HOT 4
- 304 Headers
- Update code on rubygems HOT 2
- Content-length error prevents page load and leads lint error
- In Ruby 2.7 basically the tainting mechanism, leads to stackoverflow
- This looks really interesting! - GitLab instead of Heroku?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from toto.