Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

livereload task improvements #2847

Merged
merged 1 commit into from
Feb 9, 2021

Conversation

mirekdlugosz
Copy link
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)

Copy link
Member

@justinmayer justinmayer left a comment

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

pelican/tools/templates/tasks.py.jinja2 Outdated Show resolved Hide resolved
- 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
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
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.

None yet

2 participants