summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAxel Wagner2014-01-23 03:30:29 (CET)
committer Axel Wagner2014-01-23 03:30:29 (CET)
commitdd005159f9fb25ebc8ef789608a609bcb65fc62c (patch)
tree4447e2fc0abd3e7e378a6f39f2c507af066c4884
parent9a93ea818e893c50a24d6c96f4d41605ee4ff143 (diff)
downloadblog-dd005159f9fb25ebc8ef789608a609bcb65fc62c.tar.gz
blog-dd005159f9fb25ebc8ef789608a609bcb65fc62c.tar.bz2
Add automatic gpg signing of blogposts
-rw-r--r--_layouts/post.html3
-rw-r--r--_plugins/postsigner.rb13
2 files changed, 16 insertions, 0 deletions
diff --git a/_layouts/post.html b/_layouts/post.html
index 7cb6c2c..16a2269 100644
--- a/_layouts/post.html
+++ b/_layouts/post.html
@@ -6,4 +6,7 @@ layout: default
<article class="post">
{{ content }}
+<!--
+{{ page.signature }}
+-->
</article>
diff --git a/_plugins/postsigner.rb b/_plugins/postsigner.rb
new file mode 100644
index 0000000..1c6c05b
--- a/dev/null
+++ b/_plugins/postsigner.rb
@@ -0,0 +1,13 @@
+require 'gpgme'
+
+module Jekyll
+ class PostSigner < Generator
+ def generate(site)
+ crypto = GPGME::Crypto.new(:armor => true)
+ site.posts.each do |post|
+ sig = crypto.sign(post.content)
+ post.data["signature"] = sig.read.force_encoding("UTF-8")
+ end
+ end
+ end
+end