Coder Social home page Coder Social logo

Comments (6)

azegas avatar azegas commented on June 15, 2024

I see this in the readme.org:

image

But even if the html files already exist, they are being re rendered.

from org-static-blog.

bastibe avatar bastibe commented on June 15, 2024

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.

from org-static-blog.

azegas avatar azegas commented on June 15, 2024

"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.

image

As we can see in the image I have 3 org files in /home/nixos/GIT/org-static-blog/org directory

  • Dec 16 18:46 alpine.org
  • Dec 11 19:24 crontab__code_linux.org
  • Dec 16 10:01 windows-keybindings__windows.org

I have just generated them all, so we can see the html file creation time is Dec 18th, 06:23:

  • Dec 18 06:23 alpine.html
  • Dec 18 06:23 archive.html
  • Dec 18 06:23 crontab__code_linux.html
  • Dec 18 06:23 index.html
  • Dec 18 06:23 rss.xml
  • Dec 18 06:23 tag-code.html
  • Dec 18 06:23 tag-linux.html
  • Dec 18 06:23 tags.html
  • Dec 18 06:23 tag-windows.html
  • Dec 18 06:23 windows-keybindings__windows.html

I will go and modify one org file called "crontab__code_linux.org", which was last modified on Dec 11th.

image

Now I will regenerate the html files wiht my build command:

image

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

image

So in the "Archive" page or in the post page, the date that we will see will not be from

  • #+date: [2023-11-25 Sat 19:05] field that we specify in each org file (which would be my goal)
  • from the actual org file creation date

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:

image

image

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.

from org-static-blog.

azegas avatar azegas commented on June 15, 2024

Placed the above for reference, what I will try now is:

  • create new posts with org-static-blog-create-new-post instead any other way
  • try to use absolute directory paths instead of relative ones

will let you know how it goes

from org-static-blog.

azegas avatar azegas commented on June 15, 2024

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/ ).

from org-static-blog.

bastibe avatar bastibe commented on June 15, 2024

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.

from org-static-blog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.