xcodebuild / blog-admin

Write blog in emacs with hexo/org-page/nikola
GNU General Public License v2.0
229 stars 24 forks source link
blog emacs

[[https://travis-ci.org/CodeFalling/blog-admin][https://travis-ci.org/CodeFalling/blog-admin.svg]] [[https://github.com/syl20bnr/spacemacs][https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg]]

If you use a standalone ~.spacemacs~ file, just add ~blog-admin~ in your ~dotspacemacs-additional-packages~, then add below code into ~dotspacemacs/user-config()~

If installing from github(not melpa)

+BEGIN_SRC emacs-lisp

(blog-admin :location (recipe :fetcher github :repo "codefalling/blog-admin"))

+END_SRC

in your layer's packages, then

+BEGIN_SRC emacs-lisp

(use-package blog-admin :init (progn ;; your config (setq blog-admin-backend-type 'hexo) (setq blog-admin-backend-path "~/codefalling.com") (setq blog-admin-backend-new-post-in-drafts t) (setq blog-admin-backend-new-post-with-same-name-dir t) ))

+END_SRC

** Open post after create new post

+BEGIN_SRC emacs-lisp

(add-hook 'blog-admin-backend-after-new-post-hook 'find-file)

+END_SRC

[[https://github.com/kelvinh/org-page][org-page]] is pure emacs static blog generator.

** configure

+BEGIN_SRC emacs-lisp

(setq blog-admin-backend-type 'org-page) (setq blog-admin-backend-path "~/code/blog") (setq blog-admin-backend-new-post-in-drafts t) (setq blog-admin-backend-new-post-with-same-name-dir t) (setq blog-admin-backend-org-page-drafts "_drafts") ;; directory to save draft (setq blog-admin-backend-org-page-config-file "/path/to/org-page/config.el") ;; if nil init.el is used

+END_SRC

To be able to use blog-admin on your Nikola site, you will need to install the [[https://plugins.getnikola.com/#tags][tags plugin]] and Nikola >= 7.7.9.

** configure

+BEGIN_SRC emacs-lisp

(setq blog-admin-backend-type 'nikola) (setq blog-admin-backend-path "~/code/blog") (setq blog-admin-backend-new-post-in-drafts t) (setq blog-admin-backend-nikola-executable "~/.venvs/nikola/bin/nikola") ;; path to nikola executable (setq blog-admin-backend-nikola-config-file "my_conf.py") ;; conf.py is default

+END_SRC