You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. Sorry for reporting several issues in one — they all are related to my repro case.
If Eleventy server is started with the --ignore-initial option (e.g. using the eleventy --ignore-initial --incremental --serve command), then the page that lists elements of a collection (e.g. the index page for a blog) will not show the collection items. It seems that the --ignore-initial option prevents the full collection from being read. If this is the expected behavior, I do not think it is reflected in the documentation.
The passthrough copy emulation (enabled with eleventyConfig.setServerPassthroughCopyBehavior("passthrough");) does not seem to work. The default behavior, which is copy, works correctly
Eleventy does not detect changes in passthrough files.
If I add a pathPrefix to eleventyConfig, the dev sever redirects to a page without the prefix if the url does not have a trailing slash. For example:
No prefix set in the config; url /blog/2023-article-one/ (with a trailing slash) shows the page correctly
No prefix set in the config; url /blog/2023-article-one (without a trailing slash) redirects to /blog/2023-article-one/ and shows the page correctly
Prefix set in the config; url /prefix/blog/2023-article-one/ (with a trailing slash) shows the page correctly
(BUG) Prefix set in the config; url /prefix/blog/2023-article-one (without a trailing slash) redirects to /blog/2023-article-one/ (prefix lost), and shows a 404 page
Reproduction steps
For the problem with --ignore-initial:
Copy the reproduction repo, install node modules, and run npm start (this will run eleventy --ignore-initial --incremental --serve)
Update the src/blog.njk file
Navigate to /blog
You will see the "Blog" heading, without any links to the articles. Expected the blog index page to contain a list of articles.
For the problem with passthrough copy:
Make sure the build directory has been deleted
In .eleventy.js file, uncomment the line eleventyConfig.setServerPassthroughCopyBehavior("passthrough");
Run npm start (this will run eleventy --ignore-initial --incremental --serve)
Save src/blog/2023/article-one/index.md file to get it picked up by the dev server
Open /blog/2023-article-one/
(Problem): You will see that the image does not get served
Stop the dev server
In .eleventy.js file, comment the line `eleventyConfig.setServerPassthroughCopyBehavior("passthrough");
Run npm start
Visit /blog/2023-article-one/ again
You will see that the image has been copied correctly
Update styles in the src/blog/2023/article-one/styles.css file
In the terminal, you will see the message "Copied 1 file / Wrote 0 files (skipped 5) in 0.02 seconds (v2.0.1)"
(Problem): However, the dev server will continue serving the old file.
For the problem with pathPrefix:
In .eleventy.js, uncomment the line pathPrefix: '/prefix/'
Run npm start to start the server
Visit /prefix/blog/2023-article-one/. You should see the blog article page.
Delete the trailing slash from /prefix/blog/2023-article-one/ in the url bar and press enter
(Problem): Instead of redirecting back to /prefix/blog/2023-article-one/, dev server will redirect to /blog/2023-article-one/ (without the prefix), and you will see a 404 page.
Operating system
macOS Sonoma Version 14.2.1
Eleventy
2.0.1
Describe the bug
Hi. Sorry for reporting several issues in one — they all are related to my repro case.
--ignore-initial
option (e.g. using theeleventy --ignore-initial --incremental --serve
command), then the page that lists elements of a collection (e.g. the index page for a blog) will not show the collection items. It seems that the--ignore-initial
option prevents the full collection from being read. If this is the expected behavior, I do not think it is reflected in the documentation.eleventyConfig.setServerPassthroughCopyBehavior("passthrough");
) does not seem to work. The default behavior, which iscopy
, works correctlypathPrefix
toeleventyConfig
, the dev sever redirects to a page without the prefix if the url does not have a trailing slash. For example:/blog/2023-article-one/
(with a trailing slash) shows the page correctly/blog/2023-article-one
(without a trailing slash) redirects to/blog/2023-article-one/
and shows the page correctly/prefix/blog/2023-article-one/
(with a trailing slash) shows the page correctly/prefix/blog/2023-article-one
(without a trailing slash) redirects to/blog/2023-article-one/
(prefix lost), and shows a 404 pageReproduction steps
For the problem with
--ignore-initial
:npm start
(this will runeleventy --ignore-initial --incremental --serve
)src/blog.njk
file/blog
For the problem with passthrough copy:
build
directory has been deleted.eleventy.js
file, uncomment the lineeleventyConfig.setServerPassthroughCopyBehavior("passthrough");
npm start
(this will runeleventy --ignore-initial --incremental --serve
)src/blog/2023/article-one/index.md
file to get it picked up by the dev server/blog/2023-article-one/
.eleventy.js
file, comment the line `eleventyConfig.setServerPassthroughCopyBehavior("passthrough");npm start
/blog/2023-article-one/
againsrc/blog/2023/article-one/styles.css
fileFor the problem with
pathPrefix
:.eleventy.js
, uncomment the linepathPrefix: '/prefix/'
npm start
to start the server/prefix/blog/2023-article-one/
. You should see the blog article page./prefix/blog/2023-article-one/
in the url bar and press enter/prefix/blog/2023-article-one/
, dev server will redirect to/blog/2023-article-one/
(without the prefix), and you will see a 404 page.Reproduction URL
https://github.com/azangru/eleventy-blog-bugs-repro
Screenshots
No response
The text was updated successfully, but these errors were encountered: