<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,6 +1,6 @@
 h1. Layout Layer
 
-This extension only does one job, but it does it well: Automatically creates layouts based on HTML files in other extensions.
+This extension only does one job, but it does it well: Automatically creates layouts and snippets based on HTML files in other extensions.
 
 h2. Why?
 
@@ -21,6 +21,8 @@ So: Any HTML files within an extension's layouts folder (which is not part of th
 
 These layouts get regenerated every time the Rails environment is reloaded. On production systems, this happens when you restart the web server (for example: Mongrel). In development systems, it happens every time you load a page. You should never need to do anything beyond edit the files to see the changes reflected as your developing your intricate CMS.
 
+All the above applies to Snippets as well.
+
 h2. Who is Responsible?
 
 This extension was written in under an hour by &quot;Pat Allan&quot;:http://freelancing-gods - that's not meant as a boast, just an indication of how small it is. If you have questions, comments, suggestions, criticisms and/or patches, you can either email pat at freelancing-gods dot com, hassle him on &quot;Twitter&quot;:http://twitter.com/pat, or send a message via &quot;GitHub&quot;:http://github.com/freelancing-god.
\ No newline at end of file</diff>
      <filename>README.textile</filename>
    </modified>
    <modified>
      <diff>@@ -2,8 +2,8 @@ require 'action_controller/dispatcher'
 require 'layout_layer'
 
 class LayoutLayerExtension &lt; Radiant::Extension
-  version &quot;1.0.1&quot;
-  description &quot;Automatically create layouts based on HTML files in other extensions&quot;
+  version &quot;1.1&quot;
+  description &quot;Automatically create layouts and snippets based on HTML files in other extensions&quot;
   url &quot;http://github.com/freelancing-god/radiant-layout-layer&quot;
   
   def activate</diff>
      <filename>layout_layer_extension.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,10 @@
 class LayoutLayer
-  LayoutsPath = File.join RAILS_ROOT, &quot;vendor&quot;, &quot;extensions&quot;, &quot;*&quot;, &quot;layouts&quot;
+  LayoutsPath  = File.join RAILS_ROOT, &quot;vendor&quot;, &quot;extensions&quot;, &quot;*&quot;, &quot;layouts&quot;
+  SnippetsPath = File.join RAILS_ROOT, &quot;vendor&quot;, &quot;extensions&quot;, &quot;*&quot;, &quot;snippets&quot;
   
   def self.lay
     ActionController::Base.logger.add(
-      Logger::DEBUG, &quot;\n  LayoutLayer: Laying down some layouts&quot;
+      Logger::DEBUG, &quot;\n  LayoutLayer: Laying down some layouts and snippets&quot;
     )
     
     Dir[LayoutsPath].each do |layouts|
@@ -15,6 +16,16 @@ class LayoutLayer
         layout.save
       end
     end
+    
+    Dir[SnippetsPath].each do |snippets|
+      Dir[File.join(snippets, &quot;**&quot;, &quot;*.html&quot;)].each do |html|
+        name = file_name_to_layout_name(snippets, html)
+        snippet = Snippet.find_by_name(name) || Snippet.new(:name =&gt; name)
+        
+        snippet.content = open(html) { |file| file.read }
+        snippet.save
+      end
+    end
   end
   
   private</diff>
      <filename>lib/layout_layer.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>3011e931359c74bdcbc095184c8bdf91bd6308f9</id>
    </parent>
  </parents>
  <author>
    <name>Pat Allan</name>
    <email>pat@freelancing-gods.com</email>
  </author>
  <url>http://github.com/freelancing-god/radiant-layout-layer/commit/cc191d11dc1fb888556b0c3d2d5a1f8517da61a9</url>
  <id>cc191d11dc1fb888556b0c3d2d5a1f8517da61a9</id>
  <committed-date>2009-01-22T19:17:58-08:00</committed-date>
  <authored-date>2009-01-22T19:17:58-08:00</authored-date>
  <message>Adding snippets support as well</message>
  <tree>b7d4ae2869890936a3027642c3e61ede859039e7</tree>
  <committer>
    <name>Pat Allan</name>
    <email>pat@freelancing-gods.com</email>
  </committer>
</commit>
