From af8f9d644368251af1f4df8f280b82a8e91bbb64 Mon Sep 17 00:00:00 2001 From: Christopher James Hayward Date: Thu, 14 Jan 2021 11:08:49 -0500 Subject: [PATCH] Add capture templates for blogs / presentations --- README.org | 31 +++++++++++++++++++++++++++++++ init.el | 16 ++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/README.org b/README.org index 317d186..b61704c 100644 --- a/README.org +++ b/README.org @@ -584,6 +584,26 @@ Configure the default capture template for daily entries. :head "#+TITLE: %<%Y-%m-%d>\n"))) #+end_src +** Blogging + +https://github.com/kaushalmodi/ox-hugo ++ Configure for =one-post-per-file= + +#+begin_src emacs-lisp +(use-package ox-hugo + :after ox) +#+end_src + +Creaate a capture template for blog posts in the =posts= sub directory. + +#+begin_src emacs-lisp +(add-to-list 'org-roam-capture-templates + '("b" "blog" plain (function org-roam-capture--get-point) + "%?" + :file-name "posts/${slug}" + :head "#+TITLE: ${title}\n#+HUGO_BASE_DIR: ../\n#+HUGO_SECTION: ./\n")) +#+end_src + ** Presentations Produce high quality presentations that work anywhere with =HTML/JS= via the =reveal.js= package. @@ -593,5 +613,16 @@ https://github.com/hexmode/ox-reveal #+begin_src emacs-lisp (use-package ox-reveal + :after ox :custom (org-reveal-root "https://cdn.jsdelivr.net/reveal.js/3.9.2/")) #+end_src + +Create a capture template for presentations stored in the =slides= sub directory. + +#+begin_src emacs-lisp +(add-to-list 'org-roam-capture-templates + '("s" "slides" plain (function org-roam-capture--get-point) + "%?" + :file-name "slides/${slug}" + :head "#+TITLE: ${title}\n")) +#+end_src diff --git a/init.el b/init.el index 34f4745..f22307e 100644 --- a/init.el +++ b/init.el @@ -239,5 +239,21 @@ :file-name "daily/%<%Y-%m-%d>" :head "#+TITLE: %<%Y-%m-%d>\n"))) +(use-package ox-hugo + :after ox) + +(add-to-list 'org-roam-capture-templates + '("b" "blog" plain (function org-roam-capture--get-point) + "%?" + :file-name "posts/${slug}" + :head "#+TITLE: ${title}\n#+HUGO_BASE_DIR: ../\n#+HUGO_SECTION: ./\n")) + (use-package ox-reveal + :after ox :custom (org-reveal-root "https://cdn.jsdelivr.net/reveal.js/3.9.2/")) + +(add-to-list 'org-roam-capture-templates + '("s" "slides" plain (function org-roam-capture--get-point) + "%?" + :file-name "slides/${slug}" + :head "#+TITLE: ${title}\n"))