]> shtarkov.net Git - shtarkov.net.git/commitdiff
Remove redundant ./ in links
authorChristian Shtarkov <ops+git@shtarkov.net>
Thu, 24 Oct 2024 18:58:08 +0000 (19:58 +0100)
committerChristian Shtarkov <ops+git@shtarkov.net>
Thu, 24 Oct 2024 18:58:08 +0000 (19:58 +0100)
onerc.el
shtarkov.net.org

index 4da3984d1d227dcea93a989226ebc39befa4313a..cf1dd00252cc621f69f59f1e215ebd8f7c804ba3 100644 (file)
--- a/onerc.el
+++ b/onerc.el
@@ -4,11 +4,12 @@
   '((link . shtarkov.net-link)))
 
 (defun shtarkov.net-head (title)
-  `(:head
-    (:meta (@ :charset "UTF-8"))
-    (:meta (@ :name "viewport" :content "width=device-width,initial-scale=1"))
-    (:link (@ :rel "stylesheet" :type "text/css" :href "/main.css"))
-    (:title ,title)))
+  (let ((x 1))
+    `(:head
+      (:meta (@ :charset "UTF-8"))
+      (:meta (@ :name "viewport" :content "width=device-width,initial-scale=1"))
+      (:link (@ :rel "stylesheet" :type "text/css" :href "/main.css"))
+      (:title ,title))))
 
 (setq shtarkov.net-footer
       '(:div/footer
@@ -131,9 +132,9 @@ INFO is a plist holding contextual information."
                              ,(format "goto-char: %s" beg)))))
                 ((string= type "file")
                  (or
-                  ;; ./assets/images/image-1.png --> /images/image-1.png
-                  ;; ./public/blog/page-1.md     --> /blog/page-1.md
-                  (and (string-match "\\`\\./\\(assets\\|public\\)" path)
+                  ;; [./]assets/images/image-1.png --> /images/image-1.png
+                  ;; [./]public/blog/page-1.md     --> /blog/page-1.md
+                  (and (string-match "\\`\\(\\./\\)?\\(assets\\|public\\)" path)
                        (replace-match "" nil nil path))
                   (let ((beg (org-element-property :begin link)))
                     (signal 'one-link-broken
index 134a6373a3474b8194a564b10dedf04b2dbabd2e..e01fb7e1c7bd9d2d87591eb6a6ab085bf4bbf6f7 100644 (file)
@@ -4,7 +4,7 @@
 :custom_id: /
 :end:
 
-[[file:./assets/cat.png][Cat]]
+[[file:assets/cat.png][Cat]]
 
 * Emacs
 :properties:
@@ -32,11 +32,11 @@ sense, the cat is avant-garde, it is more interested in the medium
 Julio Cabrera
 #+end_quote
 
-[[file:./assets/cat/cat1.jpg]]
-[[file:./assets/cat/cat2.jpg]]
-[[file:./assets/cat/cat3.jpg]]
-[[file:./assets/cat/cat4.jpg]]
-[[file:./assets/cat/cat5.jpg]]
+[[file:assets/cat/cat1.jpg]]
+[[file:assets/cat/cat2.jpg]]
+[[file:assets/cat/cat3.jpg]]
+[[file:assets/cat/cat4.jpg]]
+[[file:assets/cat/cat5.jpg]]
 
 * Transpose regions
 :properties: