From: Christian Shtarkov Date: Thu, 24 Oct 2024 18:58:08 +0000 (+0100) Subject: Remove redundant ./ in links X-Git-Url: https://shtarkov.net/gitweb/?a=commitdiff_plain;h=94f1b86e14fe4ca0f077e90a46bbd6f9611c1e03;p=shtarkov.net.git Remove redundant ./ in links --- diff --git a/onerc.el b/onerc.el index 4da3984..cf1dd00 100644 --- 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 diff --git a/shtarkov.net.org b/shtarkov.net.org index 134a637..e01fb7e 100644 --- a/shtarkov.net.org +++ b/shtarkov.net.org @@ -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: