Webby 0.8.0

Webby version 0.8.0 (Apocalypse Cow)
by Tim P.
http://webby.rubyforge.org/
(the “Apocalypse Cow” release)

== DESCRIPTION

Webby is a super fantastic little website management system. It would be
called a content management system if it were a bigger kid. But, it’s
just a runt with a special knack for transforming text. And that’s
really
all it does - manages the legwork of turning text into something else,
an
ASCII Alchemist if you will.

== IMPORTANT CHANGES

The Graphviz and CodeRay filters have been removed, and the
functionality those filters provide have been converted into Ruby
methods available via ERB. This will require a code change for any
page that uses one of those filters.

def some_method() nil end

Will need to change to:

<% coderay(:lang => ‘ruby’) do %>
def some_method()
nil
end
<% end %>

Similar changes will need to be made for graphviz blocks (which, I
assume, are much less used by the general public). The reason for this
change, simply put, is speed. Providing CodeRay and Graphviz
functionality
via ERB methods reduces the number of times the page must be parsed.

Here is a snippet of Ruby code that will transform a file:
http://pastie.caboo.se/153245

== CHANGES

  • 3 major enhancements
    • Added support for partials
    • Refactored the coderay and graphviz filters into helper methods
      accessible from ERB
    • Added support for embedding LaTeX mathematical equations
  • 3 minor enhancements
    • Added a template file for creating Atom feeds
    • The SITE configuration is available in pages and layouts as
      the @config variable
    • Can specify the port the Heel webserver starts on using the
      SITE.heel_port option in the Rakefile
  • 2 bug fixes
    • When creating pages in directory mode the full page path was
      not being created
    • Read only files were being created in the output folder
      preventing them from being overwritten if changed

You’ll need to update the rake tasks for any Webby sites you have
created:

webby -u site_directory

== FUN FACT

Walt Disney was afraid of mice.

== POST SCRIPT

Blessings,
TwP

There’s a broken link at the bottom of the main
http://webby.rubyforge.org page:

http://webby.rubyforge.org/tutorial.html

[email protected] wrote:

all it does - manages the legwork of turning text into something else, an
ASCII Alchemist if you will.

Very slick.

Quick question (could not find an answer on the project site): How do I
configure a site to write the generated site to a directory other than
‘output’?


James B.

http://web2.0validator.com - We’re the Dot in Web 2.0
http://www.rubyaz.org - Hacking in the Desert
http://www.jamesbritt.com - Playing with Better Toys

On Mar 1, 2008, at 12:10 AM, James B. wrote:

just a runt with a special knack for transforming text. And that’s
other than ‘output’?

Add the following line to the project Rakefile

SITE.output_dir = ‘your/new/output/directory’

The SITE constant is an OpenStruct that holds all the defaults for the
website. Here are all the default settings (just FYI) – you can find
them in the lib/webby.rb file in the gem

 @site = OpenStruct.new(
   :output_dir    => 'output',
   :content_dir   => 'content',
   :layout_dir    => 'layouts',
   :template_dir  => 'templates',
   :exclude       => %w(tmp$ bak$ ~$ CVS \.svn),
   :page_defaults => {
     'layout'     => 'default'
   },
   :find_by       => 'title',
   :base          => nil,
   :create_mode   => 'page',

   # Items for running the heel webserver
   :heel_port => 4331,

   # Items used to deploy the webiste
   :host       => '[email protected]',
   :remote_dir => '/not/a/valid/dir',
   :rsync_args => %w(-av --delete),

   # Options passed to the 'tidy' program when the tidy filter is

used
:tidy_options => ‘-indent -wrap 80’,

   # XPath identifiers used by the basepath filter
   :xpaths => %w(
       /html/head//base[@href]
       /html/head//link[@href]
       //script[@src]
       /html/body[@background]
       /html/body//a[@href]
       /html/body//object[@data]
       /html/body//img[@src]
       /html/body//area[@href]
       /html/body//form[@action]
       /html/body//input[@src]
   )
   # other possible XPaths to include for base path substitution
   #   /html/body//object[@usemap]
   #   /html/body//img[@usemap]
   #   /html/body//input[@usemap]
 )

Blessings,
TwP

Tim P. wrote:

On Mar 1, 2008, at 12:10 AM, James B. wrote:

Quick question (could not find an answer on the project site): How do
I configure a site to write the generated site to a directory other
than ‘output’?

Add the following line to the project Rakefile

SITE.output_dir = ‘your/new/output/directory’

Great. Thank you very much. Really good work.


James B.

“Programs must be written for people to read, and only incidentally
for machines to execute.”

  • H. Abelson and G. Sussman
    (in "The Structure and Interpretation of Computer Programs)