From 99d4c2ca15f98a3fa443ce7c73077e96a3eeea97 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Mon, 24 Oct 2016 09:54:19 +0200 Subject: [PATCH] Remove jekyll.el It was taken from the EmacsWiki, and is superseded by org-jekyll and hyde. --- init.el | 2 - lisp/jekyll.el | 112 ------------------------------------------------- 2 files changed, 114 deletions(-) delete mode 100644 lisp/jekyll.el diff --git a/init.el b/init.el index a8a909f..9f7cd63 100644 --- a/init.el +++ b/init.el @@ -51,7 +51,6 @@ '(indicate-empty-lines t) '(inhibit-startup-screen t) '(initial-scratch-message nil) - '(jekyll-directory "~/Projektek/jekyll/gergely.polonkai.eu") '(package-selected-packages (quote (ace-window @@ -677,7 +676,6 @@ (load "transpose-windows.el") (load "zim.el") (load "clearcase.el") -(load "jekyll.el") (load "enclose-string.el") (load "buf-manipulation.el") (load "package-manip") diff --git a/lisp/jekyll.el b/lisp/jekyll.el deleted file mode 100644 index 6b37fcb..0000000 --- a/lisp/jekyll.el +++ /dev/null @@ -1,112 +0,0 @@ -;; Configuration for Jekyll (http://jekyllrb.com/) - -(defun jekyll-timestamp () - "Update existing date: timestamp on a Jekyll page or post." - (interactive) - (save-excursion (goto-char 1) - (re-search-forward "^date:") - (let ((beg (point))) - (end-of-line) - (delete-region beg (point))) - (insert (concat " " (format-time-string "%Y-%m-%d %H:%M:%S %z")))) - ) -;; TODO: Make the function add a date variable if none exists. - -;; (defun jekyll-timestamp () -;; "Insert a time stamp suitable for use in a Jekyll page or post. Replaces current text selection." -;; (interactive) -;; (when (region-active-p) (delete-region (region-beginning) (region-end) ) ) -;; (insert (format-time-string "%Y-%m-%d %H:%M:%S %z"))) - -;; All of the below is taken from http://www.gorgnegre.com/linux/using-emacs-orgmode-to-blog-with-jekyll.html -;; (Later tweaked a bit.) - -(global-set-key (kbd "C-c j n") 'jekyll-draft-post) -(global-set-key (kbd "C-c j p") 'jekyll-publish-post) -(global-set-key (kbd "C-c j t") 'jekyll-timestamp) -(global-set-key (kbd "C-c j o") (lambda () (interactive) (find-file "~/web/"))) - -(defcustom jekyll-directory - "~/web/" - "Path to Jekyll blog. It must end " - :type '(directory) - :group 'jekyll) -(defcustom jekyll-drafts-dir - "_drafts/" - "Path to article drafts. Relative to jekyll-directory." - :type '(string) - :group 'jekyll) -(defcustom jekyll-posts-dir - "_posts/" - "Path to articles. Relative to jekyll-directory." - :type '(string) - :group 'jekyll) -(defcustom jekyll-post-ext - ".md" - "File extension of Jekyll posts." - :type '(string) - :group 'jekyll) -(defcustom jekyll-post-template - "---\nlayout: post\ntitle: %s\ntags:\ndate: %t\n---\n" - "Default template for Jekyll posts. %s will be replace by the post title, %t will be replaced with the current timestamp" - :type '(string) - :group 'jekyll) - -(defun jekyll-make-slug (s) "Turn a string into a slug." - (replace-regexp-in-string " " - "-" - (downcase - (replace-regexp-in-string "[^A-Za-z0-9 ]" - "" s)))) - -(defun jekyll-yaml-escape (s) "Escape a string for YAML." - (if - (or - (string-match ":" s) - (string-match "\"" s)) - (concat "\"" (replace-regexp-in-string "\"" "\\\\\"" s) "\"") s)) - -(defun jekyll-draft-post (title) "Create a new Jekyll blog post." - (interactive "sPost Title: ") - (let ((draft-file (concat - (file-name-as-directory jekyll-directory) - jekyll-drafts-dir - (jekyll-make-slug title) - jekyll-post-ext))) - (if (file-exists-p draft-file) - (find-file draft-file) - (find-file draft-file) - (insert (format jekyll-post-template (jekyll-yaml-escape title)))))) - -(defun jekyll-publish-post () - "Move a draft post to the posts directory, and rename it so that it contains the date." - (interactive) - (cond - ((not (equal - (file-name-directory (buffer-file-name (current-buffer))) - (expand-file-name (concat - (file-name-as-directory jekyll-directory) - jekyll-drafts-dir)))) - (message "This is not a draft post.") - (insert (file-name-directory (buffer-file-name (current-buffer))) "\n" - (concat - (file-name-as-directory jekyll-directory) - jekyll-drafts-dir))) - ((buffer-modified-p) - (message "Can't publish post; buffer has modifications.")) - (t - (let ((filename - (concat - (file-name-as-directory jekyll-directory) - jekyll-posts-dir - (format-time-string "%Y-%m-%d-") - (file-name-nondirectory - (buffer-file-name (current-buffer))))) - (old-point (point))) - (rename-file (buffer-file-name (current-buffer)) - filename) - (kill-buffer nil) - (find-file filename) - (set-window-point (selected-window) old-point))))) - -(provide 'setup-jekyll)