Browse Source

Don't refer to fully qualified paths in the default values used

Ryan Rix 9 months ago
parent
commit
03b33deffb
2 changed files with 20 additions and 19 deletions
  1. 5 4
      arcology-util.el
  2. 15 15
      arcology.el

+ 5 - 4
arcology-util.el

@@ -36,9 +36,10 @@
                    (arcology-alist-get 'links (request-response-data req))
                    "<br/>")))
       (with-temp-buffer
-        (insert (format "<html><head><title>*Arcology Webmentions*</title</head><body><ul>%s</ul></body></html>" output))
-        (write-file "~/tmp/arcology-mentions.html")
-        (eww "file:///home/rrix/tmp/arcology-mentions.html")))))
+        (let ((filename (expand-file-name "~/tmp/arcology-mentions.html")))
+          (insert (format "<html><head><title>*Arcology Webmentions*</title</head><body><ul>%s</ul></body></html>" output))
+          (write-file filename)
+          (eww (format "file://%s" filename)))))))
 
 
 (defun arcology-like-link (url)
@@ -70,7 +71,7 @@
     (kill-new url)
     (org-capture nil "A")))
 
-(add-to-list 'org-capture-templates '("_" "Published shortnote" entry (file "/home/rrix/Projects/notes/index.org")
+(add-to-list 'org-capture-templates `("_" "Published shortnote" entry (file ,(expand-file-name "~/Code/notes/index.org"))
                                       "* %? :EXPORT:\n%U\n%a\n" :prepend t))
 
 (provide 'arcology-util)

+ 15 - 15
arcology.el

@@ -76,47 +76,47 @@
 
 
 ;;;###autoload
-(defcustom arcology-default-template-file "/home/rrix/Projects/notes/templates/default.html"
+(defcustom arcology-default-template-file (expand-file-name "~/Code/notes/templates/default.html")
   "Template file to use for fallback"
   :group 'arcology)
 
 ;;;###autoload
-(defcustom arcology-note-template-file "/home/rrix/Projects/notes/templates/note.html"
+(defcustom arcology-note-template-file (expand-file-name "~/Code/notes/templates/note.html")
   "Template file to use for notes"
   :group 'arcology)
 
 ;;;###autoload
-(defcustom arcology-read-template-file "/home/rrix/Projects/notes/templates/default.html"
+(defcustom arcology-read-template-file (expand-file-name "~/Code/notes/templates/default.html")
   "Template file to use for read-items"
   :group 'arcology)
 
 ;;;###autoload
-(defcustom arcology-article-template-file "/home/rrix/Projects/notes/templates/default.html"
+(defcustom arcology-article-template-file (expand-file-name "~/Code/notes/templates/default.html")
   "Template file to use for full-length articles."
   :group 'arcology)
 
 ;;;###autoload
-(defcustom arcology-photo-template-file "/home/rrix/Projects/notes/templates/default.html"
+(defcustom arcology-photo-template-file (expand-file-name "~/Code/notes/templates/default.html")
   "Template file to use for notes."
   :group 'arcology)
 
 ;;;###autoload
-(defcustom arcology-jam-template-file "/home/rrix/Projects/notes/templates/default.html"
+(defcustom arcology-jam-template-file (expand-file-name "~/Code/notes/templates/default.html")
   "Template file to use for jam posts."
   :group 'arcology)
 
 ;;;###autoload
-(defcustom arcology-reply-template-file "/home/rrix/Projects/notes/templates/reply.html"
+(defcustom arcology-reply-template-file (expand-file-name "~/Code/notes/templates/reply.html")
   "Template file to use for replies."
   :group 'arcology)
 
 ;;;###autoload
-(defcustom arcology-index-template-file "/home/rrix/Projects/notes/templates/index.html"
+(defcustom arcology-index-template-file (expand-file-name "~/Code/notes/templates/index.html")
   "Template file to use for the site index."
   :group 'arcology)
 
 ;;;###autoload
-(defcustom arcology-review-template-file "/home/rrix/Projects/notes/templates/review.html"
+(defcustom arcology-review-template-file (expand-file-name "~/Code/notes/templates/review.html")
   "Template file to use for reviews."
   :group 'arcology)
 
@@ -146,15 +146,15 @@ cache. If PREVIEW is non-nil, skip publishing."
       (setq arcology-full-postlist nil)
       (arcology-index-entries config))
     (unless (file-exists-p arcology-site-root)
-      (mkdir arcology-site-root))
+      (mkdir arcology-site-root t))
     (arcology-generate-modified-entries config)
     (arcology-generate-indices config))
   (unless preview
-    (copy-file "~/Projects/notes/webmention.js" (concat arcology-site-root "/webmention.js") t)
-    (copy-file "~/Projects/notes/go.png" (concat arcology-site-root "/go.png") t)
-    (copy-file "~/Projects/notes/favicon.gif" (concat arcology-site-root "/favicon.gif") t)
-    (copy-directory "~/Projects/notes/css" (concat arcology-site-root "/"))
-    (copy-directory "~/Projects/notes/font" (concat arcology-site-root "/"))
+    (copy-file "~/Code/notes/webmention.js" (concat arcology-site-root "/webmention.js") t)
+    (copy-file "~/Code/notes/go.png" (concat arcology-site-root "/go.png") t)
+    (copy-file "~/Code/notes/favicon.gif" (concat arcology-site-root "/favicon.gif") t)
+    (copy-directory "~/Code/notes/css" (concat arcology-site-root "/"))
+    (copy-directory "~/Code/notes/font" (concat arcology-site-root "/"))
     (arcology-publish)))
 
 (defun arcology-publish ()