Skip to content

livereload task improvements#2847

Merged
justinmayer merged 1 commit into
getpelican:masterfrom
mirekdlugosz:livereload-cleanup
Feb 9, 2021
Merged

livereload task improvements#2847
justinmayer merged 1 commit into
getpelican:masterfrom
mirekdlugosz:livereload-cleanup

Conversation

@mirekdlugosz

Copy link
Copy Markdown
Contributor
  • use custom build command, with caching turned on - this reduces site build time by around 40% on my testing machines
  • collect all glob patterns in a list and then call server.watch on each item - this allows to have single place where callback function must be specified
  • use '**/*.html' as glob in template, to track changes in subdirectories (some themes include "partials" directory, where they store common widgets used in few different templates)

@justinmayer justinmayer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the submission, Mirek. There seem to be some interesting changes in here. Have you seen any instances in which caching interfered with normal development? (e.g., stale results due to improper cache invalidation, etc.)

Comment thread pelican/tools/templates/tasks.py.jinja2 Outdated
- use custom build command, with caching turned on - this reduces site
  build time by around 40% on my testing machines
- collect all glob patterns in a list and then call `server.watch`
  on each item - this allows to have single place where callback
  function must be specified
- use '**/*.html' as glob in template, to track changes in
  subdirectories
@mirekdlugosz

Copy link
Copy Markdown
Contributor Author

Have you seen any instances in which caching interfered with normal development? (e.g., stale results due to improper cache invalidation, etc.)

So far I have not encountered any problems with caching. I tried changing stylesheet and jinja template file, and I edited one article, all while this task was running. That's not much, but I have been using this only for few days.

I guess one's mileage may vary depending on installed plugins and what exactly they do. Also, I clean up cache directory after liveserver task, so I have easy and fast way of starting with known state. I can add something similar here, if you feel that would be worthwhile.

@justinmayer

Copy link
Copy Markdown
Member

My limited testing yielded no problems, so I think we can merge and address any issues as they arise.

Many thanks for the useful enhancement, Mirek! 🥇

@justinmayer justinmayer merged commit 7a26f50 into getpelican:master Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants