-
-
Notifications
You must be signed in to change notification settings - Fork 491
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
(Possible) Documentation issue with page.date #900
Comments
I assume you’re referencing https://www.11ty.dev/docs/dates/ specifically: Eleventy currently runs the entire build and transforms all input files and writes all files to the output directory. So yes, the file is being created with every build! #108 will change this behavior. |
But I'm not seeing this when I create a build. By what you said, if i run |
Are you saying that lastmod and current time are different? I would assume that most of the time (during local dev) they will be the same. Relevant code: Line 656 in 556f2d8
Docs: https://nodejs.org/docs/latest-v12.x/api/fs.html#fs_stats_birthtimems |
So I made a file, docs/banana.md. I made it at 11AM let's say. I edited it at 11:15. While running eleventy --serve, the value I saw was 11:15. That makes sense because when I edited it, Eleventy recreated the file. However, I stopped running the server, rm -rf _site, run eleventy, and in the generated files, I still see 11:15. Make sense? |
To add more context - I have setup my site to deploy to Netlify. In my testing there with 2 docs (both outputting the page.date value), when I edit one and trigger a new deploy, both files have the same output. That makes sense, which makes me think its the lack of a proper "birth" value (see my link above) that could be the issue. When I stat the files in WSL I see no value for birth, but only the lastmod, so maybe Eleventy has to use lastmod on my machine, but on Netlify it can properly use file creation date. So... maybe only an issue for certain types of *nix installs? |
Do you have the Otherwise, use |
Describe the bug
The docs say that page.date will be the file's created date unless overridden. I was testing this and noticed it would update every time I modified the file, acting more like the file modification date than creation.
After speaking with some folks on the tnd Slack, we assumed it was because Eleventy was regenerating the HTML every time I saved the file. So it was the file creation value, but the file was recreated on my edits.
However... when I stopped using
eleventy --serve
and just output a static version, I'm seeing the same thing. A file I made at time X and modified at Y will show Y in the static output.Are the docs wrong about the default?
The text was updated successfully, but these errors were encountered: