strapyourself.in and flouri.sh

Mephisto UV Syntax Highlighting Plugin

December 3rd, 2007

After I wrote the article on hacking UV into mephisto, I made it an actual plugin. The only trick was inserting a fake codepress.rb file since mephisto requires "codepress" in 2 places.

To get up and running:

  • Delete the existing filtered_column_code_macro plugin.
  • ./script/plugin install http://wush.net/svn/public/plugins/mephisto/uv_code_macro
  • Copy over UV's xhtml theme CSS files. See using UV as a library.
    You'll have to run something like Uv.copy_files "xhtml", "public/stylesheets" from the console
  • Include one or more of the new stylesheets in your layout.
  • Use <filter:code lang="XXXX" theme="XXXX"> tags to highlight your code!

Mephisto Flickr AJAX Loader

December 1st, 2007

I'm tired of waiting for my blog to load because of a slow flickr feed request! I designed this new plugin by copying the flickr photostream plugin, but making it actually load the pictures and the feed through an immediate AJAX request. This tremendously increased the performance of my mephisto pages!

The plugin defines a flickr controller, which accepts the AJAX request. Unfortunately, you can't change how the photos are laid out anymore (I'm not setting up a liquid context for this ajax response). Of course, if you don't like the result of the plugin, just change it to match what you want:

class FlickrController < ActionController::Base
  def index
    result = ""
    pics = find_pictures
    pics.each do |pic|
      result << "<a href='#{pic.link}'><img src='#{pic.send(params[:format].to_sym)}' alt='#{pic.title}'></a>"
    end

    render :inline => result
  end
end

How to install and use

  • Uninstall the flickr photostream plugin
  • ./script/plugin install http://wush.net/svn/public/plugins/mephisto/mephisto_flickr_ajax
  • Use the following tag in your liquid template:
    {{flickrajaxphotostream feed:<YOUR_FEED_URL> count:<NUMBER_IMAGES> format:<[square, small, etc]>}}
    {{endflickrajaxphotostream}}
  • Originally posted on ELC's blog
original design by gorotron ported by railsgrunt powered by mephisto