From b33c6ab57943b861817299ce21a416ed3504eaa6 Mon Sep 17 00:00:00 2001 From: Peng Li Date: Thu, 11 May 2017 19:52:03 +0800 Subject: [PATCH 1/1] Add the correct date format when creating post --- blog-tool.el | 7 +++---- my-publish.el | 6 ++++-- 2 files changed, 7 insertions(+), 6 deletions(-) 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 -- 2.11.0