The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Template driven page generation

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Adam Green

Posts: 102
Nickname: darwinian
Registered: Dec, 2005

Adam Green is the author of Ruby.Darwinianweb.com
Template driven page generation Posted: Jan 8, 2006 6:11 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Adam Green.
Original Post: Template driven page generation
Feed Title: ruby.darwinianweb.com
Feed URL: http://www.nemesis-one.com/rss.xml
Feed Description: Adam Green's Ruby development site
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Adam Green
Latest Posts From ruby.darwinianweb.com

Advertisement
I believe in keeping page design separate from program code, so a designer can make changes without modifying any code. It also makes it easier to translate the site into other languages. RubyRiver wll use a text template that is filled with the data from the RSS feed to generate a static HTML page. The site needs a standard template for all of the pages, and a smaller template to define the format of an individual feed item. Here is the main page template.

page.html

 <html>
<head>
<title><*sitetitle*></title>
<link rel="alternate" type="application/rss+xml" title="RSS" href="<*publishedfeed*>.xml">
<link rel="stylesheet" type="text/css" href="page.css" >
</head
<body>
<div class="header">
<div class="title"><*sitetitle*></div>
<div class="subtitle"><*sitedescription*></div>
</div>
<div class="content">
<*content*>
</div>
<div class="navbar" >
<div class="navtext">RubyRiver was created by Adam Green.
All RubyRiver code uses the same license as Ruby.</div>
<div class="navtext">Send email to:<br>adam*at*darwinianweb.com</div>
<div class="navtext"><a href="/<*publishedfeed*>.xml" class="noline">
<img src="feed.gif" height="24" width="24" alt="Use this link to
subscribe to the site's feed" border="0"></a>
<a href="/<*publishedfeed*>.xml">Subscribe</a></div>
<div class="navheader">Other Adam Green sites</div>
<div class="navtext"><a href="http://darwinianweb.com">DarwinianWeb.com</a></div>
<div class="navtext"><a href="http://ruby.darwinianweb.com">Ruby.DarwinianWeb.com</a></div>
<div class="navheader">Ruby feeds on this site</div>
<div class="navtext"><*feedlist*></div>
</div>
</body>
</html>

Read: Template driven page generation

Topic: The PDX.rb Podcast Previous Topic   Next Topic Topic: Excerpting HTML

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use