]> gitweb.fperrin.net Git - atom.el.git/commitdiff
Add published propety master
authorFrédéric Perrin <fred@fperrin.net>
Tue, 2 Apr 2024 19:25:00 +0000 (20:25 +0100)
committerFrédéric Perrin <fred@fperrin.net>
Tue, 2 Apr 2024 19:25:00 +0000 (20:25 +0100)
atom-tests.el
atom.el

index 941580a32d598f9e5b5bdc535f2a75155d5b9f1d..c822f25dd10ce38b4d96938f2aba854177900856 100644 (file)
      "http://example.org/text"
      "Some text"
      (list :updated (atom-parse-time "2024-03-23T01:02:04+0400")
-          :summary "summary"))
+          :published (atom-parse-time "2024-03-23T01:02:04+0400")
+          :summary "Summary"))
     (atom-add-html-entry
      my-atom-feed
      "A HTLM entry"
diff --git a/atom.el b/atom.el
index caca05c433b1c67121181794cf6c6ccc34c8c87a..34111c1d6ebf75f7e93cd3a908dc1d92add1e9ca 100644 (file)
--- a/atom.el
+++ b/atom.el
@@ -124,8 +124,7 @@ PROPS is an optional plist with the following properties:
 
 - :summary, if is not given, the entry will not contain any summary.
 
-- :updated defaults to `(current-time)' if omitted, which is
-probably not a very good default.
+- :updated defaults to `(current-time)'.
 
 - :published, if given, is the earliest availability of the
   entry. It is optional, and shouldn't change even if the entry
@@ -138,6 +137,8 @@ probably not a very good default.
     (atom-modify-entry entry 'link  (list (list (cons 'href link))))
     (atom-modify-entry entry 'id (or (plist-get props :id) link))
     (atom-modify-entry entry 'updated (atom-format-time (plist-get props :updated)))
+    (if (plist-member props :published)
+       (atom-modify-entry entry 'published (atom-format-time (plist-get props :published))))
     (if (plist-member props :summary)
        (atom-modify-entry entry 'summary (plist-get props :summary)))
     (atom-modify-entry entry 'content content)