Giter Club home page Giter Club logo

Comments (4)

davejacobs avatar davejacobs commented on July 23, 2024

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.

cloudhead avatar cloudhead commented on July 23, 2024

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.

cloudhead avatar cloudhead commented on July 23, 2024

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.

davejacobs avatar davejacobs commented on July 23, 2024

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 use git commands instead

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.