[Top][All Lists]

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

Re: [O] [Feature Request] Let publishing-function decide :output-file an

From: Nicolas Goaziou
Subject: Re: [O] [Feature Request] Let publishing-function decide :output-file and whether publishing is needed
Date: Sun, 02 Aug 2015 18:24:09 +0200


Ruben Maher <address@hidden> writes:

> I've been working on a derived exporter to publish a static blog, and
> I've run into some issues.  Say that `:publishing-directory' is
> "~/public_html" and I have `:base-directory' with an Org file foo.org.
> foo.org has option keywords like this:
> #+title: foo.org
> #+date: <2015-07-25 Sat 17:21:41>
> My derived exporter visits each Org file to get information from the
> keywords, and would export foo.org like so: foo.org ->
> ~/public_html/2015/07/25/foo/index.html, using something like
> #+begin_src elisp
> (let ((pub-dir
>        (file-name-as-directory
>         (concat (expand-file-name pub-dir)
>                 (format-time-string "%Y/%m/%d/" date)
>                 (file-name-base filename)))))
>   (org-publish-org-to
>    'rkm-html filename
>    (concat "." (or (plist-get plist :html-extension)
>                    org-html-extension "html"))
>    (org-combine-plists plist '(:output-file "index")) pub-dir))
> #+end_src

Can't you simply use org-publish-after-publishing-hook to copy the
published file elsewhere?

Or, if you write your own exporter, do it à la "ox-latex.el", i.e.,
publish in :base-directory and move it elsewhere with

> I have achieved this using the attached diff, which tells
> `org-export-output-file-name' to respect the property `:output-file' in
> the communications channel.

This doesn't sound right: if you know the file name beforehand, you
don't need to call `org-export-output-file-name' in the first place.


Nicolas Goaziou

reply via email to

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