From a18f4abf0bb35e1a6e9d19857c0fc7c0f577f4e9 Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Thu, 19 Dec 2019 21:50:48 -0500 Subject: [PATCH] use two date formats (the second one more verbose, for tool tips) --- bandali/prefs.scm | 7 ++++--- bandali/theme.scm | 26 +++++++++++++++++--------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/bandali/prefs.scm b/bandali/prefs.scm index c908eb8..57712a1 100644 --- a/bandali/prefs.scm +++ b/bandali/prefs.scm @@ -19,12 +19,13 @@ my-domain my-url my-tag-prefix - my-date-format)) + my-primary-date-format + my-secondary-date-format)) (define my-scheme 'https) (define my-domain "bandali.eu.org") (define my-url (string-append (symbol->string my-scheme) "://" my-domain)) (define my-tag-prefix "tags") -(define my-date-format "~B ~e, ~Y") - +(define my-primary-date-format "~1") +(define my-secondary-date-format "~A ~B ~e, ~Y") diff --git a/bandali/theme.scm b/bandali/theme.scm index 44c00f6..d6e4ef2 100644 --- a/bandali/theme.scm +++ b/bandali/theme.scm @@ -64,8 +64,11 @@ `(tr (td ,(aa (post-ref post 'title) (post-uri site post prefix))) - (td (small ,(date->string (post-date post) - my-date-format))))) + (td (small (@ (title + ,(date->string (post-date post) + my-secondary-date-format))) + ,(date->string (post-date post) + my-primary-date-format))))) posts))))) (define (my-post-template post) @@ -74,13 +77,18 @@ (address "By " ,(aa (post-ref post 'author) "/") " <" ,(post-ref post 'email) ">") (p (@ (class "date")) - "Published " - ,(date->string (post-date post) my-date-format)) - ,(if (post-ref post 'updated) - `(p (@ (class "updated")) - "Updated " - ,(date->string (post-ref post 'updated) - my-date-format)) '()) + (span (@ (title ,(date->string (post-date post) + my-secondary-date-format))) + ,(date->string (post-date post) + my-primary-date-format)) + ,(if (post-ref post 'updated) + `(" (updated on " + (span (@ (title + ,(date->string (post-ref post 'updated) + my-secondary-date-format))) + ,(date->string (post-ref post 'updated) + my-primary-date-format)) + ")") '())) ,(if (post-ref post 'tags) `(p (@ (class "tags")) "Tagged " -- 2.20.1