[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby tools for managing static websites?

Chris Pearl

10/31/2006 12:08:00 PM

Are there Ruby tools to help webmasters manage static websites?

I'm talking about regenerating an entire static website - all the HTML
files in their appropriate directories and sub-directories. Each page
has some fixed parts (navigation menu, header, footer) and some
changing parts (body content, though in specific cases the normally
fixed parts might change as well). The tool should help to keep site
editing DRY every piece of data, including the recurring parts, should
exist only once.

The above should be doable with any decent templating tool, such as
those forming part of most CMSes and full-stack web-frameworks.
Normally I might have just resorted to a CMS/web-framework, running
locally on the webmaster's station, with the only addition being a
mechanism for generating all pages composing the site and saving them
as files.

But such a solution might not be enough, as the system I'm looking for
must be able to control the physical traits of the website as a
collection of files - e.g., creation and distribution of files among
several physical directories and subdirectories.

Any advice would be appreciated,
-Chris

20 Answers

Vincent Fourmond

10/31/2006 12:13:00 PM

0

Chris Pearl wrote:
> Are there Ruby tools to help webmasters manage static websites?

webgen.rubyforge.org.

I personally find it great and easy to use. See their web page there,
and try a look at mine ;-)...

Vince

--
Vincent Fourmond, PhD student
http://vincent.fourmon...

Bil Kleb

10/31/2006 12:19:00 PM

0

Chris Pearl wrote:
> Are there Ruby tools to help webmasters manage static websites?

Don't know if it fits, but take a look at: http://radi...

Regards,
--
Bil Kleb
http://kleb.tadalist.com/lists/pub...

Ross Bamford

10/31/2006 2:23:00 PM

0

On Tue, 31 Oct 2006 12:08:24 -0000, Chris Pearl <chrispearl@gmail.com>
wrote:

> Are there Ruby tools to help webmasters manage static websites?

Check out Rote - sounds like it's custom-designed for your needs :)

http://rote.ruby...

--
Ross Bamford - rosco@roscopeco.REMOVE.co.uk

Farrel Lifson

10/31/2006 2:39:00 PM

0

On 31/10/06, Chris Pearl <chrispearl@gmail.com> wrote:
> Are there Ruby tools to help webmasters manage static websites?
>
> I'm talking about regenerating an entire static website - all the HTML
> files in their appropriate directories and sub-directories. Each page
> has some fixed parts (navigation menu, header, footer) and some
> changing parts (body content, though in specific cases the normally
> fixed parts might change as well). The tool should help to keep site
> editing DRY every piece of data, including the recurring parts, should
> exist only once.
>
> The above should be doable with any decent templating tool, such as
> those forming part of most CMSes and full-stack web-frameworks.
> Normally I might have just resorted to a CMS/web-framework, running
> locally on the webmaster's station, with the only addition being a
> mechanism for generating all pages composing the site and saving them
> as files.
>
> But such a solution might not be enough, as the system I'm looking for
> must be able to control the physical traits of the website as a
> collection of files - e.g., creation and distribution of files among
> several physical directories and subdirectories.
>
> Any advice would be appreciated,
> -Chris

There's also Hobix (http:.//www.hobix.com) although it doesn't look
like there have been any updates there for a while.

Farrel

Ara.T.Howard

10/31/2006 4:03:00 PM

0

khaines

10/31/2006 6:13:00 PM

0

Chris Pearl

11/1/2006 6:08:00 AM

0

On 10/31/06, ara.t.howard@noaa.gov <ara.t.howard@noaa.gov> wrote:
> i'm not quite clear why you wouldn't just setup a rails site and crawl it to
> generate the static site? since speed wouldn't be an issue on the rails end
> you could just use webrick and an sqlite db to keep things simple and
> dependancy free. this gives you a huge toolset to work from and a mailing
> list to ask questions on - the only custom work you'd need to do is write a
> dedicated crawler script, and even that might turn out to be nothing but a
> single wget command if you planned your site carefully.

For the needs I described, Rails integrates a lot of features that
aren't needed, quite a bit that would have to be awkwardly worked
around, and afaik only a little which would actually help.

