emacsorphanage / org-page

[INACTIVE] A static site generator based on Emacs and org mode.
673 stars 99 forks source link

Template parsing is cached. #96

Closed kat-co closed 9 years ago

kat-co commented 9 years ago

My workflow is:

  1. Publish site.
  2. Edit template.
  3. Goto 1.

But it looks as if the templates are cached in ht (i.e. op/get-cache-create). So my changes aren't reflected unless I use a new emacs process every time.

sillykelvin commented 9 years ago

Yeah, templates are cached to speed up the generation, otherwise several templates need to be loaded from file when doing a single generation. If you want to see changes immediately after you updated some templates, you may clear the template cache by executing:

(setq op/item-cache nil)

Then the templates will be loaded from files again.

kat-co commented 9 years ago

Thank you for the explanation. Would it make more sense to always load from disk at the beginning of the generation and then use the cached values throughout the process? The cost of parsing them once shouldn't be very great.

I also set force-all to true which I thought might force parsing the templates, so that was a little surprising as well.

Thanks for the great work, and answers to my questions.

sillykelvin commented 9 years ago

Yeah, it is a great idea that update cache at the beginning of generation. I have updated the code, now the cache should be cleared before generation.