Nick Sieger: RubyConf: John Long: Radiant CMStag:blog.nicksieger.com,2005:TypoTypo2007-08-31T16:50:38+00:00Nick Siegerurn:uuid:c4baea74-8073-49c0-be1e-97919ce5fb652006-10-21T02:54:00+00:002007-08-31T16:50:38+00:00RubyConf: 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 && cd demo && 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><r:title/></code>, <code><r:content part="sidebar" inherit="true"/></code>, <code><r:snippet name="footer"/></code>, <code><r:if_content part="extended">...</r:if_content></code>, <code><r:children:each limit="5" order="desc">...</r:children:each></code></li>
<li>Tags can be embedded anywhere, not just in the layout</li>
<li>Tags are contextual – e.g., <code><r:title/></code> picks the correct title even if it is embedded within a snippet within multiple pages</li>
<li>Custom tags possible with “behavior”</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’s.]
<div class="typocode"><pre><code class="typocode_ruby "> <span class="keyword">class </span><span class="class">MyFilter</span> <span class="punct"><</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>