Browse Source

Merge pull request #38 from woudshoo/sitemap-timestamp

Changed timestamp format of the sitemap so google does not complain (and...
Brit Butler 12 years ago
parent
commit
210c0aff76
1 changed files with 5 additions and 1 deletions
  1. 5 1
      plugins/sitemap.lisp

+ 5 - 1
plugins/sitemap.lisp

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