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.
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’?
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]
)
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)
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.