perldancer-website icon indicating copy to clipboard operation
perldancer-website copied to clipboard

Static version of the PerlDancer website (using Wallflower)

Open book opened this issue 13 years ago • 4 comments

Wallflower makes it possible to generate a static website from any Plack application.

A static website has however some different requirements than a dynamic website (e.g. content-type is usually determined by the webserver using the extension), so a small rewrite was necessary.

To generate the site, install App::Wallflower (https://metacpan.org/release/App-Wallflower), possibly read the tutorial (https://metacpan.org/module/Wallflower::Tutorial), and then simply run:

wallflower -a bin/app.pl -d <destination>

You'll then have a bunch of static files that can be installed anywhere with a web server. Add a cronjob to regenerate the files and update the site at the frequency you want, and you're done!

Note that the only page I didn't test is the dancefloor.html page, because I didn't have some of the requirements.

book avatar Nov 08 '12 09:11 book

I understand that in some cases having a static site is useful, but I am not sure why should the main PerlDancer website be static. Am I misunderstanding something in your pull-request?

szabgab avatar Dec 16 '14 11:12 szabgab

For one thing, the site uses dynamic parts for e.g. fetching thumbnails for the dancefloor page, etc - and it'd be nice to add even more dynamic stuff in future - so I'd prefer to see it continue to be a Dancer app seved up. It's also a showcase of Dancer serving up a live app, along with lots of other examples in the wild :)

bigpresh avatar Dec 16 '14 11:12 bigpresh

I'm not overly attached to this, it was a showcase for Wallflower. I now have http://cpan.io/ filling that role. ;-)

The idea behind it is that:

  • static sites are more secure and less CPU intensive
  • most dynamic stuff can be achieved with JavaScript (do the thumbnails really have to be generated on demand? IIRC they are cached, so a cronjob would do just fine for updating the cache)
  • this site is still fully generated by a Dancer app, so it's still a pretty good Dancer showcase

book avatar Dec 16 '14 11:12 book

It could be nice to use Wallflower to generate a static version of the site. Using a GitHub workflow we could then use GitHub pages to host the static version of the website generated on demand / commits / PR...

atoomic avatar Apr 04 '22 16:04 atoomic