emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Manuel Giraud <manuel.giraud@univ-nantes.fr>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: [PATCH] Sitemap sans extension
Date: Fri, 29 Apr 2011 15:07:14 +0200	[thread overview]
Message-ID: <8762pxxl31.fsf@univ-nantes.fr> (raw)

[-- Attachment #1: Type: text/plain, Size: 192 bytes --]


Hi,

The following patch adds an option to remove extensions of files linked
from the auto generated sitemap. This is useful if you want to follow
this: http://www.w3.org/Provider/Style/URI


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0003-org-publish.el-org-publish-org-sitemap-add-a-sitemap.patch --]
[-- Type: text/x-patch, Size: 1912 bytes --]

From 32ca3e459e759fbf6312c0154b1f1ba5b2cb7b13 Mon Sep 17 00:00:00 2001
From: Manuel Giraud <manuel.giraud@univ-nantes.fr>
Date: Fri, 29 Apr 2011 14:57:48 +0200
Subject: [PATCH 3/3] org-publish.el (org-publish-org-sitemap): add a sitemap option to
 remove extension from filename's link

---
 lisp/org-publish.el |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/lisp/org-publish.el b/lisp/org-publish.el
index 7470ee2..56cc80a 100644
--- a/lisp/org-publish.el
+++ b/lisp/org-publish.el
@@ -178,6 +178,11 @@ sitemap of files or summary page for a given project.
                          `tree' (the directory structure of the source
                          files is reflected in the sitemap).  Defaults to
                          `tree'.
+  :sitemap-sans-extension Remove extension from sitemap's
+                           filenames.  Useful to have cool
+                           URIs (see
+                           http://www.w3.org/Provider/Style/URI).
+                           Defaults to nil.
 
   If you create a sitemap file, adjust the sorting like this:
 
@@ -758,6 +763,7 @@ Default for SITEMAP-FILENAME is 'sitemap.org'."
 			  (concat "Sitemap for project " (car project))))
 	 (sitemap-style (or (plist-get project-plist :sitemap-style)
 			  'tree))
+	 (sitemap-sans-extension (plist-get project-plist :sitemap-sans-extension))
 	 (visiting (find-buffer-visiting sitemap-filename))
 	 (ifn (file-name-nondirectory sitemap-filename))
 	 file sitemap-buffer)
@@ -769,6 +775,8 @@ Default for SITEMAP-FILENAME is 'sitemap.org'."
 	(let ((fn (file-name-nondirectory file))
 	      (link (file-relative-name file dir))
 	      (oldlocal localdir))
+	  (when sitemap-sans-extension
+	    (setq link (file-name-sans-extension link)))
 	  ;; sitemap shouldn't list itself
 	  (unless (equal (file-truename sitemap-filename)
 			 (file-truename file))
-- 
1.7.3.5


[-- Attachment #3: Type: text/plain, Size: 19 bytes --]


-- 
Manuel Giraud

             reply	other threads:[~2011-04-29 13:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-29 13:07 Manuel Giraud [this message]
2011-05-02  7:26 ` [Accepted] Sitemap sans extension Carsten Dominik
2011-05-02  7:27 ` [PATCH] " Carsten Dominik
2011-05-10 15:09   ` Manuel Giraud
2011-05-11  8:19     ` [Accepted] " Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8762pxxl31.fsf@univ-nantes.fr \
    --to=manuel.giraud@univ-nantes.fr \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).