From mboxrd@z Thu Jan 1 00:00:00 1970 From: Manuel Giraud Subject: [PATCH] Sitemap sans extension Date: Fri, 29 Apr 2011 15:07:14 +0200 Message-ID: <8762pxxl31.fsf@univ-nantes.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:52214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFnPj-00051I-GF for emacs-orgmode@gnu.org; Fri, 29 Apr 2011 09:07:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QFnPi-0001Rb-6n for emacs-orgmode@gnu.org; Fri, 29 Apr 2011 09:07:19 -0400 Received: from smtp-tls1.univ-nantes.fr ([193.52.101.145]:53924 helo=smtp-tls.univ-nantes.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFnPi-0001R9-05 for emacs-orgmode@gnu.org; Fri, 29 Apr 2011 09:07:18 -0400 Received: from localhost (debian [127.0.0.1]) by smtp-tls.univ-nantes.fr (Postfix) with ESMTP id 19A9995408 for ; Fri, 29 Apr 2011 15:07:15 +0200 (CEST) Received: from smtp-tls.univ-nantes.fr ([127.0.0.1]) by localhost (smtp-tls1.d101.univ-nantes.fr [127.0.0.1]) (amavisd-new, port 10024) with LMTP id zsxetDGpNXp8 for ; Fri, 29 Apr 2011 15:07:15 +0200 (CEST) Received: from K (unknown [172.16.13.134]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by smtp-tls.univ-nantes.fr (Postfix) with ESMTPSA id 02BD195402 for ; Fri, 29 Apr 2011 15:07:15 +0200 (CEST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode --=-=-= 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 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0003-org-publish.el-org-publish-org-sitemap-add-a-sitemap.patch >From 32ca3e459e759fbf6312c0154b1f1ba5b2cb7b13 Mon Sep 17 00:00:00 2001 From: Manuel Giraud 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 --=-=-= -- Manuel Giraud --=-=-=--