diff --git a/README.org b/README.org index 0ca7fb0..66ebb52 100644 --- a/README.org +++ b/README.org @@ -1,12 +1,13 @@ :PROPERTIES: :ID: e4ad3dd5-0996-45bc-92ab-6bdbf16e4310 +:ROAM_REF: https://chrishayward.xyz/dotfiles/ +:ROAM_ALIASES: "https://github.com/chayward1/dotfiles" :END: #+TITLE: Dotfiles #+AUTHOR: Christopher James Hayward #+EMAIL: chris@chrishayward.xyz #+EXPORT_FILE_NAME: dotfiles -#+ROAM_KEY: https://chrishayward.xyz/dotfiles/ #+HUGO_BASE_DIR: docs #+HUGO_AUTO_SET_LASTMOD: t @@ -2227,8 +2228,13 @@ Org Roam[fn:61] is a plain-text knowledge management system. It borrows principl (lambda () (org-roam-setup))) -;; Set the roam directory. -(setq org-roam-directory (expand-file-name "/etc/dotfiles")) +;; Set the roam directories. +(setq org-roam-directory (expand-file-name "/etc/dotfiles") + org-roam-dailies-directory (concat org-roam-directory "/docs/daily")) + +;; Clear the deafult capture templates. +(setq org-roam-capture-templates '() + org-roam-dailies-capture-templates '()) ;; Encrypt files with the public key. (setq epa-file-select-keys 2 @@ -2237,9 +2243,30 @@ Org Roam[fn:61] is a plain-text knowledge management system. It borrows principl ;; Override the default slug method. (cl-defmethod org-roam-node-slug ((node org-roam-node)) - (let ((title (org-roam-node-title node))) + (let ((title (org-roam-node-title node)) + (slug-trim-chars '(768 ; U+0300 COMBINING GRAVE ACCENT + 769 ; U+0301 COMBINING ACUTE ACCENT + 770 ; U+0302 COMBINING CIRCUMFLEX ACCENT + 771 ; U+0303 COMBINING TILDE + 772 ; U+0304 COMBINING MACRON + 774 ; U+0306 COMBINING BREVE + 775 ; U+0307 COMBINING DOT ABOVE + 776 ; U+0308 COMBINING DIAERESIS + 777 ; U+0309 COMBINING HOOK ABOVE + 778 ; U+030A COMBINING RING ABOVE + 780 ; U+030C COMBINING CARON + 795 ; U+031B COMBINING HORN + 803 ; U+0323 COMBINING DOT BELOW + 804 ; U+0324 COMBINING DIAERESIS BELOW + 805 ; U+0325 COMBINING RING BELOW + 807 ; U+0327 COMBINING CEDILLA + 813 ; U+032D COMBINING CIRCUMFLEX ACCENT BELOW + 814 ; U+032E COMBINING BREVE BELOW + 816 ; U+0330 COMBINING TILDE BELOW + 817 ; U+0331 COMBINING MACRON BELOW + ))) (cl-flet* ((nonspacing-mark-p (char) - (memq char org-roam-slug-trim-chars)) + (memq char slug-trim-chars)) (strip-nonspacing-marks (s) (ucs-normalize-NFC-string (apply #'string (seq-remove #'nonspacing-mark-p @@ -2255,48 +2282,43 @@ Org Roam[fn:61] is a plain-text knowledge management system. It borrows principl ;; Configure capture templates. ;; Standard document. -;; (add-to-list 'org-roam-capture-templates -;; '("d" "Default" entry (function org-roam-capture--get-point) -;; "%?" -;; :file-name "docs/${slug}" -;; :unnarrowed t -;; :head -;; " -;; ,#+TITLE: ${title} -;; ,#+AUTHOR: Christopher James Hayward -;; ,#+EMAIL: chris@chrishayward.xyz -;; ")) +(add-to-list 'org-roam-capture-templates + '("d" "Default" plain "%?" + :target (file+head "docs/${slug}.org.gpg" +" +,#+TITLE: ${title} +,#+SUBTITLE: +,#+AUTHOR: Christopher James Hayward +,#+EMAIL: chris@chrishayward.xyz +" +) + :unnarrowed t)) ;; Course document. -;; (add-to-list 'org-roam-capture-templates -;; '("c" "Course" plain (function org-roam-capture--get-point) -;; "%?" -;; :file-name "docs/courses/${slug}" -;; :unnarrowed t -;; :head -;; " -;; ,#+TITLE: ${title} -;; ,#+SUBTITLE: -;; ,#+AUTHOR: Christopher James Hayward -;; ,#+EMAIL: chris@chrishayward.xyz - -;; ,#+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil -;; ,#+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil -;; ")) +(add-to-list 'org-roam-capture-templates + '("c" "Course" plain "%?" + :target (file+head "docs/courses/${slug}.org.gpg" +" +,#+TITLE: ${title} +,#+SUBTITLE: +,#+AUTHOR: Christopher James Hayward +,#+EMAIL: chris@chrishayward.xyz + +,#+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil +,#+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil +" +) + :unnarrowed t)) ;; Daily notes. -;; (add-to-list 'org-roam-dailies-capture-templates -;; '("d" "Default" entry (function org-roam-capture--get-point) -;; "* %?" -;; :file-name "docs/daily/%<%Y-%m-%d>" -;; :head -;; " -;; ,#+TITLE: %<%Y-%m-%d> -;; ,#+AUTHOR: Christopher James Hayward - -;; ,#+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil -;; ,#+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil -;; ")) +(add-to-list 'org-roam-dailies-capture-templates + '("d" "Default" entry "* %?" + :target (file+head "%<%Y-%m-%d>.org.gpg" +" +;; #+TITLE: %<%Y-%m-%d> +;; #+AUTHOR: Christopher James Hayward +;; #+EMAIL: chris@chrishayward.xyz +"))) ;; Apply custom keybindings. (dotfiles/leader @@ -2473,49 +2495,28 @@ Ox-Hugo[fn:72] is an Org-Mode[fn:60] exporter for Hugo[fn:33] compabile markdown (require 'ox-hugo) ;; Capture templates. -;; Personal blog post. -;; (add-to-list 'org-roam-capture-templates -;; '("p" "Post" plain (function org-roam-capture--get-point) -;; "%?" -;; :file-name "docs/posts/${slug}" -;; :unnarrowed t -;; :head -;; " -;; #+TITLE: ${title} -;; #+AUTHOR: Christopher James Hayward -;; #+DATE: %<%Y-%m-%d> - -;; #+OPTIONS: num:nil todo:nil tasks:nil +;; Shared content. -;; #+EXPORT_FILE_NAME: ${slug} -;; #+ROAM_KEY: https://chrishayward.xyz/posts/${slug}/ - -;; #+HUGO_BASE_DIR: ../ -;; #+HUGO_AUTO_SET_LASTMOD: t -;; #+HUGO_SECTION: posts -;; #+HUGO_DRAFT: true -;; ")) +(add-to-list 'org-roam-capture-templates + '("d" "Post" plain "%?" + :target (file+head "docs/posts/${slug}.org.gpg" +" +#+TITLE: ${title} +#+AUTHOR: Christopher James Hayward +#+DATE: %<%Y-%m-%d> -;; Shared notes. -;; (add-to-list 'org-roam-capture-templates -;; '("n" "Notes" plain (function org-roam-capture--get-point) -;; "%?" -;; :file-name "docs/notes/${slug}" -;; :unnarrowed t -;; :head -;; " -;; ,#+TITLE: ${title} -;; ,#+AUTHOR: Christopher James Hayward +#+OPTIONS: num:nil todo:nil tasks:nil -;; ,#+OPTIONS: num:nil todo:nil tasks:nil -;; ,#+EXPORT_FILE_NAME: ${slug} -;; ,#+ROAM_KEY: https://chrishayward.xyz/notes/${slug}/ +#+EXPORT_FILE_NAME: ${slug} +#+ROAM_KEY: https://chrishayward.xyz/posts/${slug}/ -;; ,#+HUGO_BASE_DIR: ../ -;; ,#+HUGO_AUTO_SET_LASTMOD: t -;; ,#+HUGO_SECTION: notes -;; ,#+HUGO_DRAFT: true -;; ")) +#+HUGO_BASE_DIR: ../ +#+HUGO_AUTO_SET_LASTMOD: t +#+HUGO_SECTION: posts +#+HUGO_DRAFT: true +" +) + :unnarrowed t)) #+END_SRC ** Reveal @@ -2536,26 +2537,26 @@ Reveal.js[fn:75] is an open source HTML presentation framework. It enables anyon (setq org-reveal-root "https://cdn.jsdelivr.net/npm/reveal.js") ;; Create a capture template. -;; (add-to-list 'org-roam-capture-templates -;; '("s" "Slides" plain (function org-roam-capture--get-point) -;; "%?" -;; :file-name "docs/slides/${slug}" -;; :unnarrowed t -;; :head -;; " -;; ,#+TITLE: ${title} -;; ,#+AUTHOR: Christopher James Hayward -;; ,#+EMAIL: chris@chrishayward.xyz - -;; ,#+REVEAL_ROOT: https://cdn.jsdelivr.net/npm/reveal.js -;; ,#+REVEAL_THEME: serif - -;; ,#+EXPORT_FILE_NAME: ${slug} - -;; ,#+OPTIONS: reveal_title_slide:nil -;; ,#+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil -;; ,#+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil -;; ")) + +(add-to-list 'org-roam-capture-templates + '("s" "Slides" plain "%?" + :target (file+head "docs/slides/${slug}.org.gpg" +" +,#+TITLE: ${title} +,#+AUTHOR: Christopher James Hayward +,#+EMAIL: chris@chrishayward.xyz + +,#+REVEAL_ROOT: https://cdn.jsdelivr.net/npm/reveal.js +,#+REVEAL_THEME: serif + +,#+EXPORT_FILE_NAME: ${slug} + +,#+OPTIONS: reveal_title_slide:nil +,#+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil +,#+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil +" +) + :unnarrowed t)) #+END_SRC ** Passwords