Comments (11)
You can add post categorization right now with meta inside text files. For example, on my blog (usabilitypost.com) I have a couple of posts categorized as book reviews. I show these posts on a different page of the blog. You can select posts by their meta using Ruby like this:
<% @articles.select {|a| a[:category] == 'book' }[0...10].each do |article| %> ... html here to render book articles ... <% end %>
Not sure about posts with multiple categories or tags, could probably work something out though. Cloudhead - what do you think?
from toto.
This is something I'd like to see as well. Perhaps add it to the header info.
categories: Programming, Book Review, Ruby
tags: Ruby, Rails, Design Patterns in Ruby, etc.
Then have a single page that lists everything that falls within those tags. Could probably re-use the index.rhtml for that by passing in some vars.
from toto.
Categories are planned — they'll essentially just be folders inside articles/
.
Tags can be done as shown above, any metadata you add to the article headers can be accessed in the templates.
from toto.
Awesome, I'll look forward to that.
from toto.
For tags as shown above using metadata is there a way to view articles by tag. Example: I tag two articles with ruby. If I make a template tagged.rhtml file does toto already have support for something like /tagged/ruby or will this try to find pages/tagged/ruby.rhtml? If it doesn't is something like this planned?
from toto.
For now, you could do that manually, by fetching the articles, and doing a select:
@articles.select {|a| a.tags.include?('ruby') }
It's all cached after the first load, so there isn't really a performance hit.
from toto.
I think the main problem is to get the "ruby" tag from e.g. the URL
How would you pass the tag name in a dynamic way to the "tagged.rhtml"?
from toto.
It's still a bit messy, but: http://github.com/5v3n/karakuri adresses this feature, it might come handy to you. To see it in action, have a look at 5v3n.com.
Thanks cloudhead for opening the erb renderer to include the ENV data, that mainly did the trick.
from toto.
I'm going to implement categories for toto (I have already implemented
tags and now want to have categories as well) here's my ideas about how
it will work (comments are appreciated):
files hierarchy
* file: ./articles/2011-08-01-one.txt
permalink: /2011-08-01-one
category: nil
* file: ./articles/abc/2011-08-02-two.txt
permalink: /abc/2011-08-02-two
category: abc
* file: ./articles/abc/def/2011-08-03-three.txt
permalink: /abc/def/2011-08-03-three
category: abc > def
browse categories
* `/category/abc` - will list articles from `abc` category:
** `./articles/abc/2011-08-02-two.txt`
** `./articles/abc/def/2011-08-03-three.txt`
* `/category/abc/def` - will list articles from `abc > def` category:
** `./articles/abc/def/2011-08-03-three.txt`
@cloudhead, will really appreciate your comments and/or wishes about implementation.
from toto.
@ixti good thing on category...but how about assigning a post to multiple categories?
from toto.
@seanlin, I have implemented tags before, see pull request #90. So you can mark your post with several tags, but category is always one or nothing :)) I believe that nature is best architecture, so you can put a document only in one File
, and one file into anther. But you can label your document with multiple tags (e.g. colored stickers).
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.