Publify

Making blogging easy

Release of Typo 6.0.8 - Bug Fixes

Being the eighth of the Irving Penn series, this new Typo release comes only 3 days after the latest one, but it fixes a bunch of serious bugs that were discovered while using Typo 6.0.7 in the wild.

As usual you can download Typo 6.0.8 at the usual place, and give it a try on our demo site.

Adding per tags and categories templates

Typo is now able to provide a different template according to the category and tag you visit. This is useful for some sites which need such a level of customization. To use them, just add a views/categories/category-permalink.html.erb or a views/categories/category-permalink.html.erb file in your theme. Typo will use that file when displaying this category.

Bug fixes

Fixes a bug in the meta title generation when displaying an article, a category or a tag.

Fixes the custom tracking field making the site crashing when used.

Fixes a bug on tags removal not working.

Moving our bug tracker to Github

We’ve decided to move our bug tracker from Lighthouse to Github. In the past years, Github ticketing system has gained in feature and maturity while Lighthouse has been stalling, not being really convenient to use. This move allows us to centralize our tools in a single place. The new bug reporting place is now https://github.com/fdv/typo/issues

It’s been the third release in 11 days, but thanks to all our beta testers, I hope it’s the latest bugfix one. We want to thank in alphabetical order Mitch Pirtle, Lars Tobias Skjong-Børsting, Mathieu Poussin and Rhaamo for their bug hunting operation.

Published on 13/08/2011 at 09h12 by Frédéric de Villamil, tags

Release of Typo 6.0.7 - Bug Fixes

After releasing Typo 6.0.6, we realized that we left a few critical bugs unfixed. It seems that none of us actually ran our tests against Ruby 1.9.2, and things that were working under certain circumstances were breaking against a different environment.

So this release provides nothing bug bug fixing, which is not so bad, after all.

File upload was completely broken due to a behavior change in ActionDispatch::Http::UploadedFile between Rails 3.0.2 and Rails 3.0.3. File upload in itself is pretty hard to test, and we failed at this point.

Image resize was completely broken too due to a version change of minimagick. Reverting back to minimagick 1.3.3 did the trick.

Under PostgreSQL, initial migration would set an empty post_type despite a default set to read. It seems that PostgreSQL won’t fill the field value when created with existing inserts.

Mathieu Poussin added Recaptcha support on all bundled themes.

Pages view was broken under Ruby 1.9.2 due to an encoding issue. There was also an encoding bug in post_type edition and creation.

Despite extensive testing, pagination was broken due to a buggy will_paginate 3.0.4 beta. Reverting to 3.0.2 did the job.

Last but not least, a change in the way Google handles RSS queries caused dashboard load to take ages.

That’s all (for now). We’ll try to to better this time.

Published on 10/08/2011 at 18h03 by Frédéric de Villamil, tags

Release of Typo 6.0.6 – a major one

5 weeks after releasing Typo 6.0.5, we’re proud to release Typo 6.0.6 into the wild. With 403 files changed, 8526 insertions and 4961 deletions (before generating the CHANGELOG) this is our biggest release of all time. This was made possible thanks to Yannick François joining the core team, the growing amount of active contributors and a very crappy weather above Europe during our summer holiday.

You can download Typo 6.0.6 at https://github.com/downloads/fdv/typo/typo-6.0.6.zip or https://github.com/downloads/fdv/typo/typo-6.0.6.tgz. A demo is set up at http://demo.typosphere.org.

Typo 6.0.6

What’s under the hood?

Rails 3.1 ready

We’ve got a long way since Typo was first released for Rails 0.6 and Ruby 1.8.4. Typo 6.0.6 is now Rails 3.1.0 ready and runs on both Ruby 1.8.7 and 1.9.2. We’re now waiting for Passenger (mod_rails) to be fully Rails 3.1 compliant to switch to this new exciting Rails version.

URL shortener

Adoption of microblogging has made URL shorteners an important part of our daily browsing life. Hosted services may disappear one day or another taking your shortened URL with them, so we have given Typo its own URL shortener.

When you publish a new article, Typo generates a shortened URL that will redirect to your content. No more risks of disappearing shortened URLs, YOU keep the control.

Recaptcha support

