From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [Feature Request] Let publishing-function decide :output-file and whether publishing is needed Date: Sun, 02 Aug 2015 18:24:09 +0200 Message-ID: <87614xacba.fsf@nicolasgoaziou.fr> References: <87oaj0d43r.fsf@ayanami.rkm.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48038) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLw21-00072x-SF for emacs-orgmode@gnu.org; Sun, 02 Aug 2015 12:22:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZLw20-0008EI-E8 for emacs-orgmode@gnu.org; Sun, 02 Aug 2015 12:22:37 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:59333) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLw20-0008E9-6L for emacs-orgmode@gnu.org; Sun, 02 Aug 2015 12:22:36 -0400 In-Reply-To: <87oaj0d43r.fsf@ayanami.rkm.id.au> (Ruben Maher's message of "Sat, 25 Jul 2015 18:08:16 +0930") 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: Ruben Maher Cc: emacs-orgmode@gnu.org Hello, Ruben Maher 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 =C3=A0 la "ox-latex.el", i.e., publish in :base-directory and move it elsewhere with `org-publish-attachment'? > > 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. Regards, --=20 Nicolas Goaziou