summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2013-07-23 16:51:45 (GMT)
committer Bastien Guerry <bzg@altern.org>2013-07-23 16:51:45 (GMT)
commit89f2450fe567cf8c1a75f0a48a98b18976025f90 (patch)
treed7b49c490cad2443df779e57d3ccb4e2afa9a094
parentc85aabdcf1b133f33dc16a6cba29be2a2fa41902 (diff)
downloadorg-mode-89f2450fe567cf8c1a75f0a48a98b18976025f90.zip
org-mode-89f2450fe567cf8c1a75f0a48a98b18976025f90.tar.gz
contrib/lisp/ox-rss.el: Explain :RSS_PERMALINK:
* ox-rss.el: Explain :RSS_PERMALINK:. (org-rss-headline): Make use of :RSS_PERMALINK: to specify the permalink for a headline.
-rw-r--r--contrib/lisp/ox-rss.el21
1 files changed, 14 insertions, 7 deletions
diff --git a/contrib/lisp/ox-rss.el b/contrib/lisp/ox-rss.el
index 9f9dc8b..1cf74f6 100644
--- a/contrib/lisp/ox-rss.el
+++ b/contrib/lisp/ox-rss.el
@@ -60,6 +60,10 @@
;; :table-of-contents nil))
;;
;; ... then rsync /home/guerry/public_html/ with your server.
+;;
+;; By default, the permalink for a blog entry points to the headline.
+;; You can specify a different one by using the :RSS_PERMALINK:
+;; property within an entry.
;;; Code:
@@ -229,6 +233,8 @@ communication channel."
(> (org-export-get-relative-level headline info) 1))
(let* ((htmlext (plist-get info :html-extension))
(hl-number (org-export-get-headline-number headline info))
+ (hl-home (file-name-as-directory (plist-get info :html-link-home)))
+ (hl-pdir (plist-get info :publishing-directory))
(anchor
(org-export-solidify-link-text
(or (org-element-property :CUSTOM_ID headline)
@@ -244,13 +250,14 @@ communication channel."
(error "Missing PUBDATE property"))))))
(title (org-element-property :raw-value headline))
(publink
- (concat
- (file-name-as-directory
- (or (plist-get info :html-link-home)
- (plist-get info :publishing-directory)))
- (file-name-nondirectory
- (file-name-sans-extension
- (buffer-file-name))) "." htmlext "#" anchor))
+ (or (concat
+ (or hl-home hl-pdir)
+ (org-element-property :RSS_PERMALINK headline))
+ (concat
+ (or hl-home hl-pdir)
+ (file-name-nondirectory
+ (file-name-sans-extension
+ (buffer-file-name))) "." htmlext "#" anchor)))
(guid (if org-rss-use-entry-url-as-guid
publink
(org-rss-plain-text