aboutsummaryrefslogtreecommitdiffstats
path: root/site/_plugins/render_time.rb
diff options
context:
space:
mode:
authorStephane Desneux <stephane.desneux@iot.bzh>2016-11-11 16:31:04 +0100
committerStephane Desneux <stephane.desneux@iot.bzh>2016-11-11 16:31:04 +0100
commit5848a1052714da051ff8361dd880004e8cdc75ce (patch)
treed5aab63fadb4dfff0d01c39fc9c4738fda4c6314 /site/_plugins/render_time.rb
parent80d9194c56e4cecc3a00acd71033ca7ff35064cf (diff)
webdocs: add rendering date in footer
Change-Id: Id73d13cefdcea8687cdc94754354522e34ba266d Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
Diffstat (limited to 'site/_plugins/render_time.rb')
-rw-r--r--site/_plugins/render_time.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/site/_plugins/render_time.rb b/site/_plugins/render_time.rb
new file mode 100644
index 0000000..afd0fb4
--- /dev/null
+++ b/site/_plugins/render_time.rb
@@ -0,0 +1,18 @@
+# Check doc at http://jekyllrb.com/docs/plugins/#tags
+# use in page with <p>{% render_time page rendered at: %}</p>
+
+module Jekyll
+ class RenderTimeTag < Liquid::Tag
+
+ def initialize(tag_name, text, tokens)
+ super
+ @text = text
+ end
+
+ def render(context)
+ "#{@text} #{Time.now}"
+ end
+ end
+end
+
+Liquid::Template.register_tag('render_time', Jekyll::RenderTimeTag)