Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[orgmode] Can't use path handlers #342

Open
dmusican opened this issue Jun 8, 2020 · 4 comments
Open

[orgmode] Can't use path handlers #342

dmusican opened this issue Jun 8, 2020 · 4 comments

Comments

@dmusican
Copy link

dmusican commented Jun 8, 2020

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?

@ralsina
Copy link
Member

ralsina commented Jun 8, 2020

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

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

@dalanicolai
Copy link

dalanicolai commented Jul 1, 2020

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?

@dmusican
Copy link
Author

dmusican commented Jul 6, 2020

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>@@

@ghschaden
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants