From 38a7cfc25b5720441566cfd73b0581d6931e2f06 Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Thu, 18 May 2017 14:12:32 +0200 Subject: [PATCH] Addad param for dateformat. --- README.md | 2 ++ layouts/_default/li.html | 2 +- layouts/partials/submitted.html | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a014cba..d3b062e 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,8 @@ params: cacheBustJS: true # Add a cache busting hash on script.js sidebar: true # Show a sidebar to the right submitted: false # Show author and date information for a post. + dateformat: "" # Set the date format, default to "2 January, 2006" + ``` diff --git a/layouts/_default/li.html b/layouts/_default/li.html index 577446e..e379e58 100644 --- a/layouts/_default/li.html +++ b/layouts/_default/li.html @@ -1 +1 @@ -
  • {{ .Title }} {{ .Date }}
  • +
  • {{ .Title }} – {{ .Date.Format ($.Param "dateformat" | default "2 January, 2006") }}
  • diff --git a/layouts/partials/submitted.html b/layouts/partials/submitted.html index c3e58b6..cb56c4f 100644 --- a/layouts/partials/submitted.html +++ b/layouts/partials/submitted.html @@ -1,4 +1,4 @@

    {{ with $.Param "author" }}{{ . }} – {{ end -}} -{{ .Date.Format "2 January, 2006" }} +{{ .Date.Format ($.Param "dateformat" | default "2 January, 2006") }}