emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Use headings in sitemap


From: Thibault Marin
Subject: [O] Use headings in sitemap
Date: Wed, 28 Sep 2016 23:09:11 -0500
User-agent: mu4e 0.9.16; emacs 24.5.1

Hi list,

I would like to generate a sitemap for a published website and use it to extract
the last few entries in a specific folder to put on the main page.

The site structure looks like:
.
├── index.org
├── posts
│   ├── A.org
│   ├── B.org
│   └── C.org
├── misc
│   ├── page.org
│   └── other-page.org
└── sitemap.org

In index.org, I would have:
#+begin_src org
#+INCLUDE: sitemap.org::*posts :lines "-10" :only-contents t
#+end_src
to include links to the 10 most recent pages in =posts= (I use
:sitemap-sort-files anti-chronologically in the project setup).  If I am not
missing anything, this requires the sitemap.org file to have a =posts= heading,
but the `org-publish-org-sitemap' function only produces a list of pages.

If there is no better way to get this to work, I would like to propose a patch
to `org-publish-org-sitemap' to produce headings in the sitemap file when a new
parameter is passed and non-nil.  The attached patch is my first attempt at it,
it works for my tests.

I would be interested to hear people's opinion on this:
- Is there a better way to achieve what I want?
- Is the proposed patch acceptable?  Any comments would be appreciated.

Thanks in advance.
thibault

Attachment: 0001-ox-publish.el-Option-to-use-headings-instead-of-list.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]