Merge pull request #38 from woudshoo/sitemap-timestamp

Changed timestamp format of the sitemap so google does not complain (and...
This commit is contained in:
Brit Butler 2013-05-18 07:20:03 -07:00
commit 210c0aff76

View file

@ -10,18 +10,22 @@
#:staging-dir #:staging-dir
#:theme-fn #:theme-fn
#:write-page) #:write-page)
(:import-from :local-time
#:format-timestring
#:now)
(:export #:enable)) (:export #:enable))
(in-package :coleslaw-sitemap) (in-package :coleslaw-sitemap)
(defmethod deploy :before (staging) (defmethod deploy :before (staging)
"Render sitemap.xml under document root" "Render sitemap.xml under document root"
(declare (ignore staging))
(let ((urls (append '("" "sitemap.xml") ; empty string is for root url (let ((urls (append '("" "sitemap.xml") ; empty string is for root url
(mapcar #'page-url (find-all 'coleslaw:post))))) (mapcar #'page-url (find-all 'coleslaw:post)))))
(write-page (rel-path (staging-dir *config*) "sitemap.xml") (write-page (rel-path (staging-dir *config*) "sitemap.xml")
(funcall (theme-fn 'sitemap "feeds") (funcall (theme-fn 'sitemap "feeds")
(list :config *config* (list :config *config*
:urls urls :urls urls
:pubdate (make-pubdate)))))) :pubdate (format-timestring nil (now)))))))
(defun enable ()) (defun enable ())