From 72701ff56a09e59d2317b0cf51a81d12b05b1b0c Mon Sep 17 00:00:00 2001 From: mez Date: Mon, 5 May 2025 19:19:08 +0100 Subject: [PATCH] Capture requisite metadata for website posts --- custom/capture.el | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/custom/capture.el b/custom/capture.el index 2bf1d39..96a8207 100644 --- a/custom/capture.el +++ b/custom/capture.el @@ -136,6 +136,15 @@ (setq workbookreturn " :work:")) workbookreturn) + (defun thecomments () + "Set whether a post should allow comments" + (setq commentsreturn "") + (setq querycomments (y-or-n-p "Allow comments?")) + (if querycomments + (setq commentsreturn "t") + (setq commentsreturn "nil")) + commentsreturn) + (defun thevisitdate () "Add dates for a visit" (setq visitreturn "") @@ -145,6 +154,16 @@ (setq visitreturn (concat " <" visitstart ">--<" visitend ">"))) visitreturn) + (defun realtitle () + "Set title for the list of posts" + (setq realtitlereturn (read-string "Real title: ")) + realtitlereturn) + + (defun realdesc () + "Set post description" + (setq realdescreturn (read-string "Description (full stop will be appended): ")) + realdescreturn) + (defun findperf () "Find or create heading for performances" (filedate) @@ -166,6 +185,12 @@ (setq thevenue (completing-read "Venue: " venues)) thevenue) + (defun setcategory () + "Set a category for a website post" + (setq categories (s-split "\n" (f-read "~/Documents/drive/admin/emacs/categories.txt") t)) + (setq thecategory (completing-read "Category: " categories)) + thecategory) + (defun setconsole () "Get the console a game is played on" (setq consoles (s-split "\n" (f-read "~/Documents/drive/admin/emacs/consoles.txt") t)) @@ -223,7 +248,7 @@ :jump-to-captured t) ("w" "Website post" entry (file+function "" findweb) - "* %^{Title} :post:\n%?" + "* %^{Title} :post:\n:PROPERTIES:\n:realtitle: %(realtitle)\n:ogdesc: %(realdesc).\n:category: %(setcategory)\n:comments: %(thecomments)\n:END:\n%?" :jump-to-captured t) ("1" "Completed game" entry (file+function "" findhundred)