Closed geekinthesticks closed 4 years ago
Currently the #+include:
file does not work. But writing a piece of code to include the raw content of file could be easily done.
A quick look shows up the org-export-expand-include-keyword
would help.
I leave the post open since I won't be available for a couple of weeks.
Can you please try to apply that patch:
diff --git a/o-blog.el b/o-blog.el
index 54eebcb..6791e61 100644
--- a/o-blog.el
+++ b/o-blog.el
@@ -664,6 +664,7 @@ headers and body."
(insert text)
(goto-char (point-min))
(org-mode)
+ (org-export-expand-include-keyword)
(while (<= 2 (save-match-data (funcall outline-level)))
(org-promote-subtree))
(run-hooks 'o-blog-html-plugins-hook)
Thanks that doesn't work. I have had a look at org-exp.el and it looks as though using org-export-handle-include-files should work, but it doesn't. My elisp skills are very basic, so I am not sure why it isn't working.
Ok I do not have any free time this week. I would be able to have a look at beginning of November to fix this.
Cheers.
Thank you, meanwhile I'll see if I can fix it myself.
A bit of progress - the following:
(defun org-publish-blog-sync (file) "Publish FILE synchronously." (with-current-buffer (or (get-file-buffer file) (find-file file)) (org-export-handle-include-files)
(run-hooks 'o-blog-before-publish-hook)
does correctly include all INCLUDE files, but the full included text ends up in sample.org. I guess I need to try and modify it so it creates a temp file, with all the inclusions then uses the temp file for the export.
Any progress? I have asked the question in the org mailing list about this. It doesn't feel like the intended behaviour.
Message copy/pasted below:
In the current buffer, org-export-handle-include-file overwrites:
with contents of the other file. For example,
Contents of the other file.
Is this the intended behaviour? Is there a method where you can use #+INCLUDE without overwriting the current buffer?
tony
Can this solve in o-blog v2 ?
The aim of V2 is to allow user to organize their files as they want. Thus this might be possible. For the moment V2 is in a big early stage.
isnt this fixed now? I use #INCLUDE all the time!
I want to port my Jekyll powered bog to o-blog. I have a lot of posts, one file for post. I would like to avoid placing them in one big file, as I think it would probably end up growing too big to be manageable.
I was hoping to INCLUDE each file:
+INCLUDE: "./posts/2012-09-06-sea-to-summit-xmug.org"
File contains:
\ DONE Sea to Summit X-Mug. :o@blog: CLOSED: [2012-10-18 Thu]
I managed to crack my plastic mug and was about to buy another one when I decided to investigate the alternatives. I don't like metal mugs of any sort. I end up burning my finger and lips whenever I use
However, it appears that the TODO header doesn't get processed. If I do it like this in the sample.org file:
\ DONE Sea to Summit X-Mug. :o@blog: CLOSED: [2012-10-18 Thu]
+INCLUDE: "./posts/2012-09-06-sea-to-summit-xmug.org"
Where the include just contains the body text it works. I guess I can live with having all the headers and just including the body text, but is it possible to get o-blog to process the DONE section in an included file?