Silvio Relli did a great job adding Recaptcha support to Typo 6.0.6. Recaptcha is a captcha system that both fights against spam and uses successful decodings to helps digitise books.

You can use both Recaptcha and Akismet on a Typo installation.

New toys for plugin developpers

We wanted to make Typo easier to extend for plugin developpers. Typo 6.0.6 introduces a bunch of new tools for them.

Users custom fields

Users can now have an infinite nummer of custom fields, that will be used by plugins developpers without having to modify the database. Settings are easy to add and easy as pie to use.

Contents custom fields

Articles and pages can now have an infinite nummer of custom fields, that will be used by plugins developers without having to modify the database. These custom fields are easy to add and easy as pie to use.

Custom routes for plugins

User defined plugins can now use their own route without changing the original routing files. This allows plugin developers to create powerful extensions without to worry about what Typo’s routing file looks like.

A powerful SEO oriented blogging engine

We’ve worked a lot on SEO, aiming at being as powerful as Yoast SEO Plugin on Wordpress. This release is a first step with the following feature.

Support for rel=’canonical’ in pages header to avoid duplicate content.
A canonical page is the preferred version of a set of pages with highly similar content. It’s common for a site to have several pages listing the same set of products. For example, one page might display products sorted in alphabetical order, while other pages display the same products listed by price or by rating. For example: http://www.example.com/product.php?item=swedish-fish&trackingid=1234567&sort=alpha&sessionid=5678asfasdfasfd http://www.example.com/product.php?item=swedish-fish&trackingid=1234567&sort=price&sessionid=5678asfasdfasfd If Google knows that these pages have the same content, we may index only one version for our search results. Our algorithms select the page we think best answers the user’s query. Now, however, users can specify a canonical page to search engines by adding a link element with the attribute rel=”canonical” to the head section of the non-canonical version of the page. Adding this link and attribute lets site owners identify sets of identical content and suggest to Google: “Of all these pages with identical content, this page is the most useful. Please prioritize it in search results.”
A custom template for meta title and description

Since meta title and description are very important for SEO, it is very important to be able to setup its own content. Typo now provides powerful customizable templates for both of them, with nice default enabled.

Making meta keywords optionnal

Since search engines do not consider meta keywords anymore, some people want to disable them to save on their page weight. This option makes it possible.

New content templates

Typo can now handle multiple content types through dedicated templates. Let’s say you want to display text articles and pictures only. Just create the content type, write a quick template for rendering, write your article, and your done. This new feature comes with handy helpers to generate per template menu…

This makes Typo theming even more powerful.

Control your cache from the admin

The long removed cache sweeping interface is now back, with interesting statistics about cached files.

Attachment thumbnails

Attached images are now generated in 3 sizes: original, medium and thumb. Both medium and thumb sizes can be defined in the administration.

Pictures albums in lightbox

Typo Lightbox macro now supports set parametre, which allows you to create nice photo albums.

More readability and usability

The admin sections have been reorganized for more readability and usability. We’ve redisigned some interfaces, work still in progress.

Code refactoring

Typo code is as old as Rails, which means we still carry old, deprecated code. This version brings lots of refactoring, dead code removal, speed optimization and even more testing.

Norwegian translation

Lars Tobias Skjong-Børsting has been doing a great job providing a full norwegian translation in an impressively short time.

Bug squashing

With code refactoring usually comes bug squashing. This version got rid of more bugs than a full tank of DDT would have, without the cancer effect.

A community effort

Typo 6.0.6 would have never been possible without our community of contributors, listed in alphabetical order: Huy Dinh, Fish, Justin B. Kay, Maarten Mulders, Silvio Relli, Melanie Shebel, Lars Tobias Skjong-Børsting, Eric Sorenson, Yule.

Published on 02/08/2011 at 11h25 by Frédéric de Villamil, tags

Creating advanced Typo plugins

