[squeak-dev] squeak.org - an update

Chris Cunnington smalltalktelevision at gmail.com
Tue Dec 18 20:32:36 UTC 2012


I've redesigned squeak.org and I think all the problems are solved. The 
problems were a doubling menu bar; an extraneous navbar; Altitude 
components that didn't jibe with the Bootstrap layout; and, 24-char 
tokens instead of regular looking URIs (i.e. /community or /blogs).

The way the Altitude's examples are laid out uses composition and a 
class that acts as a frame with a navbar. The frame allows other 
classes/components to be swapped out of an ivar called #current with the 
navbar.

I did away with that and replaced composition with inheritance. Now 
there is an abstract superclass (i.e. SQAbstractSuperclass) and every 
page with content is a subclass with a #renderConentOn: method. The 
navbar supplied by Bootstrap is created by the abstract superclass. All 
links are hyperlinks (i.e. all "html a href:" and no "html a navigate:", 
"html a callback:", or "html a linkTo:").

So the superclass creates the menu. All the content classes have 
#renderContentOn:. The only remaining thing is to list all the tokens 
you'll use for URIs in SQSqueakApplication>>#initializeLocator.

initializeLocator
     locator
         at: ALPath root
         put: SQHomePage new asResource.
     locator at: ALPath / 'license'
         put: SQLicensePage new asResource.
     locator at: ALPath / 'blogs'
         put: SQBlogsPage new asResource.
     locator at: ALPath / 'docs'
         put: SQDocumentationPage new asResource.
     locator at: ALPath / 'community'
         put: SQMailingListsPage new asResource.
     locator at: ALPath / 'devlinks'
         put: SQDeveloperLinksPage new asResource.
     locator at: ALPath / 'projects'
         put: SQProjectLinksPage new asResource.

The result is a website using standard looking URIs that is dead easy to 
make. It won't win any prizes, but it fits the spec and is simple as a 
pin. Altitude is nothing of not versatile. There are color, positioning, 
etc. details so it'll be a few days before I deploy the new version.

Chris


More information about the Squeak-dev mailing list