You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2019/12/20 13:03:46 UTC

[royale-docs] branch master updated: adding plugin for timestamp

This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/royale-docs.git


The following commit(s) were added to refs/heads/master by this push:
     new 64ff4d4  adding plugin for timestamp
64ff4d4 is described below

commit 64ff4d4aba8d8fd364104f17f1e739f2a3ee08e3
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Fri Dec 20 14:03:38 2019 +0100

    adding plugin for timestamp
---
 _layouts/docpage.html                   | 2 +-
 _plugins/hook-add-last-modified-date.rb | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/_layouts/docpage.html b/_layouts/docpage.html
index 3a459da..669008b 100644
--- a/_layouts/docpage.html
+++ b/_layouts/docpage.html
@@ -47,7 +47,7 @@ limitations under the License.
     <div class="page-content">
       <article>
         {{content}}
-        <span>This page was modified last time: {{ page.last-modified-date }}</span>
+        <span>This page was modified last time: {{ page.last-modified-date | date: '%B %d, %Y' }}</span>
         <div class="bottom-links">
           <a href="https://github.com/apache/royale-docs/edit/master/{{ page.path }}" target="_blank">Edit this page</a>
         </div>
diff --git a/_plugins/hook-add-last-modified-date.rb b/_plugins/hook-add-last-modified-date.rb
new file mode 100644
index 0000000..316a1f1
--- /dev/null
+++ b/_plugins/hook-add-last-modified-date.rb
@@ -0,0 +1,9 @@
+Jekyll::Hooks.register :posts, :pre_render do |post|
+
+# get the current post last modified time
+modification_time = File.mtime( post.path )
+
+# inject modification_time in post's datas.
+post.data['last-modified-date'] = modification_time
+
+end
\ No newline at end of file