Просмотр исходного кода

Changed timestamp format of the sitemap so google does not complain (and it conforms to the specs.)

Willem Rein Oudshoorn лет назад: 12
Родитель
Сommit
f753debbba
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      plugins/sitemap.lisp

+ 5 - 1
plugins/sitemap.lisp

@@ -10,18 +10,22 @@
10 10
                 #:staging-dir
11 11
                 #:theme-fn
12 12
                 #:write-page)
13
+  (:import-from :local-time
14
+		#:format-timestring
15
+		#:now)
13 16
   (:export #:enable))
14 17
 
15 18
 (in-package :coleslaw-sitemap)
16 19
 
17 20
 (defmethod deploy :before (staging)
18 21
   "Render sitemap.xml under document root"
22
+  (declare (ignore staging))
19 23
   (let ((urls (append '("" "sitemap.xml") ; empty string is for root url
20 24
                       (mapcar #'page-url (find-all 'coleslaw:post)))))
21 25
     (write-page (rel-path (staging-dir *config*) "sitemap.xml")
22 26
                 (funcall (theme-fn 'sitemap "feeds")
23 27
                          (list :config *config*
24 28
                                :urls urls
25
-                               :pubdate (make-pubdate))))))
29
+                               :pubdate (format-timestring nil (now)))))))
26 30
 
27 31
 (defun enable ())