Open azegas opened 10 months ago
I see this in the readme.org:
But even if the html files already exist, they are being re rendered.
Only the changed org-file should be re-exported. Regrettably, this does change all the ids in the HTML file, as they seem to be randomly generated by org-mode on every export. (If anyone knows a way of preventing that, I'd be most interested!) Existing HTML files should not be changed, however.
You can check out my own config to see if there are any notable differences between yours and mine. You could also try to configure your org-static-blog with absolute directory paths instead of relative ones. I've run into no ends of problems with that sort of thing, so that's perhaps worth a try.
"Only the changed org-file should be re-exported." "Existing HTML files should not be changed, however."
I tried making a little experiment. Today is Dec 18th. I have launched emacs with "emacs -q" not to load any additional configuration.
As we can see in the image I have 3 org files in /home/nixos/GIT/org-static-blog/org directory
I have just generated them all, so we can see the html file creation time is Dec 18th, 06:23:
I will go and modify one org file called "crontab__code_linux.org", which was last modified on Dec 11th.
Now I will regenerate the html files wiht my build command:
We can see that 6:44 I have changed the org file, then 06:45 I have regenerated the the html files and instead of only regenerating "crontab__code_linux.html", ALL html files got regenerated
So in the "Archive" page or in the post page, the date that we will see will not be from
But it wil always be the date of when the file was generated. Which will always be the date when you make a change to ANY of your .org file.
I wish there was a way to use these in org-static-blog export:
So I would clearly see the date that I specify in org file, the a clear date when the file was created and when the file was modified.
In org-static-blog it seems that I only can see the date modifed, which changes with each change in any of the org file it seems.
Placed the above for reference, what I will try now is:
org-static-blog-create-new-post
instead any other waywill let you know how it goes
Okay so seems like having org-static-blog configuration in a separate file like I have(build-site.el
) and then running it with build.sh
script (like I described in my initial message) to generate the html files is responsible for this strange behavior where everything gets re-rendered.
IF I place my org-static-blog configuration(build-site.el
) content into my emacs config, together with the rest of the packages - the behavior is proper, ONLY the modified .org files get re-rendered.
So basically this way of having multiple org-static-blog configs for different blogs does not really work(by the way, got this idea here - https://systemcrafters.net/publishing-websites-with-org-mode/building-the-site/ ).
Thank you for your deep analysis!
Org-static-blog decides who gets re-rendered in the function org-static-blog-needs-publishing-p
, which simply checks file modification dates of pub-filename
and post-filename
. I bet it trips up with the pub-filename
generation, probably due to some unresolved path thing. Emacs and path normalization is often an issue.
But I have no idea how that could be related to having the config in a different place.
Regarding dates, the #+date
(and #+title
) field is extracted from the post with a simple regex search. It would be simple to additionally extract some other fields. It's not quite so simple to include them in your templates, however, as the formatting is currently implemented with the builtin format-time-string
, which uses a single date.
Hello!
Thank you for this great package, it has helped me to build my blog!
About the issue I am having:
We can see that only "hello" was added to the .org file:
When I execute my shell script named
build.sh
that runs this command:emacs -Q --script build-site.el
build-site.el content:
The html files are being generated, all good, BUT for some reason EVERYTHING get's rebuild. In my case all 41 files. Only the id tags change.. I don't really understand why. Is it intentional? I don't really like that it changes the "file modified" data, not sure if it translates to the date shown in the blog itself? Also all these git commits each time I make a change will make it unworkable to version control.