getnikola / plugins

Extra plugins for Nikola

Home Page:https://plugins.getnikola.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[orgmode] Can't use path handlers

dmusican opened this issue · comments

The plugin seems to otherwise be working great for me, including links to external websites, but I can't seem to get path handlers working. Any time I drop in an org link with syntax like

[[link://authors/][see the authors]]

(or any such special link)

I get the error message

Unable to resolve link: "link://authors/"

Do path handlers work with org mode?

If orgmode lets them through as-is they should work.

If orgmode tries to resolve them ... well, it won't.

I do not really understand how path-handlers should work. And I would like to understand how I am supposed to link to other pages using the org-mode plugin. However, I've added the following code snippet to nikola-site-dir/plugins/orgmode/init.el

;; Export link to section
(defun org-section-url-export (path desc format)
  (cond
   ((eq format 'html)
    (format "<a href=\"%s\">%s</a>" path desc))))
(org-add-link-type "section" nil 'org-section-url-export)

so that I can link to my blog section.

The syntax for the link in the org file is [[section:blog/][blog]], and this link resolves to my blog in the nikola-site-dir/output/blog/ directory.

Maybe you can use the above code or copy and tweak it to work for path-handlers.

Does this help for you?

I was able to make it work as embedded HTML using org-mode embedded HTML syntax, i.e.

@@html:<a href="link://authors">authors</a>@@

Indicating links used to work in the past (about two years ago, when I last updated my website...). Several links on my webpage which were of the form

[[./directory_name/filename][some description]]

were recognized, resolved correctly and pointed towards that file without any problem.

Now, such links are no longer recognized as links (and prefixing with /file/ or /link/ does not change anything for me).

[[file:./directory_name/filename][some description]]

If I prefix with /https/, the element is recognized as a link, but any dots are resolved to literal absolute pathnames.

[[https://directory_name/filename][some description]]

The solution by @dalanicolai works for me, but then, the source file is no longer normal and portable org-mode.