cloudhead / toto Goto Github PK
View Code? Open in Web Editor NEWthe 10 second blog-engine for hackers
License: MIT License
the 10 second blog-engine for hackers
License: MIT License
I imported 80 articles from my old blog and after clicking around from the index to an article and back again I get:
Errno::EMFILE at / Too many open files
It seems you need to find a safe place to call File#close
after reading in each file's content.
The Rakefile tasks should have a 'desc' before each rake task so they show up with 'rake -T'
Otherwise, running 'rake -T' results in nothingness.
e.g.
desc "Create a new post"
task :new do
...
Disqus is a great way to handle comments, but the problem is search engines won't pick up the comments on blog posts. One could use the disqus api http://groups.google.com/group/disqus-dev/web/api-1-1#get_thread_posts to throw comments up on the page when robots hit it.
Any chance of support for Textile alongside Markdown?
Hi!
I just realized that my "random page" works locally (thin), but not on toto. It seems like a page cache issue - the random page picker works, but the page is not rendered since it's cached.
Is there a way to invalidate the page cache for a single page, perhaps a flag in the template or something similar?
Cheers
5v3n
Can we have an option to attach the site title to all the page titles. So default title would be "MySite" and then when you go to an article page it would be something like "MySite - Some Article Title". Is this possible now?
Current workaround: patch Site#http
:
http://github.com/cloudhead/toto/blob/master/lib/toto.rb#L110-112
I've browsed through the source code and can't figure out how to call YAML-derived values from my layout page.
I want to optimize my blog's SEO and dynamically generate the description and keywords for every page. (I know, I know... keywords don't affect page rank. Still, I like being semi-semantic.)
I've tried calling <%= description %>
from the template and nothing shows up! Right now, it falls back to a default description I define in config.ru (and call via @config[:description]
), but I want individual descriptions for each page.
It looks like the standard tags (title, date, author) have explicit methods defining them in the source, methods that can be called from a template. But method_missing
doesn't work from inside that template file.
(I realize there is a method_missing
definition elsewhere in the source, but I think that's scoped so that it doesn't work within my layout.rhtml.)
Do I really need to patch in a new method for every YAML tag I'm going to call from the template?
e.g. turn -- into "โ" in titles?
I'd like to switch a Wordpress blog with about 200 posts to Toto - but in order to do that, I would need to be able to categorize and tag my posts. I'm not a Ruby guy - I've been trying to wrap my head around how to make the chances I'm thinking of, but so far I haven't had any luck.
Are these features planned additions to Toto, or are they outside of Toto's scope?
Many hackers of Oz like to share syntax highlighted code snippets via their blog. Perhaps toto could leverage Maker's Mark (or something similar) to add this ability to markdown?
Hi.
It seems like toto doesn't handle utf-8 correctly yet (at least it's broken for me ;). I did not look through the code yet, just to let you know about it.
See : http://cloudhead.io/toto
First, end users should probably be encouraged to create a fork of the dorothy repo before cloning their own fork. Otherwise they won't be able to store their repo with a git push, or issue pull requests to you easily for commits to dorothy that should be shared by others.
Instead of:
(implicit 'mkdir myblog' not mentioned)
$ cd myblog
$ git clone git://github.com/cloudhead/dorothy.git .
$ heroku create
$ git push heroku master
Better:
$ git clone git://github.com/cloudhead/dorothy.git myblog ## no mkdir needed
$ heroku create <myblogname> ## creates myblogname.heroku.com
$ git push heroku master
This approach does not allow for pushing changes easily back to github, where others can benefit from them. A git push would fail since its origin is cloudhead's account.
Best:
Fork the github dorothy repo from : http://github.com/cloudhead/dorothy
$ git clone git://github.com/YOUR-GITHUB-UNAME/dorothy.git myblog ## no mkdir needed
$ heroku create <myblogname> ## creates myblogname.heroku.com
$ git push heroku master
$ git push ## pushes everything, including changes to be shared back to github
Add tags to the header section of each article to support SEO metadata keywords and description.
Title: My blog post
Date: 11/02/2010
keywords: blog, post, toto, github, blah
description: How to set up a blog using toto and Heroku
I'm pretty sure this isn't really the right place, but I've developed a little wordpress-WXR-to-Toto-articles converter. It's in Python and I'm guessing it might eventually be useful to someone. A pastie is here (http://pastie.org/876755).
Hmmm.. not sure what I'm doing wrong but the feed isn't showing up on my local dev machine. I'm getting a 404 error in console:
127.0.0.1 - - [07/May/2010 22:39:25] "GET /index.xml HTTP/1.1" 404 75 0.0898
Works fine on Heroku though, and I think it worked fine before. Any idea what I could be doing wrong?
Hello everyone, this is a kinda weird issue. I create a new .txt file in /articles and add to git, commit and push it, then I go to the blog home page, and the description of the new post is there, but when I click to see the entire post in Chrome it says "Oops! This link appears to be broken." and Firefox gives me a 404 error (toto, we're not in Kansas anymore (404)), what is this?
P.S: The blog http://neorubyist.heroku.com/
Thanks :-)
Feedburner just stopped working for my blog because the feed is too large since it's loading all the blog's articles. Feed is there to show latest updates, not archives, so should only load up a few latest posts. Modifying the feed builder with the following to fetch the last 10 articles:
articles[-10, 10].each do |article|
Still waiting for Feedburner to refresh, will let you know if this works.
First of all, are there specific "environments" that the app can be run in (e.g. dev, test, pro)? If there are, those should be better documented. Also, is there a way to turn off caching when running on a local system? The reason I ask is that I can only assume that caching is what is causing my bizarre issue: both of my test posts have the same date, even though the first one is the default post that comes with this app (dated 1900-05-17). When I load up the app in my browser, they both say February 5th 2010 and thus the first one (the 1900-05-17 one) has a broken link.
The file isn't in the source, but nor is it in .gitignore
. Was it simply omitted or was there a reason for not versioning/sharing the file?
Hi,
Using the wiki article contributed by markyl to embed Toto inside a rails app, I am running into the problem whereby toto has a problem parsing the request sent to it. The gist git://gist.github.com/299200.git gist-299200 shows the config.ru I am using.
The exception thrown is:
NoMethodError at /blog
You have a nil object when you didn't expect it! You might have expected an instance of Array. The error occurred while evaluating nil.split
Ruby /home/foo/.gem/ruby/1.8/gems/toto-0.2.8/lib/toto.rb: in call, line 291
So it seems path is nil at this point and no route is set. The ENV shows path_info is set to /blog.
Is there something that can done in Toto do debug why the route is not being picked up properly as per a default install of toto? I have been unable to figure out this little glitch.
Thanks!
I'd like to have the archives list be in the layout.rhtml file so that I can have a sidebar with all of the archives when you are on any page. But if I do that and navigate to the about page I get a rack exception saying that the archives variable is empty.
I would love to use partials within haml. However, when I try to render a partial, the to_html method fails. What do I need to add to the render call?
=render :partial=> "sidebar"
give's me an ArgumentError, wrong number of arguments (1 for 2)
Running 'rake new' will use the default author setting, instead of the author I have set in config.ru.
This page, and the readme neglect to mention that you need to install the toto gem (and its depends) for things to work. I know that probably goes without saying... but it shouldn't go without saying.
If I wanted to respond to all routes in the form of 'tag/', how would I go about that? I would like to have all routes of 'tag/' forward to a given page that would then display the articles that have the given tag.
Same for categories.
I would love to us toto for my small corporate site, I tried to build the blog index page inside a "blog" page. This does not work, seems that only index has access to the articles variable?
So my goal is to have a blog on http://127.0.0.1/blog/
How could I achieve that?
I can't quite see how to make stock toto/dorothy host on /blog/, where the path is virtual. Things that break include: the links to individual articles from the index page (as they use .path instead of any part of config[:url]), links inside index.xml, and links to the css on the article pages.
I've cloned both projects at http://github.com/jpluscplusm/(toto|dorothy) with minor changes that make this possible, and would appreciate either a merge, or a suggestion of how better to achieve it with the existing code&config.ru. Apologies if this isn't the recognised git-ish way of requesting/suggesting a merge - I'm using this project to learn git :-)
HTH,
Jonathan
This code does not make the correct utf-8 conversion.
#...
def slugize
self.downcase.gsub(/&/, 'and').gsub(/\s+/, '-').gsub(/[^a-z0-9-]/, '')
end
#...
The following link will probably help.
http://code.djangoproject.com/browser/django/tags/releases/1.1.1/django/contrib/admin/media/js/urlify.js
Less code, more reuse! Especially since Etag is no longer part of Rack::Contrib but is now in core.
Atom Feed ID should not be the article.url
Using the post url as the atom id is not really the best practice. If the permalink changes (e.g. due to a typo) then the atom id will also change resulting in this post showing up again in feed readers (and other issues).
Once set, the ID should never, ever change no matter what.
Perhaps when your rake task generates the post, you can generate an appropriate (e.g. uuid) atom id in stuff it into the metadata of the post (and teach the user to never change this id).
See :
http://diveintomark.org/archives/2004/05/28/howto-atom-id
http://www.hesido.com/web.php?page=atomidtimestamp
Could some one help?
I tried the installation in both remote and local way, it kept throwing out error as below:
D:\02_RoR\ruby>gem install toto -v 0.4.6
Building native extensions. This could take a while...
ERROR: Error installing toto:
ERROR: Failed to build gem native extension.
D:/02_RoR/ruby/bin/ruby.exe extconf.rb
checking for random()... no
checking for srandom()... no
checking for rand()... no
checking for srand()... no
creating Makefile
nmake
'nmake' is not recognized as an internal or external command,
operable program or batch file.
Gem files will remain installed in D:/02_RoR/ruby/lib/ruby/gems/1.8/gems/rdiscou
nt-1.6.5 for inspection.
Results logged to D:/02_RoR/ruby/lib/ruby/gems/1.8/gems/rdiscount-1.6.5/ext/gem_
make.out
Is it an incompatible issue? Is there any windows-compatible verson of Toto?
Thanks a lot!
How do I display images in a toto article as well as quotes etc.?
I think this might be pointed out that if you install on your own server and want to push there from your local machine you have to use a bare git repo on the server. But toto needs a working directory obviously. And you cannot push to a repo with a working directory. So if you use your own server you will have to make all your editing directly on the server or you'll have to #git reset --hard; git checkout -f on the server after any push.
I wonder how does heroko work around this issue? Maybe I can utilize their solution on my own server?
It seems that sant0sk1 already got it working. You (cloudhead) commented on it already, and you mentioned that go() needs to be patched. He did - sant0sk1/toto@ae4d7a0db960ac33df1200e94d3629ae3247f606 -, so I think it's ready, though, there probably will be a conflict with the newer code base.
When setting up using a sub folder like Blog the home URL doesn't work, so navigating to .../blog/ results in the toto 404 (so the app runs fine) only when you navigate to .../blog/index it works. Navigating to the different blog posts works fine as well. I used the description in the Wiki to make it run with rails, I'll be using Padrino but that doesn't really matter here.
I hope I have explained it correctly?
Cheers,
-Mark
Currently, if you do set :prefix, "blog"
the string "blog" is literally appeneded, without the leading slash.
Personally, I was expecting "/blog/2010/..." but instead I got "blog/2010/...". Is this the intended behaviour? If so, perhaps it should be better documented?
Changed "set :ext" to "markdown", so Textmate picks up on the formatting when opening files. But the task "new" still uses ".txt" after changing "config.ru" (toto itself is correctly using .markdown).
Links using the reference-style formatting...
This is [a link][1].
... rest of article
[1]:http://thelink.com
...are broken on summary views because the bottom of the article is truncated before being processed by Markdown.
It looks like the default for article summaries is the whole article , and the :max summary option has changed to :length.
Is this correct?
Hi all,
I encounter an issue about encoding. I covert all .rhtml page & .txt page as UTF-8 format and set charset as UTF-8. Everything works well except the page title. it can not display correct if contains chinese.
is there anyone can help me out?
Thanks in advance!
-Jay
Stupid question: how do you access the request from a page?
Hello:
I'm running into issue trying to use the 'rake new' task. I am able to publish perfect fine by hand, but if i try to generate an article with rake, I run into the following issue:
{REMOVED}:myNewBlog {REMOVED}$ rake --trace new
(in {REMOVED}/myNewBlog)
rake aborted!
no such file to load -- toto
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require'
/Users/guy_montag_old/development/myNewBlog/Rakefile:1
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in load' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in
raw_load_rakefile'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2017:in load_rakefile' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
standard_exception_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2016:in load_rakefile' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2000:in
run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in standard_exception_handling' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in
run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/local/bin/rake:19:in `load'
/usr/local/bin/rake:19
Just as the title says, calling article.url
includes the path, the domain, the protocol, but not the port.
Run rackup locally, and open your atom feed. (Presuming rack uses a non-standard port) If you look at the ID (that should be fixed, but w/e) or link, the port is not shown.
By default, it's hardcoded to :feed
, which then causes errors when you trying to access any other .xml file, regardless if it exists. When trying to access these files, you get an exception: NoSuchMethod 'articles' for Toto::Context
.
Already fixed in my fork, nogweii/toto@74e4ffe I've already submitted a pull request, as well.
A summary that has pertinent markdown syntax beyond :max (or :delim, but that's more the author's fault) can display wrongly formatted content on the index page.
The example I've found is the backtick (currently visible on http://jpluscplusm.com/blog/). If the opening backtick is before :max and the closing backtick is after :max, then
a) the backtick is included in the output and
b) it is ignored for formatting purposes.
Obviously the fix is to manually include a :delim character before :max in an appropriate place, but there might be something clever that could be done to make this a non-issue for articles without a :delim.
Something that came to mind was reversing the logic in def(summary) from markdown(truncated_body) to truncate(markdown(entire_body)). Unfortunately, I don't think this would work very well, probably resulting in a syntactically invalid summary when it's truncated halfway through an HTML tag.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.