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

On watch, every single file calls out to Git #24

Closed
gjtorikian opened this issue Jul 20, 2014 · 13 comments · Fixed by #28
Closed

On watch, every single file calls out to Git #24

gjtorikian opened this issue Jul 20, 2014 · 13 comments · Fixed by #28

Comments

@gjtorikian
Copy link
Owner

Pre-0.3.0, Jekyll sites would crash with this plugin and --watch. Now, they remain, but generation takes a really long time, because every single file needs a Git call to check the time.

@parkr Is there a way to run a plugin once, before the server starts up, and not every time an auto-regeneration occurs? If not, the only thing I can think of is to preserve some kind of hash, like @matches[absolute_path_to_article] = last_change, and just not even attempt the last_modified_at check if the file was checked once before.

@parkr
Copy link
Contributor

parkr commented Jul 31, 2014

You can keep a hash if you want on the Determinator maybe? {"path" => Time}?

@gjtorikian
Copy link
Owner Author

I understood maybe five of those words.

So a Hash is kept, and then what? "Rerun Determinator if Time > 45 minutes" ?

@parkr
Copy link
Contributor

parkr commented Jul 31, 2014

@gjtorikian Sure, or just keep an ongoing cache of all the dates (unformatted of course) and don't rebuild anything in the current process. That would ensure, when using --watch, that git is only ever called once per page per process (not each time the listener rebuilds).

That hardly makes sense to me in words. Sorry I suck at words today.

@gjtorikian
Copy link
Owner Author

❤️

@gjtorikian
Copy link
Owner Author

I think the sexy rewrite nullified this. I can no longer reproduce the error.

@parkr
Copy link
Contributor

parkr commented Jul 31, 2014

YAYYYY 🎉 sexy = perf

@gjtorikian gjtorikian reopened this Sep 12, 2014
@gjtorikian
Copy link
Owner Author

Still an issue.

@parkr
Copy link
Contributor

parkr commented Sep 12, 2014

Are you using {{ page.last_modified_at }} or {% last_modified_at %}? The latter will spawn a multitude of processes, whereas the former will cache at the page level so each subsequent call to it on the page just returns the already-computed value.

@gjtorikian
Copy link
Owner Author

The latter, though maybe I should switch to the former? Either way the problem needed to be fixed.

@parkr
Copy link
Contributor

parkr commented Sep 12, 2014

Definitely use page.last_modified_at as often as possible. I think you'll find it doesn't thrash your system as much. 😄

@AnandLA
Copy link

AnandLA commented Jun 16, 2015

How do I install this as a plugin within jekyll ... I created a _plugin directory and git cloned into it now what ?

@888ba8
Copy link

888ba8 commented Dec 22, 2020

@AnandLA @parkr @gjtorikian I can only use

{% last_modified_at %}

If I try to include {% page.last_modified_at %} in my layout, I get the following error, when I try to bundle exec jekyll build:
Liquid syntax error (line 1): Unknown tag 'page' in /_layouts/page.html

How to fix this please?

@mraible
Copy link

mraible commented Mar 10, 2021

I'm experiencing a similar issue to @888ba8.

Liquid Exception: No such file or directory - /Users/mraible/dev/path/to/blog/tags/android/index.html does not exist! in /_layouts/tag.html
jekyll 3.9.0 | Error:  No such file or directory - /Users/mraible/dev/path/to/blog/_source/blog/tags/android/index.html does not exist!

If I remove {{ page.last_modified_at }} and replace it with {% last_modified_at %}, I get the same error.

Anyone figure out a way to add "Last updated" to a Jekyll blog? I tried a few other solutions, but none seem to work.

RalphHightower referenced this issue in RalphHightower/RalphHightower.github.io Nov 5, 2022
{% page.last-modified-at %}
Liquid Exception: Liquid syntax error (line 49): Unknown tag 'page' in README.md
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 a pull request may close this issue.

5 participants