-
Notifications
You must be signed in to change notification settings - Fork 73
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
Relative links for images in RSS output #57
Comments
My horrible solution so far had been to add "fix" the rss file using this ugly workaround, (defun fixrss ()
"Fix broken <img src=\"..\"> links in rss.
org-static-blog naturally produces the RSS feed joining together
the html code from the blog webpages. This causes image links to
be realtive instead of aboslute, which makes the blog impossible
to read via RSS readers.
This is a hackish workaround..."
(interactive)
(goto-char (point-min))
(let ((imgsrc-pattern "src=\\\"\\([^\"]*\\)\\\"")
(replace-pattern (concat "src=\"" org-static-blog-publish-url "\\1" "\""))
(oldstr))
(while (search-forward-regexp imgsrc-pattern nil t)
(setq oldstr (match-string 1))
(cond
((string-match "^http" oldstr) (message (concat "Nothig to do for " oldstr)))
((string-match "^/" oldstr) (message (concat "Nothig to do for " oldstr)))
(t (message (concat "Convert " oldstr))
(replace-match replace-pattern))))
(save-buffer))) |
I believe links are simply copied verbatim. The simplest solution is to use absolute links instead of relative links, i.e. A much better solution would modify Would you like to try your hand at a pull request to this effect? |
I honestly would not like to but absolute links in the HTML output, because it would be a pain to work on draft/posts offline. I believe that the "right solution" is to use two different exporter for HTML and RSS. Indeed Ogbe.net uses the `org-publish' mechanism and does that. In this way he has a completely relocatable HTML output (all links are relative) and a well formatted RSS (all links are absolute). I don't think I want to change the current status of |
OK, no problem. |
Hi,
I have an issue generating a proper RSS.
I am using org-mode version 9.2.6 and org-static-blog 1.3.0 and my configuration includes
If the blog post contains an image which for example is originally included as
[[file:assets/image.jpg]]
in the org file, I obtainin both the HTML and the RSS output. But in the latter case this seems to be an issue, because I cannot see the images of the post in any RSS reader. Furthermore similar issues apply to the footnote links.
Reading the pages from the browser is fine since relative links are fine there. I am afraid that producing the RSS export just by cutting and pasting the HTML export is not the correct way.
Best,
The text was updated successfully, but these errors were encountered: