From a0aa872b5ad8c8b3eb3a7c50d9755a81c9379796 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sat, 16 May 2020 00:49:16 +0200 Subject: [PATCH] Follow symlinks to set root This fixes a problem where the server wouldn't find any of the assets when installing org-roam-server via straight.el, as straight loads org-roam-server from: ~/.emacs.d/local/straight/build/org-roam-server/org-roam-server.el Which is a symlink to the real file, located here: ~/.emacs.d/local/straight/repos/org-roam-server/org-roam-server.el (Paths taken from my setup on Doom emacs) --- org-roam-server.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/org-roam-server.el b/org-roam-server.el index 04c749b..74e4e6c 100644 --- a/org-roam-server.el +++ b/org-roam-server.el @@ -56,7 +56,12 @@ "Save the current buffer in a variable to serve to the server." (setq org-roam-server-current-buffer (window-buffer))) -(defvar org-roam-server-root (concat (file-name-directory (or load-file-name buffer-file-name)) ".")) +(defvar org-roam-server-root + (concat (file-name-directory + (file-truename (or + load-file-name + buffer-file-name))) + ".")) (setq httpd-root org-roam-server-root) (defun org-roam-server-html-servlet (file)