Nick Sieger: RubyConf: John Long: Radiant CMS tag:blog.nicksieger.com,2005:Typo Typo 2007-08-31T16:50:38+00:00 Nick Sieger urn:uuid:c4baea74-8073-49c0-be1e-97919ce5fb65 2006-10-21T02:54:00+00:00 2007-08-31T16:50:38+00:00 RubyConf: John Long: Radiant CMS <h2>What is Radiant?</h2> <ul> <li>No-fluff, lightweight CMS for small teams</li> <li>Simplicity over features</li> <li>A little more than a blogging engine</li> <li>Made for designers and programmers (techies)</li> <li>Tag-based template language</li> <li>Total control over output</li> <li>Plugin extension mechanism under development</li> <li>Content sites, not portal software</li> </ul> <h2>Getting Started</h2> <ul> <li>Install: <code>gem install radiant</code></li> <li>Generate a new application: <code>mkdir demo &amp;&amp; cd demo &amp;&amp; radiant .</code></li> <li>Configure database: <code>cp config/database.sqlite.yml config/database.yml</code></li> </ul> <h2>Installation types</h2> <ul> <li>Instance mode vs. application mode (whether or not you have Rails source present). Instance mode also makes it possible to clone and share customize Radiant applications.</li> <li>Base application includes an admin interface</li> </ul> <h2>Pages, Snippets and Layouts</h2> <ul> <li>Hierarchical page management</li> <li>Create page in several states (draft, reviewed, published) in Textile or Markdown with slug, breadcrumb, and layout</li> <li>Snippets are small chunks of content that can be shared between pages (to DRY up your content)</li> <li>Layouts that can be broken down into components of the layout (sidebar, etc.)</li> </ul> <h2>Tags</h2> <ul> <li><a href="http://radius.rubyforge.org/">Radius</a></li> <li><code>&lt;r:title/&gt;</code>, <code>&lt;r:content part="sidebar" inherit="true"/&gt;</code>, <code>&lt;r:snippet name="footer"/&gt;</code>, <code>&lt;r:if_content part="extended"&gt;...&lt;/r:if_content&gt;</code>, <code>&lt;r:children:each limit="5" order="desc"&gt;...&lt;/r:children:each&gt;</code></li> <li>Tags can be embedded anywhere, not just in the layout</li> <li>Tags are contextual &#8211; e.g., <code>&lt;r:title/&gt;</code> picks the correct title even if it is embedded within a snippet within multiple pages</li> <li>Custom tags possible with &#8220;behavior&#8221;</li> </ul> <h2>Text Filters</h2> <ul> <li>Textile (RedCloth), Markdown (BlueCloth), SmartyPants</li> <li>Vanilla HTML (no filtering)</li> <li>Custom filters possible. [This is my own example below, not John&#8217;s.] <div class="typocode"><pre><code class="typocode_ruby "> <span class="keyword">class </span><span class="class">MyFilter</span> <span class="punct">&lt;</span> <span class="constant">TextFilter</span><span class="punct">::</span><span class="constant">Base</span> <span class="ident">register</span> <span class="punct">'</span><span class="string">profanity filter</span><span class="punct">'</span> <span class="keyword">def </span><span class="method">filter</span><span class="punct">(</span><span class="ident">txt</span><span class="punct">)</span> <span class="ident">txt</span><span class="punct">.</span><span class="ident">gsub</span><span class="punct">(/</span><span class="regex">(damn|ass|shit)</span><span class="punct">/</span><span class="ident">i</span><span class="punct">,</span> <span class="punct">'</span><span class="string">####</span><span class="punct">')</span> <span class="keyword">end</span> <span class="keyword">end</span> </code></pre></div></li> </ul> <p>Radiant is powering the new <a href="http://www.ruby-lang.org/">ruby-lang.org</a> site. Overall, a slick, well-thought out, polished, extendable CMS done very much in the philosophy of Ruby and Rails. Check it out!</p>