2 days ago, there was a guy called Fish who joined us while I was idling on #typo. He was asking for a gallery plugin for his Typo blog. As I’m a photographer, having such a plugin had been on my TODO list for like years now, so I told him I would do a quick proof of concept during my daily train commute. A few hours later, when I went back home, the plugin was working. It was very simple, displaying files uploaded on a Typo blog with thumbnail, pagination, medium size and large size displayed in a lightbox. Indeed, it wasn’t enough, and Fish came back asking for multiple albums and picture selection, caption, so I came back to work. As a developper, Fish could probably have done it himself, but I’m more familiar with Typo internals, and even I didn’t know how far I could go with Typo plugin integration.

Tonight, during my daily commute, I extended my gallery plugin with full admin and frontend integration. The gallery is not working yet, but the biggest part is working: integrating a complexe plugin in a Typo blog. I wanted to share this with you as a HOWTO.

Before trying this, please be sure you’re using Typo HEAD as Friday April the 8th, or a Typo version above 6.0.4 (even though it’s not released yet) as you’ll need the route.rb modification I had to do.

Creating the plugin

As Typo plugins are just plain Rails plugins, creation is kinda trivial.

<typo:code> ./script/rails generate plugin typosampleplugin </typo:code>

You’re now going to create some folders to reflect a Rails application tree:

<typo:code> cd vendor/plugins/typosampleplugin mkdir -p app/controllers/admin app/models app/helpers/admin config app/views/admin </typo:code>

Good, you’re now ready to code the main stuff. Edit your new plugin, and let’s go!

Making your code accessible

Now, you’re going to make Typo access your code. Edit your init.rb file and add the following:

<typo:code lang=’ruby’> PLUGINNAME = ‘typosampleplugin’ PLUGINPATH = “#{::Rails.root.tos}/vendor/plugins/#{PLUGINNAME}” PLUGINCONTROLLERPATH = “#{PLUGINPATH}/app/controllers” PLUGINVIEWSPATH = “#{PLUGINPATH}/app/views” PLUGINHELPERPATH = “#{PLUGINPATH}/app/helpers” PLUGINMODELSPATH = “#{PLUGINPATH}/app/models”

