Comments (14)
I had the same initial experience. Make sure the files in /articles are named yyyy-mm-dd-title.txt
and links to your articles from the index should start working. The rake new
task assists in this case, ensuring that the file is properly named.
from toto.
I beg to differ. Simply naming the articles with that format does not fix the issue.
from toto.
Make sure the meta in the text file matches the filename. So if the filename is: 2010-02-11-this-is-a-post.txt the meta inside the file should be:
date: 2010/02/11
title: This is a post
alternatively, you can have a different "title", just add a slug with the same name as a file -- this will be used as the permalink for the post:
slug: this-is-a-post
from toto.
This issue has seemingly come back to haunt? Something has changed whereby articles are no longer linking properly. I am using article.url in my HAML and the link looks fine.. but the internals are throwing 404 errors again.
from toto.
use article.path
, article.url
is the permalink.
from toto.
nice.
from toto.
I'm seeing the same thing. I've got an article with metadata
title: temporarily modifying a ruby attribute
date: 15/03/2010
in a file called
articles/2010-03-15-temporarily-modifying-an-attribute.txt
I generated the file with rake new and now I get the above 404 related problem.
live site with problem is http://xtargets.heroku.com/ if it helps diagnose.
http://xtargets.heroku.com/2010/03/15/temporarily-modifying-a-ruby-attribute/
is the problem URL
from toto.
Your url slug and article name doesn't match, if you go here:
http://xtargets.heroku.com/2010/03/15/temporarily-modifying-an-attribute/
It works fine.
from toto.
One comment about using article.path instead of article.url. It seems Toto currently does not respect the url. Eg... set :url, http://www.foo.com/bloggy if you use article.path you'll generate 404 errors when it tries to render http://www.foo.com/some-article-here instead of http://www.foo.com/bloggy/some_article_here of course YMMV but I found this to be the case.. I pasted a /bloggy into my HAML template before article.path.... yeck... but it worked...
from toto.
Ah. I see. Silly me. Why is article.path not drawn from the file name instead of the title metadata or automatically routed somehow?
from toto.
Yea, this is an area which needs some improvement, if you have any suggestions on how to make this easier, I'm all ears.
from toto.
In the spirit of less whinging more patching.
----------------------
/usr/lib/ruby/gems/1.8/gems/toto-0.4.3/lib/toto.rb
----------------------
93 def article route
94 begin
95 Article.new("#{Paths[:articles]}/#{route.join('-')}.#{self[:ext]}", @config).load
96 rescue
97 Site.articles(@config[:ext]).reverse.map do |a|
98 Article.new(a, @config)
99 end.first do |article|
100 article.title == route
101 end.load
102 end
103 end
can use the title to look up the file name. The above code is not really fast but once loaded the caching takes over so is it a problem?
from toto.
The issue is obviously in mistakes with metadata and filename correlation. And it's really old. I believe this issue may be closed :))
from toto.
Any update?
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.