From: Peng Li Date: Thu, 11 May 2017 11:52:03 +0000 (+0800) Subject: Add the correct date format when creating post X-Git-Url: http://47.100.26.94:8080/?a=commitdiff_plain;h=b33c6ab57943b861817299ce21a416ed3504eaa6;hp=8cd3d8902baade6c093b52913b68fd9149861c43;p=blog.git Add the correct date format when creating post --- diff --git a/blog-tool.el b/blog-tool.el index cb04b8e..6d5401d 100644 --- a/blog-tool.el +++ b/blog-tool.el @@ -33,11 +33,9 @@ "Create a post." (interactive) (let ((title (read-from-minibuffer "Title: ")) - (date (format-time-string "%Y-%m-%d")) (filename "")) (setq filename (concat blog-root-dir "/posts/" - date "-" (replace-regexp-in-string " " "-" title) ".org")) (find-file filename) @@ -45,8 +43,9 @@ "#+TITLE: " title "\n" "#+AUTHOR: " my-name "\n" "#+EMAIL: " my-email "\n" - "#+DATE: " date " " (format-time-string "%A") "\n" - "\n")) + "#+DATE: ")) + (org-insert-time-stamp (current-time) nil nil nil "\n") + (insert "\n") (save-buffer))) diff --git a/my-publish.el b/my-publish.el index f9e0da0..b21533d 100644 --- a/my-publish.el +++ b/my-publish.el @@ -43,7 +43,7 @@ "" "" "
")) @@ -112,7 +112,9 @@ ;; sitemap :auto-sitemap t :sitemap-filename "sitemap.org" - :sitemap-title "Sitemap" + :sitemap-title "Blog" + :sitemap-sort-files anti-chronologically + :sitemap-file-entry-format "%d %t" ;; other generic options :with-toc nil ; table of contents