Skip to content

Commit

Permalink
Update the date field on C-c C-c
Browse files Browse the repository at this point in the history
Some times we create post and keep it in draft and want to publish it
later. But previous pull request I introduced date: header to order
the posts which are published on same day. Due to this if I publish
draft at some time later like says a week later it will be pushed down
in RSS feeds mainly sent for planet software. This is undesirable and
also this date field is meant to be the time stamp when post is
published so this commit will update the time stamp on hitting C-c C-c
in hyde-md.el
  • Loading branch information
copyninja committed Mar 23, 2013
1 parent ba242be commit 7dff237
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion hyde-md.el
Expand Up @@ -19,8 +19,13 @@
;; 02111-1307, USA.

(defun hyde-markdown-end-edit ()
"Function called signifying the end of the editing session"
"Function called signifying the end of the editing session this
function updates the date field in YAML header"
(interactive)
(beginning-of-buffer)
(move-to-window-line 3)
(delete-region (line-beginning-position) (line-end-position))
(insert (format "date: \"%s\"" (format-time-string "%Y-%m-%d %H:%M:%S %z")))
(save-buffer (current-buffer))
(bury-buffer)
(hyde/load-posts)
Expand Down

0 comments on commit 7dff237

Please sign in to comment.