Static websites don't require an ORM, and don't use business objects.
So ActiveRecord would be pretty much useless.

As for routing, ActionController's abstractions work well for dynamic,
RESTful, CRUDy web applications, but very poorly for run-of-the-mill
static websites. ActionController is oriented towards objects and
namespaces, not files and directories. You could conceivably map
directories to controller-namespaces, and files to Controller methods.
At best, it would be awkward: adding a directory 5 level deep, which
is quite common for a static website, would entail creating a 5 level
controller namespace - awkward and rarely done in Rails. I suspect
there would be more serious problems the more you stretch the analogy
between the not-so-similar metaphors. Off the top of my head, a common
directory rename would appear to be a serious pain (you'd have to
rename the containing module for all controllers contained within that
directory). I.e. Rails would make that operation harder than it would
normally be, while a dedicated static-website management tool should
make it easier (e.g. by automatically updating certain internal links
etc.)

The only part that would appear to be helpful is ActionView, and maybe
some helpers (most helpers are oriented to dynamic web-application
needs: dynamic forms, AJAX etc.) I'm not sure the above overhead is
worth it just to get a templating system, that's - let's face it - an
integrated ERB :)

As for missing stuff, Rails works well for CRUDing business objects,
but the simpler metaphor - your old bunch of pages with some common
and some unique elements - isn't supported out of the box. I'd
basically have to write a simple CMS to organize the content (unique)
parts of each page. That's besides the crawler/saver script, which
I'm not sure is completely trivial: for example, the way Rails handles
embedded files - stylesheets, javascripts and images - is incompatible
with the way they are treated in a normal static website.

All in all, a file-and-directory based management tool with a decent
templating system would seem a much better fit. Especially given that
Rails invests mainly in features that aren't required in this case -
ActiveRecord, AJAX - and comparatively little in the few features that
we do need: the templating system. One could easily imagine a
static-website management tool integrating a much better - or at least
more suitable - templating solution than ERB.

> cheers.
>
> -a
> --
> my religion is very simple. my religion is kindness. -- the dalai lama
>
>

Thanks,
-Chris

Ara.T.Howard

11/1/2006 7:24:00 AM

0

Ross Bamford

11/1/2006 12:03:00 PM

0

On Wed, 01 Nov 2006 06:08:06 -0000, Chris Pearl <chrispearl@gmail.com>
wrote:

> The only part that would appear to be helpful is ActionView, and maybe
> some helpers (most helpers are oriented to dynamic web-application
> needs: dynamic forms, AJAX etc.) I'm not sure the above overhead is
> worth it just to get a templating system, that's - let's face it - an
> integrated ERB :)
>

<hard-sell>

Actually, Rote allows you to mix in ActionView helpers to your pages -
we've already made a start on making the Page API compatible for that.
Obviously not everything makes sense in a static site, but the tag
helpers, form helpers, etc. can be pretty useful. All it takes is:

require 'active_support'
require 'action_view'

class Rote::Page
include ActionView::Helpers::FormHelper
end

dropped in the Rakefile rote gives you. We're also looking at getting
partials working properly, too.

</hard-sell :) >

--
Ross Bamford - rosco@roscopeco.remove.co.uk

Rimantas Liubertas

11/1/2006 12:24:00 PM

0

<...>
> Static websites don't require an ORM, and don't use business objects.
> So ActiveRecord would be pretty much useless.

Some static sites are dynamic but with slow dinamics :). For these it is very
convenient to have content in DB and have administration interface
written in Rails.
Because content doesn't change so often (or for security reasons) such
site then can
be crawled to static pages which are put on public web server.

When the need for really dynamic site will come this way will make
transition very easy.

<...>
> At best, it would be awkward: adding a directory 5 level deep, which
> is quite common for a static website, would entail creating a 5 level
> controller namespace - awkward and rarely done in Rails.
<...>

This is not true. Not everything in the routes must be a controller.

> One could easily imagine a
> static-website management tool integrating a much better - or at least
> more suitable - templating solution than ERB.

I guess I either have a problem with my imagination or my needs
are so simple that ERB and some helpers suit them very well...


Regards,
Rimantas
--
http://rim...