From 92fe6f9de0c930c5771d64595b6d0c932ca72c40 Mon Sep 17 00:00:00 2001 From: Steve Sinchak Date: Sun, 31 Dec 2023 18:11:15 -0600 Subject: [PATCH 1/3] Update tag-pages.md --- src/docs/quicktips/tag-pages.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/docs/quicktips/tag-pages.md b/src/docs/quicktips/tag-pages.md index 9afc9337a5..6318cc0e38 100644 --- a/src/docs/quicktips/tag-pages.md +++ b/src/docs/quicktips/tag-pages.md @@ -75,6 +75,25 @@ permalink: /tags/{{ tag }}/ Now Eleventy will only generate a `/tags/personal/` template and `tech` will be ignored. +## Include all Tag Pages in collections.all + +By default, only the first page generated with pagination will be added to the `all` collection. Ordinarily, this is not a problem, but with how we are using pagination in this unconventional manner to generate Tag Pages, you will likely want each Tag Page to be added to the `all` collection (very helpful to later generate a sitemap.xml file). Pages must opt-in to this behavior by setting `addAllPagesToCollections` to `true` like this: + +{% raw %} +```markdown +--- +pagination: + addAllPagesToCollections: true + data: collections + size: 1 + alias: tag + filter: + - tech +permalink: /tags/{{ tag }}/ +--- +``` +{% endraw %} + ## In Practice This is currently in use on the [`eleventy-base-blog` sample project](https://github.com/11ty/eleventy-base-blog). Check out source code in the [`tags.njk` template](https://github.com/11ty/eleventy-base-blog/blob/main/content/tags.njk) and [see a live demo](https://eleventy-base-blog.netlify.com/tags/another-tag/). From 32e506b37db07c746a49e6235a6e35f833718f4b Mon Sep 17 00:00:00 2001 From: Steve Sinchak Date: Sun, 31 Dec 2023 19:09:05 -0600 Subject: [PATCH 2/3] Update tag-pages.md --- src/docs/quicktips/tag-pages.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docs/quicktips/tag-pages.md b/src/docs/quicktips/tag-pages.md index 6318cc0e38..3b30a70295 100644 --- a/src/docs/quicktips/tag-pages.md +++ b/src/docs/quicktips/tag-pages.md @@ -75,7 +75,7 @@ permalink: /tags/{{ tag }}/ Now Eleventy will only generate a `/tags/personal/` template and `tech` will be ignored. -## Include all Tag Pages in collections.all +## Include all Tag Pages in the `all` Collection By default, only the first page generated with pagination will be added to the `all` collection. Ordinarily, this is not a problem, but with how we are using pagination in this unconventional manner to generate Tag Pages, you will likely want each Tag Page to be added to the `all` collection (very helpful to later generate a sitemap.xml file). Pages must opt-in to this behavior by setting `addAllPagesToCollections` to `true` like this: From 764dda39805948af393e96cfd034ba8e13c20499 Mon Sep 17 00:00:00 2001 From: Steve Sinchak Date: Sun, 31 Dec 2023 19:11:36 -0600 Subject: [PATCH 3/3] Update tag-pages.md --- src/docs/quicktips/tag-pages.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docs/quicktips/tag-pages.md b/src/docs/quicktips/tag-pages.md index 3b30a70295..498fde409f 100644 --- a/src/docs/quicktips/tag-pages.md +++ b/src/docs/quicktips/tag-pages.md @@ -77,7 +77,7 @@ Now Eleventy will only generate a `/tags/personal/` template and `tech` will be ## Include all Tag Pages in the `all` Collection -By default, only the first page generated with pagination will be added to the `all` collection. Ordinarily, this is not a problem, but with how we are using pagination in this unconventional manner to generate Tag Pages, you will likely want each Tag Page to be added to the `all` collection (very helpful to later generate a sitemap.xml file). Pages must opt-in to this behavior by setting `addAllPagesToCollections` to `true` like this: +By default, only the first page generated with pagination will be added to the `all` collection. Ordinarily, this is not a problem, but with how we are using pagination in this unconventional manner to generate Tag Pages, you will likely want each Tag Page to be added to the `all` collection (very helpful to later generate a sitemap.xml file). Pages must opt-in to change this behavior by setting `addAllPagesToCollections` to `true` like this: {% raw %} ```markdown