Add the correct date format when creating post
authorPeng Li <seudut@gmail.com>
Thu, 11 May 2017 11:52:03 +0000 (19:52 +0800)
committerPeng Li <seudut@gmail.com>
Thu, 11 May 2017 11:52:03 +0000 (19:52 +0800)
blog-tool.el
my-publish.el

index cb04b8e..6d5401d 100644 (file)
   "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)))
 
 
index f9e0da0..b21533d 100644 (file)
@@ -43,7 +43,7 @@
        "<nav><ul>"
        "<li><a href= '/about.html' >About</a></li>"
        "<li><a href= '/posts/sitemap.html' >Blog</a></li>"
-       "<li><a href= '/index.html' >Home</a></li>"
+       ;; "<li><a href= '/index.html' >Home</a></li>"
        "</ul></nav>"
        "</header>"
        "<hr>"))
           ;; 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