mirror of
https://codeberg.org/scip/dot-emacs.git
synced 2025-12-17 04:20:57 +01:00
added jekyll blog helpers
This commit is contained in:
1
init.el
1
init.el
@@ -147,6 +147,7 @@
|
|||||||
(require 'init-projectile)
|
(require 'init-projectile)
|
||||||
(require 'init-occur)
|
(require 'init-occur)
|
||||||
(require 'init-audio)
|
(require 'init-audio)
|
||||||
|
(require 'init-daemonde)
|
||||||
|
|
||||||
;; emacs configuration
|
;; emacs configuration
|
||||||
(require 'init-windowmgmt)
|
(require 'init-windowmgmt)
|
||||||
|
|||||||
49
lisp/init-daemonde.el
Normal file
49
lisp/init-daemonde.el
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
;; maintain daemon.de jekyll website
|
||||||
|
|
||||||
|
;; (require 'subr-x)
|
||||||
|
(setq daemon-de-site "~/dev/web/daemon.de")
|
||||||
|
|
||||||
|
(setq daemon-de-template "---
|
||||||
|
layout: post
|
||||||
|
title: %s
|
||||||
|
tags:
|
||||||
|
- %s
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
")
|
||||||
|
|
||||||
|
(defun daemon-de-title2slug(title)
|
||||||
|
(interactive)
|
||||||
|
(concat
|
||||||
|
(format-time-string "%Y-%m-%d-")
|
||||||
|
(replace-regexp-in-string "[[:nonascii:]]" "" (replace-regexp-in-string " " "-" (downcase title)))
|
||||||
|
".md"))
|
||||||
|
|
||||||
|
(defun daemon-de-new-blogpost(title category)
|
||||||
|
"Create a new blog posting for daemon.de"
|
||||||
|
(interactive "sEnter blog post title: \nsEnter a category: ")
|
||||||
|
(find-file
|
||||||
|
(format "%s/_posts/%s" daemon-de-site (daemon-de-title2slug title)))
|
||||||
|
(insert (format daemon-de-template title category))
|
||||||
|
)
|
||||||
|
|
||||||
|
(defun --daemon-de-new-blogpost(title category)
|
||||||
|
"Create a new blog posting for daemon.de"
|
||||||
|
(interactive "sEnter blog post title: \nsEnter a category: ")
|
||||||
|
(let ((cwd default-directory)
|
||||||
|
(path ""))
|
||||||
|
(cd daemon-de-site)
|
||||||
|
(find-file
|
||||||
|
(string-trim-right
|
||||||
|
(shell-command-to-string
|
||||||
|
(format "./newblog.sh '%s' '%s'" title category))))
|
||||||
|
(cd cwd)))
|
||||||
|
|
||||||
|
(defun daemon-de-publish()
|
||||||
|
"build and publish jekyll site using git"
|
||||||
|
(interactive)
|
||||||
|
(magit-status daemon-de-site))
|
||||||
|
|
||||||
|
(provide 'init-daemonde)
|
||||||
|
;;; init-daemonde.el ends here
|
||||||
Reference in New Issue
Block a user