emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Sebastian Rose <sebastian_rose@gmx.de>
To: "[emacs-orgmode]" <emacs-orgmode@gnu.org>
Subject: Patch: correction for tree-style sitemap (org-publish)
Date: Sun, 26 Oct 2008 02:13:22 +0200	[thread overview]
Message-ID: <4903B622.6030206@gmx.de> (raw)

Issue
=====

Sitemap not correct, when mutlitple subdirectories (my fault I
believe, sorry). Only the tree-style sitemap is affected.


How to reproduce
================

Try to export the following structure to HTML (directories
marked by `/'):

base-directory/
             |
             +-- B/
             |   |
             |   +---C/
             |   |   |
             |   |   +--- c.org
             |   |
             |   +---D/
             |       |
             |       +--- d.org
             |
             +-- E/

The resulting sitemap:


- B
   - C
     - c.org
- B              <= B again!
   -D
     - d.org
- E

Should be:

- B
   -C
     - c.org
   -D
     - d.org
- E



How to fix
==========


The following patch fixes it. The patch is against
commit 523cf1fe31dc5fc0e73a973b3e1a3bde74e0263d
Author: Carsten Dominik <carsten.dominik@gmail.com>
Date:   Sat Oct 25 12:56:42 2008 +0200

     Release 6.10c.



diff --git a/lisp/org-publish.el b/lisp/org-publish.el
index 2af71d3..3859442 100644
--- a/lisp/org-publish.el
+++ b/lisp/org-publish.el
@@ -645,8 +645,12 @@ Default for INDEX-FILENAME is 'index.org'."
                           (directory-file-name
                            (file-name-directory
                             (file-relative-name localdir dir))) "/"))
-                       (subdir ""))
+                       (subdir "")
+            (old-subdirs (split-string (file-relative-name oldlocal 
dir) "/")))
                     (setq indent-str (make-string 2 ?\ ))
+            (while (string= (car old-subdirs) (car subdirs))
+              (setq indent-str (concat indent-str (make-string 2 ?\ )))
+              (pop old-subdirs)(pop subdirs))
                     (dolist (d subdirs)
                       (setq subdir (concat subdir d "/"))
                       (insert (concat indent-str " + [[file:"

             reply	other threads:[~2008-10-26  0:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-26  0:13 Sebastian Rose [this message]
2008-10-26  6:05 ` Patch: correction for tree-style sitemap (org-publish) 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=4903B622.6030206@gmx.de \
    --to=sebastian_rose@gmx.de \
    --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).