Hello,

Please is there a way to remove all the :base-extension of the sourge
file name in the exported file name?

For example when publishing a project to HTML I would like to get this
output file name:

  index.en.org -> index.html

instead of

  index.en.org -> index.en.html

Honestly I consider a bug that org-html-publish-to-html (probably
org-publish-org-to) is not replacing the whole ":base-extension"
(e.g. "en.org" in the above example) with ".html" from the resulting
file name, WDYT?

Some context: I'm maintaining some static web sites with ox-publish [1],
supporting multiple languages (for now just IT and EN).

Language support is obtained in a very simple way: source files are
divided in one subtree per language [2], e.g.:

  - source/swws/it
    - some-page/
    - some-other-page/
  - source/swws/en
    - some-page/
    - some-other-page/

....but this kind of "tree duplication" is ugly from an author POV and
I'd like to avoid that duplication.

I would like instead a single subtree (e.g. "source/swws/content") and
then one file per language (for each subdir), like "index.en.org" for EN
and "index.it.org" for IT

This is an excerpt of the code I'm using now:

--8<---------------cut here---------------start------------->8---

("swws - English root pages"
 :language en
 :base-extension "en.org"
 :base-directory "./source/swws/content"
 :publishing-directory "./public/swws/en"
 :publishing-function org-html-publish-to-html
 
[...]

("swws - Italian root pages"
 :language it
 :base-extension "it.org"
 :base-directory "./source/swws/content"
 :publishing-directory "./public/swws/it"
 :publishing-function org-html-publish-to-html

--8<---------------cut here---------------end--------------->8---

When I publish my projects I get this:

  ./source/swws/content/index.it.org -> ./public/swws/it/index.it.html
  ./source/swws/content/index.en.org -> ./public/swws/en/index.en.html

while I'd like to have:

  ./source/swws/content/index.it.org -> ./public/swws/it/index.html
  ./source/swws/content/index.en.org -> ./public/swws/en/index.html

Please do you have some suggestion on how to get this output file
naming?

Happy hacking!


P.S.: I know I can "work-around" this issue by using custom index files
(e.g. index.html index.en.html index.it.html) in the web server
configuration, but I find this not an ideal solution.


[1] if you are interested:
https://gitlab.com/softwareworkers/swws/-/blob/4e8e795/documentation/configuration.it.org?plain=1

[2] for an example tree see
https://gitlab.com/softwareworkers/swws/-/tree/4e8e795/documentation/source/swws

-- 
Giovanni Biscuolo

SoftwareWorkers S.r.l.

Attachment: signature.asc
Description: PGP signature

Reply via email to