]> git.draconx.ca Git - homepage.git/blobdiff - Rules
Add copyright license information.
[homepage.git] / Rules
diff --git a/Rules b/Rules
index 547a0a9dd340c32fd19c6ee58d7671c1febcee28..06f3a110b041d108383e37d6c4621b356da69761 100644 (file)
--- a/Rules
+++ b/Rules
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
+preprocess do
+    commit = nil
+    Open3.popen2("git", "rev-parse", "HEAD") do |stdin, stdout, result|
+        stdin.close
+        val = stdout.gets
+        stdout.close
+        commit = val.chomp if result.value.success?
+    end
+
+    if commit then
+        @items.each do |item|
+            item[:gitrev] = commit if item_source(item)
+        end
+    end
+end
+
 compile '/**/*.md' do
     filter :kramdown, header_offset: 1
     layout '/default.xml'
@@ -23,6 +39,23 @@ compile '/**/*.md' do
     write to_xhtml
 end
 
+compile '/license/cc*.sgml' do
+    filter :sgml2xml
+    layout '/creativecommons.xsl'
+    layout '/default.xml'
+    layout '/default.xsl'
+    filter :relativize_paths, type: :xml
+    write to_xhtml
+end
+
+compile '/license/cc*.xhtml' do
+    layout '/creativecommons.xsl'
+    layout '/default.xml'
+    layout '/default.xsl'
+    filter :relativize_paths, type: :xml
+    write to_xhtml
+end
+
 passthrough '/**/*'
 layout '/**/*.xsl', :xsl
 layout '/**/*', :erb