Closed semente closed 3 years ago
To expand on this, I would like to collect org-mode files that exist in other folders and export them in my weblorg instance.
The above workaround doesn't suffice when trying to render files included from another :base-dir
Say I have a folder called ~/docs/141
and a subfolder, ~/docs/141/sections/
. If I set a weblorg-route
that points to ~/docs/141/
the files render correctly but any #+INCLUDE:
directives pointing to ~/docs/141/sections
fail.
I can't quite figure out how to do it myself, but at line 942 in weblorg--parse-org-file
if there was an org-to-org export, it would handle the includes, right? I'll try and figure it out next time I sit down with this.
Hi hi @mrmechko! that's right! you're definitely on the right path. I don't know if that's the cleanest, but I was thinking about solving this problem by saving the current directory in a local variable, cd'ing to the path where the Org file is located (dirname of input-path
which is the only parameter for weblorg--parse-org-file
) and then cd'ing back to the original path once the parsing is done! It'd be awesome if you wanted to take a stab at fixing this issue! <o/
Turns out you can change the file that a buffer points to! Once you got that, a simple org-to-org export into your temp buffer, and boom, the rest of weblorg handles everything.
This means I can set up routes for my various documents which are part of their own respective git repos and then generate a single webpage in my weblorg directory.
Thanks to @mrmechko's PR in #35, this issue should be fixed now! Please feel free top re-open it or to open a new one if you find anything weird in there 😄
Considering the route below:
And the files
posts/post.org
andposts/example.txt
:I get an error when publishing the website:
To make this work I have to use
#+INCLUDE: "posts/example.txt"
, which is not a big deal but I believe this is a bug. Perhaps the function that generates the HTML isn't switching to the directory of the file so it won't have the right context.