mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-07-15 15:46:27 +00:00
ox-rss: Implement RSS_FEED_URL option keyword
* contrib/lisp/ox-rss.el (org-rss-build-channel-info): Try to use the specified RSS_FEED_URL option keyword as publink before resorting to concatenating blogurl with output filename. The RSS_FEED_URL goes into the atom:link element that identifies the feed's own URL. Currently, the feed URL is assumed to be html-link-home or publishing-directory concatenated with the output filename of the feed. This need not always be so. So, the RSS_FEED_URL option keyword is introduced to let the user customize the feed URL.
This commit is contained in:
parent
86bc987ca1
commit
e278cffa3b
|
@ -31,10 +31,11 @@
|
||||||
;; `org-rss-export-as-rss' (temporary buffer) and `org-rss-export-to-rss'
|
;; `org-rss-export-as-rss' (temporary buffer) and `org-rss-export-to-rss'
|
||||||
;; (as a ".xml" file).
|
;; (as a ".xml" file).
|
||||||
;;
|
;;
|
||||||
;; This backend understands two new option keywords:
|
;; This backend understands three new option keywords:
|
||||||
;;
|
;;
|
||||||
;; #+RSS_EXTENSION: xml
|
;; #+RSS_EXTENSION: xml
|
||||||
;; #+RSS_IMAGE_URL: http://myblog.org/mypicture.jpg
|
;; #+RSS_IMAGE_URL: http://myblog.org/mypicture.jpg
|
||||||
|
;; #+RSS_FEED_URL: http://myblog.org/feeds/blog.xml
|
||||||
;;
|
;;
|
||||||
;; It uses #+HTML_LINK_HOME: to set the base url of the feed.
|
;; It uses #+HTML_LINK_HOME: to set the base url of the feed.
|
||||||
;;
|
;;
|
||||||
|
@ -127,6 +128,7 @@ When nil, Org will create ids using `org-icalendar-create-uid'."
|
||||||
(:with-toc nil nil nil) ;; Never include HTML's toc
|
(:with-toc nil nil nil) ;; Never include HTML's toc
|
||||||
(:rss-extension "RSS_EXTENSION" nil org-rss-extension)
|
(:rss-extension "RSS_EXTENSION" nil org-rss-extension)
|
||||||
(:rss-image-url "RSS_IMAGE_URL" nil org-rss-image-url)
|
(:rss-image-url "RSS_IMAGE_URL" nil org-rss-image-url)
|
||||||
|
(:rss-feed-url "RSS_FEED_URL" nil nil t)
|
||||||
(:rss-categories nil nil org-rss-categories))
|
(:rss-categories nil nil org-rss-categories))
|
||||||
:filters-alist '((:filter-final-output . org-rss-final-function))
|
:filters-alist '((:filter-final-output . org-rss-final-function))
|
||||||
:translate-alist '((headline . org-rss-headline)
|
:translate-alist '((headline . org-rss-headline)
|
||||||
|
@ -331,10 +333,11 @@ as a communication channel."
|
||||||
(image (url-encode-url (plist-get info :rss-image-url)))
|
(image (url-encode-url (plist-get info :rss-image-url)))
|
||||||
(ifile (plist-get info :input-file))
|
(ifile (plist-get info :input-file))
|
||||||
(publink
|
(publink
|
||||||
|
(or (plist-get info :rss-feed-url)
|
||||||
(concat (file-name-as-directory blogurl)
|
(concat (file-name-as-directory blogurl)
|
||||||
(file-name-nondirectory
|
(file-name-nondirectory
|
||||||
(file-name-sans-extension ifile))
|
(file-name-sans-extension ifile))
|
||||||
"." rssext)))
|
"." rssext))))
|
||||||
(format
|
(format
|
||||||
"\n<title>%s</title>
|
"\n<title>%s</title>
|
||||||
<atom:link href=\"%s\" rel=\"self\" type=\"application/rss+xml\" />
|
<atom:link href=\"%s\" rel=\"self\" type=\"application/rss+xml\" />
|
||||||
|
|
Loading…
Reference in a new issue