config.autoloadpaths += %W(#{TypoSamplePlugin::PLUGINCONTROLLER_PATH} \

                        #{TypoSamplePlugin::PLUGIN_HELPER_PATH}      \
                        #{TypoSamplePlugin::PLUGIN_VIEWS_PATH}       \
                        #{TypoSamplePlugin::PLUGIN_MODELS_PATH}

ActionView::Base.send(:include, TypoSamplePlugin::Helper) </typo:code>

The routing

Unless Rails generators, your plugin won’t be allowed to change routes.rb. We want our end users to remove them if they don’t want them anymore. So we’re going to create our own config/routes.rb. It’s going to look like this:

<typo:code lang=’ruby’> ActionController::Routing::Routes.draw do |map| map.connect ‘sampleplugin/:action’, :controller => ‘typosample’, :action => ‘index’

%w{ sample_plugin }.each do |i|

map.connect "/admin/#{i}", :controller => "admin/#{i}", :action => 'index'
map.connect "/admin/#{i}/:action/:id", :controller => "admin/#{i}", :action => nil, :id => nil

end end </typo:code>

I know, we’re still using Rails 2 routing DSL. It’s bad but Rails 3 can’t handle everything we do.

The first block is for your frontend controllers, the second one for the admin. Easy as pie isn’t it?

The models

She’s a model and she’s looking good. I’d like to take her home that’s understood.

Add your models files in app/models exactly like on any Rails application. You can use any Active Record relations you want and access or extend existing Typo models.

To create your database schema, edit your init.rb file, and add the following code:

<typo:code lang=’ruby’> unless ::TypoSamplePlugin.tableexists? ActiveRecord::Schema.createtable(TypoSamplePlugin.table_name) do |t|

t.column :name,  :string
t.column :description,  :text

end end </typo:code>

Couldn’t be easy heh? Now let’s switch to the front and back office thing.

The front thing

Controllers

To be able to display your content within your Typo blog layout, every front end controller will need the following code:

<typo:code lang=’ruby’> class TypoSamplePluginController < ActionController::Base unloadable layout :themelayout beforefilter :template_root

def template_root

self.class.view_paths = ::ActionController::Base.view_paths.dup.unshift(TypoSamplePlugin::PLUGIN_VIEWS_PATH)

end

def theme_layout

File.join("#{::Rails.root.to_s}/themes/#{Blog.default.theme}/views", Blog.default.current_theme.layout(self.action_name))

end

end </typo:code>

There’s certainly a cleaner way to do it by not repeating the code, but I’ll dig it later.

Views

Nothing special here. Really.

The backend thing

OK, now you want to give your plugin a fancy back office? Let’s go.

Adding your module to the admin

Edit your init.rb. In your model creation block, add the following:

<typo:code lang=’ruby’> admin = Profile.findbylabel(‘admin’) admin.modules << :typosampleplugin admin.save

publisher = Profile.findbylabel(‘publisher’) publisher.modules << :typosampleplugin publisher.save
</typo:code>

This will update both admin and publisher profiles giving them the rights to access your plugin admin.

Now, let’s add them to the access control list (and the menu as well). This is still in init.rb

<typo:code lang=’ruby’> AccessControl.map :require => [ :admin, :publisher, :contributor ] do |map| map.project_module :typosampleplugin, nil do |project|

project.menu    "My plugin meny",  { :controller => "admin/typo_sample_plugin" }
project.submenu "My submenu", {:controller => "admin/typo_sample_plugin_other" }

end end </typo:code>

Edit your lib/typosampleplugin.rb and add the following:

<typo:code lang=’ruby’> module Helper def classtyposampleplugin return classselectedtab if controller.controllername =~ /typosampleplugin/ class_tab
end end </typo:code>

This will allow you to manage the tabs highligh in the admin.

Controllers

Your controllers will go to app/controllers/admin and will all look like this, pretty like normal admin controller:

<typo:code lang=’ruby’> module Admin; end

class Admin::TypoSamplePluginController < Admin::BaseController layout ‘administration’ unloadable

...

end </typo:code>

Views

Typo plugins admin views look like normal admin views. Minimum code is:

<typo:code lang=’ruby’> <% @pageheading = (‘Sample plugin’) %> <% subtabs_for(:typosampleplugin) %> </typo:code>

You can access any admin helper like saveorcancel or linktonew.

Here we are (born to be kings). I’ll release Typo Gallery when I finish it, which could happen very soon as I’m thinking about quiting Flickr to host my photos somewhere like I used to do with Wordpress + Gallery2 in the past, many, many cycles ago.

Published on 08/04/2011 at 17h08 by Frédéric de Villamil, tags , , , ,

Moving to a new server... and to Ruby 1.9.2

If you can read this… I love starting a blog post with that sentence, it always teases something great, exciting, or just new. So, if you can read this, then, we’ve successfully moved to our new ass kicking server: Quad Core Xeon, 16GB RAM, 2*2TB hard drive on a Gigabit port with as much trafic as the machine can handle.

But that’s not the point.

This blog is running on a yet experimental but apparently working Ruby 1.9.2 compliant version. If you’ve been running 6.0.4 lately, then you can also try running Typo on a Ruby 1.9.2 environment.

This does not work out of the box though. You will need an UTF-8 aware Ruby 1.9 compliant database driver, just like sam-mysql-ruby. To do so, just edit Typo Gemfile and replace the gem 'mysql' line by gem 'sam-mysql-ruby'. If you’re using a custom theme, you’ll probably have to fix your theme encoding too.

As I’ve said, this is very experimental. However, if you’re willing to test this, we’ll be glad to hear your feedback. Just one thing though: don’t complain because you’re using a database driver that’s not UTF-8 compliant: we can’t do anything about it.

Published on 06/03/2011 at 17h43 by Frédéric de Villamil, tags , ,

Release of Typo 6.0.4 : lots of bug fixes and cosmetic improvement

It’s been 3 weeks since we last released a Typo version, and we want to thank all our users who provided great feedback – mostly bug reports, nobody’s perfect. We’ve had a hard time fixing them as these bugs were mostly due to the upgrade to Rails 3.0, but tonight we’re happy to release Typo 6.0.4, fourth of both the Irving Penn series and 2011.

General Improvement

Integrated version checker

When displaying the dashboard, typo will check for the latest release and will display a message accordingly:

  • A notice if Typo’s just a minor version behind.
  • A warning if Typo’s a sub version behind.
  • An error message if Typo’s a major version behind

Our dashboard was almost completely redesigned, making information easier to get and prettier.

Utility Sidebar Widget

A utility sidebar widget was added, displaying various links to Login page, RSS, Typo documentation. This Widget is enabled by default when creating a new blog making the sidebar prettier.

Editable RSS description

RSS description is now editable from the admin. You can add as much HTML as you want to make nice RSS footers.

French Translation

Having 3 Typo commiters out of 4 being French while having an incomplete French translation full of mistakes was a shame. This is now fixed thanks to great work by Ollivier Robert and Sylvain Abelard.

Bug fixes

Invalid publishing time when using a non UTC timezone.
With Rails 2, Active Record used to store contents using local time for timestamps. Rails 3 uses UTC instead, creating a gap between the publishing time and the user’s time. Typo 6.0.4 fixes this making Active Record behave like it should on Rails 3.

Broken theme editor.
A change in the way File.read should be called between Ruby 1.8.6 and Ruby 1.8.7 broke theme file loading. Also theme editor did not raise an error when trying to load non existing files.

Broken migrations when creating a new blog.
Rails 3 upgrade broke initial migration as it was trying to use a non loaded model.

Broken sidebar save button
Upgrade to Rails 3 with use of prototypelegacyhelper plugin broke many AJAX saving feature. This caused sidebars not to be saved anymore.

Broken image links in administration style.
Background images would not load when using Typo in a sub URI.

Broken cache system.
The way caching used to work caused a stale file descriptor bug having the cache not being generated anymore after a sweep.

Broken cache system with sub URIs.
Cache could not be accessed when using a site deployed in a sub URI, making it useless.

Broken sites with https.
Blogs using https would break because Typo was only expecting URLs to start with http only.

Broken Flickr and Lightbox macro filters.
By escaping macro tags, BlueCloth was breaking Flickr and Lightbox macros. This would happen when using Markdown, Textile or Markdown + Smartypants.

Published on 23/02/2011 at 11h30 by Frédéric de Villamil, tags

Release of Typo 6.0.3 – Important bugfix

If you’re using any of the Typo 6.0 series, you really should upgrade to 6.0.3 as it fixes a lot of AJAX related bugs. Having a good unit tests coverage is not always enough, and human test are always worth spending the time we didn’t have. Hopefully, Fabiano Francesconi has been doing a great work reporting bugs he was falling on tonight while I was fixing them.

The culprit is an outdated, buggy Rails Prototype Legacy Helper plugin. This plugin gathers all the fancy AJAX helpers that were removed from Rails 3. We probably should have done some unobtrusive Javascript instead of using that one, but… Typo 6.0 would probably had never been released at all.

As usual, you can download Typo at http://typosphere.org/stable.tgz or http://typosphere.org/stable.zip.

A few things fixed by Typo 6.0.3:

  • Sidebar settings being saved since nothing seemed to happen and the sidebar form would eventually look dead afterwards.
  • Comments preview breaking on most legacy themes, including built in Typographic, Scribbish, Dirtylicious and Standard Issue.
  • Category drag and drop reorder would not do anything.
  • Admin content filtering would render an error.

Published on 01/02/2011 at 20h42 by Frédéric de Villamil, tags

Release of Typo 6.0.2 Irving Penn

Coming only 11 days after Typo 6.0, Typo 6.0.2 is the third release of the Irving Penn series. This is both another bug fixing release, and the beggining of a new feature oriented one, and despite the minor version number and the very little time between releases, it’s an important one as it makes Typo 6.0 series stable enough to be production ready.

Many thanks to Ollivier Robert for improving the French translation. and Luuk Hendriks for various bug reporting.

What’s new in Typo 6.0.2?

Typo is now Thread safe enabled by default. If you wonder what thread safe is about, you should read this question and answer post.

Typo was lacking a recent dark background theme. This error is now fixed with True Red, a brown and red port of default theme True Blue (now in use on our blog). This is also the starting point of a deep thoughts about themes framework.

True Red

Typo now comes with various ways to display date and time on your blog posts. This will allow European and American users to display dates the way they want without having to hack their templates. Existing themes will automatically profit from that improvement.

As usual, French translation was improved. This is not perfect, but we’re still working on it.

Squashed bugs

Made bundle install work from inside subdirectories.

Added a missing .html_safe in the Scribbish theme

Removed deceptive “pointer” cursors in admin accordion-headers.

Made save as draft keep a published article published.

Fixed Flickr and Lightbox plugins

Fixed google sitemap.

Fixed RSS trackbacks feeds.

Published on 29/01/2011 at 10h21 by Frédéric de Villamil, tags

6 years and 2973 commits later

It may sound like a coincidence, but while we were releasing Typo 6.0 Irving Penn for Ruby On Rails 3.0, the blogging engine was officially celebrating his sixth birthday. Tobias did his first commit January the 20th 2005 at 2:08 AM. 6 years and 2973 commits later, Typo has seen 5 major releases (Typo 3 never existed), 8 official maintainers, and was said dead countless times. At that time, Typo had no UI, and articles were written using MarsEdit and the MetaWeblog API.

Relaunch of too-biased

Yesterday I had some time so i decided to tackle a little project I was contemplating for a while.

Welcome typo. Typo is the smallest possible weblog. It doesn’t have an admin interface at all and its based on sqlite. It took about 6 hours to write and most of the work was put into the XMLRPC backend.

So Marsedit is the only way to get any content onto this site now and thats plenty.

As always my code is free under MIT licence and you can fetch it from my svn server at svn://leetsoft.com/typo/trunk

Typo had its 15 minutes of fame, eventually powering blog.rubyonrails.org and becoming one of the sample application for people starting Ruby On Rails. Typo theme contest was a great success, giving it a huge amount of nice templates. Then, for some reason, it turned into a giant bloatware. Its main contributors started another project called Mephisto, and most users switched to Wordpress. Typo was left for dead.

I started using Typo mid 2006 after spending 2 years being a happy and proud contributor of the growing Wordpress community. My first patch was integrated December the 29th 2006, after something like 3 weeks waiting in the limbo. It was the second patch I was submitting, the first one being a complete admin revamping that was too big to be reviewed. After a few times on #typo IRC channel, I understood that the remaining maintainers had something else to do. I had the possibility to migrate my blog to Mephisto, but I had became quite familiar with Typo code, and I wanted a blogware I could hack.

I asked for the project keys, and was eventually given them, Piers Cawley keeping the project lead. My first commit was February the 8th 2007. 4 years later, Typo is still alive, running with 4 cool maintainers, 3 of them being French. The idea of a widely used Rails blogware is no more while Rails became less and less visible, and was more widely used in enterprise projects. I still do think there’s a place on the Web for a Ruby On Rails blogging engine that would be supported by a small community of users and contributors. Typo 6.0.1 now looks mature enough to start building that community. After trying to make Typo more user friendly, I hope we’ll make it actually used, and that’s what I plan to do in the next months.

Published on 23/01/2011 at 14h42 by Frédéric de Villamil, tags

Release of Typo 6.0.1 Irving Penn for Ruby on Rails 3.0

Only 2 days after releasing the long awaited Typo 6.0 Irving Penn for Ruby on Rails 3.0, we’re back with a new version fixing some nasty leftovers bugs and bringing you some improvement. Thank you to Luuk Hendriks for testing this version and submitting patches.

Here’s the list of what we improved…

The dashboard was improved, getting some more figures about spam and content.

Dashboard internationalization was completed.

French translation was improved.

Merged both files and resources view in the admin, first step to a (much) better file upload thing

Made information blocks look different from confirmation ones.

Improved forms help lisibility

and a comprehensive list of what has been fixed.

Bug #192: multi-byte permalinks. - Do not escape the title upon conversion to permalink slug. - Escape permalink sluk upon creation of permalink url. - Search article by permalink and by escaped permalink to support legacy permalink slugs.

Fixed some sidebars using old deprecated code silently dying.

Fixed a bug in the HTML editor inserting image tag even when cancel was clicked.

Fixed a 404 in the administration CSS that was polluting your log files.

Fixed themes not displaying categories correctly (Luuk Hendriks)

Published on 21/01/2011 at 17h31 by Frédéric de Villamil, tags

Powered by Publify – Thème Frédéric de Villamil | Photo Glenn