Giter Club home page Giter Club logo

Comments (14)

hyperbolist avatar hyperbolist commented on July 23, 2024

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.

resistorsoftware avatar resistorsoftware commented on July 23, 2024

I beg to differ. Simply naming the articles with that format does not fix the issue.

from toto.

 avatar commented on July 23, 2024

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.

resistorsoftware avatar resistorsoftware commented on July 23, 2024

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.

cloudhead avatar cloudhead commented on July 23, 2024

use article.path, article.url is the permalink.

from toto.

rodrigoalvesvieira avatar rodrigoalvesvieira commented on July 23, 2024

nice.

from toto.

bradphelan avatar bradphelan commented on July 23, 2024

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.

cloudhead avatar cloudhead commented on July 23, 2024

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.

resistorsoftware avatar resistorsoftware commented on July 23, 2024

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.

bradphelan avatar bradphelan commented on July 23, 2024

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.

cloudhead avatar cloudhead commented on July 23, 2024

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.

bradphelan avatar bradphelan commented on July 23, 2024

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.

ixti avatar ixti commented on July 23, 2024

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.

asselinpaul avatar asselinpaul commented on July 23, 2024

Any update?

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.