{"id":2258,"date":"2021-12-08T19:27:47","date_gmt":"2021-12-09T00:27:47","guid":{"rendered":"https:\/\/openlab.bmcc.cuny.edu\/mmp-350-fall-21\/?p=2258"},"modified":"2021-12-08T19:29:48","modified_gmt":"2021-12-09T00:29:48","slug":"showing-groups-of-pages-in-11ty","status":"publish","type":"post","link":"https:\/\/openlab.bmcc.cuny.edu\/mmp-350-fall-21\/projects\/final\/showing-groups-of-pages-in-11ty\/","title":{"rendered":"Showing Groups of Pages in 11ty"},"content":{"rendered":"\n<p>There are a few ways that you can generate lists of pages (posts) in 11ty. This post looks at how to based on tags, custom front-matter variables, and listing all of the files in a folder.<\/p>\n\n\n\n<p>You can follow along with this by using the <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/profstein\/collections-example\" target=\"_blank\">collections-example<\/a> repository. <\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Click on the link for the repo: <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/profstein\/collections-example\" target=\"_blank\">https:\/\/github.com\/profstein\/collections-example<\/a><\/li><li>Click <strong>Use this template<\/strong><\/li><li>Go through the steps to create your version of the repository<\/li><li>Clone that new repository to VS Code.<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">List all pages with a tag<\/h2>\n\n\n\n<p>By default 11ty creates a collection for each tag on a page. You can use this to tell it to go through that collection and then show all of the pages that have a tag.<\/p>\n\n\n\n<details class=\"wp-block-stackable-accordion stk-block-accordion stk-inner-blocks stk-block-content stk-block stk-28b0117\" data-block-id=\"28b0117\">\n<summary class=\"wp-block-stackable-column stk--container-small stk-block-accordion__heading stk-block-column stk-column stk-block stk-b820b6e\" data-block-id=\"b820b6e\"><div class=\"stk-column-wrapper stk-block-column__content stk-container stk-b820b6e-container stk-hover-parent\"><div class=\"stk-block-content stk-inner-blocks\">\n<div class=\"wp-block-stackable-icon-label stk-block-icon-label stk-block stk-48890a6\" data-block-id=\"48890a6\"><div class=\"stk-row stk-inner-blocks stk-block-content\">\n<div class=\"wp-block-stackable-heading stk-block-heading stk-block stk-c440382\" data-block-id=\"c440382\"><h4 class=\"stk-block-heading__text\">Example Code: List pages by tag<\/h4><\/div>\n\n\n\n<div class=\"wp-block-stackable-icon stk-block-icon stk-block stk-9b08950\" data-block-id=\"9b08950\"><span class=\"stk--svg-wrapper\"><div class=\"stk--inner-svg\"><svg style=\"height:0;width:0\"><defs><linearGradient id=\"linear-gradient-9b08950\" x1=\"0\" x2=\"100%\" y1=\"0\" y2=\"0\"><stop offset=\"0%\" style=\"stop-opacity:1;stop-color:var(--linear-gradient-9-b-08950-color-1)\"><\/stop><stop offset=\"100%\" style=\"stop-opacity:1;stop-color:var(--linear-gradient-9-b-08950-color-2)\"><\/stop><\/linearGradient><\/defs><\/svg><svg data-prefix=\"fas\" data-icon=\"chevron-down\" class=\"svg-inline--fa fa-chevron-down fa-w-14\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 448 512\" aria-hidden=\"true\" width=\"32\" height=\"32\"><path fill=\"currentColor\" d=\"M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z\"><\/path><\/svg><\/div><\/span><\/div>\n<\/div><\/div>\n<\/div><\/div><\/summary>\n\n\n\n<div class=\"wp-block-stackable-column stk-block-accordion__content stk-block-column stk-column stk-block stk-9574528\" data-block-id=\"9574528\"><div class=\"stk-column-wrapper stk-block-column__content stk-container stk-9574528-container stk--no-background stk--no-padding\"><div class=\"stk-block-content stk-inner-blocks\">\n<div class=\"wp-block-stackable-text stk-block-text stk-block stk-34b8345\" data-block-id=\"34b8345\"><p class=\"stk-block-text__text\">First you must add a tag to pages in their front matter. For example you might create <strong>post.md<\/strong> and put this front-matter in<\/p><\/div>\n\n\n\n<div class=\"wp-block-stackable-text stk-block-text stk-block stk-2590fe0\" data-block-id=\"2590fe0\"><p class=\"stk-block-text__text\"><\/p><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>---\ntitle: Post 1\nlayout: post.njk\ntags: &#91;post, othertag]\n---<\/code><\/pre>\n\n\n\n<p>Then you can add this same tag in front-matter of other pages.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">List Pages with &#8220;post&#8221; tag<\/h2>\n\n\n\n<p>Next we will create the list of posts. This can be wherever you want. In this example we will create a blog.md file and put this in to list the pages:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;ul>\n  {%- for post in collections.post %}\n  &lt;li>\n  &lt;a href=\"{{ post.url }}\">\n  {{ post.data.title }}\n  &lt;\/a>\n  &lt;\/li>\n  {%- endfor %}\n&lt;\/ul><\/code><\/pre>\n\n\n\n<p><strong>Note: <\/strong>To list posts with a different tag, you would change what collection you were using in the For Loop. For example to list posts with a banana tag:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><meta charset=\"utf-8\">{%- for post in collections.<strong>banana<\/strong> %}<\/code><\/pre>\n<\/div><\/div><\/div>\n<\/details>\n\n\n\n<h2 class=\"wp-block-heading\">List all pages with custom front-matter<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<details class=\"wp-block-stackable-accordion stk-block-accordion stk-inner-blocks stk-block-content stk-block stk-761c8e3\" data-block-id=\"761c8e3\">\n<summary class=\"wp-block-stackable-column stk--container-small stk-block-accordion__heading stk-block-column stk-column stk-block stk-e2cc482\" data-block-id=\"e2cc482\"><div class=\"stk-column-wrapper stk-block-column__content stk-container stk-e2cc482-container stk-hover-parent\"><div class=\"stk-block-content stk-inner-blocks\">\n<div class=\"wp-block-stackable-icon-label stk-block-icon-label stk-block stk-4b66ed8\" data-block-id=\"4b66ed8\"><div class=\"stk-row stk-inner-blocks stk-block-content\">\n<div class=\"wp-block-stackable-heading stk-block-heading stk-block stk-539ead2\" data-block-id=\"539ead2\"><h4 class=\"stk-block-heading__text\">Example Code: List pages with custom front-matter<\/h4><\/div>\n\n\n\n<div class=\"wp-block-stackable-icon stk-block-icon stk-block stk-381c0ba\" data-block-id=\"381c0ba\"><span class=\"stk--svg-wrapper\"><div class=\"stk--inner-svg\"><svg style=\"height:0;width:0\"><defs><linearGradient id=\"linear-gradient-381c0ba\" x1=\"0\" x2=\"100%\" y1=\"0\" y2=\"0\"><stop offset=\"0%\" style=\"stop-opacity:1;stop-color:var(--linear-gradient-381-c-0-ba-color-1)\"><\/stop><stop offset=\"100%\" style=\"stop-opacity:1;stop-color:var(--linear-gradient-381-c-0-ba-color-2)\"><\/stop><\/linearGradient><\/defs><\/svg><svg data-prefix=\"fas\" data-icon=\"chevron-down\" class=\"svg-inline--fa fa-chevron-down fa-w-14\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 448 512\" aria-hidden=\"true\" width=\"32\" height=\"32\"><path fill=\"currentColor\" d=\"M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z\"><\/path><\/svg><\/div><\/span><\/div>\n<\/div><\/div>\n<\/div><\/div><\/summary>\n\n\n\n<div class=\"wp-block-stackable-column stk-block-accordion__content stk-block-column stk-column stk-block stk-6d6918e\" data-block-id=\"6d6918e\"><div class=\"stk-column-wrapper stk-block-column__content stk-container stk-6d6918e-container stk--no-background stk--no-padding\"><div class=\"stk-block-content stk-inner-blocks\">\n<div class=\"wp-block-stackable-text stk-block-text stk-block stk-e9b072b\" data-block-id=\"e9b072b\"><p class=\"stk-block-text__text\">First you must add the custom front matter. For example you might create <strong>post.md<\/strong> and put this front-matter to track the author<\/p><\/div>\n\n\n\n<div class=\"wp-block-stackable-text stk-block-text stk-block stk-f5ed19e\" data-block-id=\"f5ed19e\"><p class=\"stk-block-text__text\"><\/p><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>---\ntitle: Post 1\nlayout: post.njk\ntags: &#91;post, othertag]\nauthor: Imani Washington\n---<\/code><\/pre>\n\n\n\n<p>Then you can add this same author variable to other posts.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">List Pages with a specific author value<\/h2>\n\n\n\n<p>Next we will create the list of posts for an author. The trick here is adding the if statement to check for posts with the author value we want.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;p>Posts by Imani Washington\n&lt;ul role=\"list\">\n{% for post in collections.post %}\n<strong>{% if author == \"Imani Washington\" %}<\/strong>\n&lt;li>\n    &lt;a href=\"{{ post.url }}\">\n        {{ post.data.title }}\n    &lt;\/a>\n&lt;\/li>\n<strong>{% endif %}<\/strong>\n{%- endfor %}\n&lt;\/ul><\/code><\/pre>\n\n\n\n<p><strong>Note: <\/strong>The if statment is the key here that means it only shows pages that have a specific author tag.<\/p>\n\n\n\n<p>Below is a more full-featured way of doing the same thing where we could lists add aria-current if the page being listed is the one we&#8217;re on.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;p>Posts by {{author}}\n&lt;ul role=\"list\">\n{% for post in collections.post %}\n{% if author == post.data.author %}\n&lt;li>\n    &lt;a \n    {% if post.url === page.url %}aria-current=\"page\"{% endif %} \n    href=\"{{ post.url }}\">\n        {{ post.data.title }}\n    &lt;\/a>\n&lt;\/li>\n{% endif %}\n{%- endfor %}\n&lt;\/ul><\/code><\/pre>\n<\/div><\/div><\/div>\n<\/details>\n\n\n\n<details class=\"wp-block-stackable-accordion stk-block-accordion stk-inner-blocks stk-block-content stk-block stk-b38bcc7\" data-block-id=\"b38bcc7\">\n<div class=\"wp-block-stackable-column stk-block-accordion__content stk-block-column stk-column stk-block stk-83e1dda\" data-block-id=\"83e1dda\"><div class=\"stk-column-wrapper stk-block-column__content stk-container stk-83e1dda-container stk--no-background stk--no-padding\"><div class=\"stk-block-content stk-inner-blocks\">\n<div class=\"wp-block-stackable-text stk-block-text stk-block stk-8769af1\" data-block-id=\"8769af1\"><p class=\"stk-block-text__text\">First you must add a tag to pages in their front matter. For example you might create <strong>post.md<\/strong> and put this front-matter in<\/p><\/div>\n\n\n\n<div class=\"wp-block-stackable-text stk-block-text stk-block stk-752286a\" data-block-id=\"752286a\"><p class=\"stk-block-text__text\"><\/p><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>---\ntitle: Post 1\nlayout: post.njk\ntags: &#91;post, othertag]\n---<\/code><\/pre>\n\n\n\n<p>Then you can add this same tag in front-matter of other pages.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">List Pages with &#8220;post&#8221; tag<\/h2>\n\n\n\n<p>Next we will create the list of posts. This can be wherever you want. In this example we will create a blog.md file and put this in to list the pages:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;ul>\n  {%- for post in collections.post %}\n  &lt;li>\n  &lt;a href=\"{{ post.url }}\">\n  {{ post.data.title }}\n  &lt;\/a>\n  &lt;\/li>\n  {%- endfor %}\n&lt;\/ul><\/code><\/pre>\n\n\n\n<p><strong>Note: <\/strong>To list posts with a different tag, you would change what collection you were using in the For Loop. For example to list posts with a banana tag:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><meta charset=\"utf-8\">{%- for post in collections.<strong>banana<\/strong> %}<\/code><\/pre>\n<\/div><\/div><\/div>\n\n\n\n<summary class=\"wp-block-stackable-column stk--container-small stk-block-accordion__heading stk-block-column stk-column stk-block stk-5c68879\" data-block-id=\"5c68879\"><div class=\"stk-column-wrapper stk-block-column__content stk-container stk-5c68879-container stk-hover-parent\"><div class=\"stk-block-content stk-inner-blocks\">\n<div class=\"wp-block-stackable-icon-label stk-block-icon-label stk-block stk-96c0728\" data-block-id=\"96c0728\"><div class=\"stk-row stk-inner-blocks stk-block-content\">\n<div class=\"wp-block-stackable-heading stk-block-heading stk-block stk-9871f7e\" data-block-id=\"9871f7e\"><h4 class=\"stk-block-heading__text\">Example Code: List pages by tag<\/h4><\/div>\n\n\n\n<div class=\"wp-block-stackable-icon stk-block-icon stk-block stk-aaecfa3\" data-block-id=\"aaecfa3\"><span class=\"stk--svg-wrapper\"><div class=\"stk--inner-svg\"><svg style=\"height:0;width:0\"><defs><linearGradient id=\"linear-gradient-aaecfa3\" x1=\"0\" x2=\"100%\" y1=\"0\" y2=\"0\"><stop offset=\"0%\" style=\"stop-opacity:1;stop-color:var(--linear-gradient-aaecfa-3-color-1)\"><\/stop><stop offset=\"100%\" style=\"stop-opacity:1;stop-color:var(--linear-gradient-aaecfa-3-color-2)\"><\/stop><\/linearGradient><\/defs><\/svg><svg data-prefix=\"fas\" data-icon=\"chevron-down\" class=\"svg-inline--fa fa-chevron-down fa-w-14\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 448 512\" aria-hidden=\"true\" width=\"32\" height=\"32\"><path fill=\"currentColor\" d=\"M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z\"><\/path><\/svg><\/div><\/span><\/div>\n<\/div><\/div>\n<\/div><\/div><\/summary>\n<\/details>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">List all pages in a folder<\/h2>\n\n\n\n<p>This one allows you to list all pages in a folder. That means you don&#8217;t have to remember to add the same tag to all of the files you want to include. It does mean that you have to add some custom code to .eleventy.js to create the Custom Collection. A Custom Collection is one that you define (instead of one 11ty automatically defines, like for tags).<\/p>\n\n\n\n<details class=\"wp-block-stackable-accordion stk-block-accordion stk-inner-blocks stk-block-content stk-block stk-4cb7799\" data-block-id=\"4cb7799\">\n<summary class=\"wp-block-stackable-column stk--container-small stk-block-accordion__heading stk-block-column stk-column stk-block stk-273b7a5\" data-block-id=\"273b7a5\"><div class=\"stk-column-wrapper stk-block-column__content stk-container stk-273b7a5-container stk-hover-parent\"><div class=\"stk-block-content stk-inner-blocks\">\n<div class=\"wp-block-stackable-icon-label stk-block-icon-label stk-block stk-ad2bdb4\" data-block-id=\"ad2bdb4\"><div class=\"stk-row stk-inner-blocks stk-block-content\">\n<div class=\"wp-block-stackable-heading stk-block-heading stk-block stk-123bdc9\" data-block-id=\"123bdc9\"><h4 class=\"stk-block-heading__text\">Example Code: List pages in a folder<\/h4><\/div>\n\n\n\n<div class=\"wp-block-stackable-icon stk-block-icon stk-block stk-3966bb0\" data-block-id=\"3966bb0\"><span class=\"stk--svg-wrapper\"><div class=\"stk--inner-svg\"><svg style=\"height:0;width:0\"><defs><linearGradient id=\"linear-gradient-3966bb0\" x1=\"0\" x2=\"100%\" y1=\"0\" y2=\"0\"><stop offset=\"0%\" style=\"stop-opacity:1;stop-color:var(--linear-gradient-3966-bb-0-color-1)\"><\/stop><stop offset=\"100%\" style=\"stop-opacity:1;stop-color:var(--linear-gradient-3966-bb-0-color-2)\"><\/stop><\/linearGradient><\/defs><\/svg><svg data-prefix=\"fas\" data-icon=\"chevron-down\" class=\"svg-inline--fa fa-chevron-down fa-w-14\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 448 512\" aria-hidden=\"true\" width=\"32\" height=\"32\"><path fill=\"currentColor\" d=\"M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z\"><\/path><\/svg><\/div><\/span><\/div>\n<\/div><\/div>\n<\/div><\/div><\/summary>\n\n\n\n<div class=\"wp-block-stackable-column stk-block-accordion__content stk-block-column stk-column stk-block stk-2a683bf\" data-block-id=\"2a683bf\"><div class=\"stk-column-wrapper stk-block-column__content stk-container stk-2a683bf-container stk--no-background stk--no-padding\"><div class=\"stk-block-content stk-inner-blocks\">\n<div class=\"wp-block-stackable-text stk-block-text stk-block stk-cb095b0\" data-block-id=\"cb095b0\"><p class=\"stk-block-text__text\">First we have to edit <strong>.eleventy.js<\/strong> in order to add a Custom Collection. It is important to add this <strong>eleventyConfig<\/strong> right after the other <strong>eleventyConfig<\/strong> statements and before the <strong>return<\/strong><\/p><\/div>\n\n\n\n<div class=\"wp-block-stackable-image stk-block-image stk-block stk-37e014b\" data-block-id=\"37e014b\"><figure class=\"stk-img-wrapper stk-image--shape-stretch\"><img loading=\"lazy\" decoding=\"async\" class=\"stk-img wp-image-2261\" src=\"https:\/\/openlab.bmcc.cuny.edu\/mmp-350-fall-21\/wp-content\/uploads\/sites\/1879\/2021\/12\/Screen-Shot-2021-12-08-at-7.04.39-PM.png\" width=\"2048\" height=\"804\" alt=\"screenshot of .eleventy.js file\" srcset=\"https:\/\/openlab.bmcc.cuny.edu\/mmp-350-fall-21\/wp-content\/uploads\/sites\/1879\/2021\/12\/Screen-Shot-2021-12-08-at-7.04.39-PM.png 2048w, https:\/\/openlab.bmcc.cuny.edu\/mmp-350-fall-21\/wp-content\/uploads\/sites\/1879\/2021\/12\/Screen-Shot-2021-12-08-at-7.04.39-PM-300x118.png 300w, https:\/\/openlab.bmcc.cuny.edu\/mmp-350-fall-21\/wp-content\/uploads\/sites\/1879\/2021\/12\/Screen-Shot-2021-12-08-at-7.04.39-PM-1024x402.png 1024w, https:\/\/openlab.bmcc.cuny.edu\/mmp-350-fall-21\/wp-content\/uploads\/sites\/1879\/2021\/12\/Screen-Shot-2021-12-08-at-7.04.39-PM-768x302.png 768w, https:\/\/openlab.bmcc.cuny.edu\/mmp-350-fall-21\/wp-content\/uploads\/sites\/1879\/2021\/12\/Screen-Shot-2021-12-08-at-7.04.39-PM-1536x603.png 1536w, https:\/\/openlab.bmcc.cuny.edu\/mmp-350-fall-21\/wp-content\/uploads\/sites\/1879\/2021\/12\/Screen-Shot-2021-12-08-at-7.04.39-PM-1568x616.png 1568w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/figure><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>eleventyConfig.addCollection(\"postsFolder\", function(collectionApi) {\n    return collectionApi.getFilteredByGlob(\"**\/posts\/*.md\").sort(function(a, b) {\n      \/\/return a.date - b.date; \/\/ sort by date - ascending\n      return b.date - a.date; \/\/ sort by date - descending\n    });\n});<\/code><\/pre>\n\n\n\n<p>Now we have defined a Custom Collection named <strong>postsFolder<\/strong>. We can use this like the tag collections.<\/p>\n\n\n\n<p>If you wanted to use a different folder then you could change <strong>&#8220;**\/posts\/*.md&#8221;<\/strong> to something else like <strong>&#8220;**\/gallery\/*.md&#8221;<\/strong> if you had a gallery folder.<\/p>\n\n\n\n<p>Next we will create the list of posts. This is like we did for tags but using the custom collection name.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;ul>\n  {%- for post in collections.<strong>postsFolder<\/strong> %}\n  &lt;li>\n  &lt;a href=\"{{ post.url }}\">\n  {{ post.data.title }}\n  &lt;\/a>\n  &lt;\/li>\n  {%- endfor %}\n&lt;\/ul><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n<\/div><\/div><\/div>\n<\/details>\n","protected":false},"excerpt":{"rendered":"<p>There are a few ways that you can generate lists of pages (posts) in 11ty. This post looks at how to based on tags, custom front-matter variables, and listing all of the files in a folder. You can follow along with this by using the collections-example repository. Click on the link for the repo: https:\/\/github.com\/profstein\/collections-example&hellip; <a class=\"more-link\" href=\"https:\/\/openlab.bmcc.cuny.edu\/mmp-350-fall-21\/projects\/final\/showing-groups-of-pages-in-11ty\/\">Continue reading <span class=\"screen-reader-text\">Showing Groups of Pages in 11ty<\/span><\/a><\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","portfolio_post_id":0,"portfolio_citation":"","portfolio_annotation":"","openlab_post_visibility":"","footnotes":""},"categories":[146,150,113],"tags":[114,54,108],"coauthors":[87],"class_list":["post-2258","post","type-post","status-publish","format-standard","hentry","category-eleventy","category-eleventy-site","category-final","tag-dynamic","tag-eleventy","tag-list","entry"],"featured_image_urls_v2":{"full":"","thumbnail":"","medium":"","medium_large":"","large":"","1536x1536":"","2048x2048":"","post-thumbnail":"","gform-image-choice-sm":"","gform-image-choice-md":"","gform-image-choice-lg":""},"post_excerpt_stackable_v2":"<p>There are a few ways that you can generate lists of pages (posts) in 11ty. This post looks at how to based on tags, custom front-matter variables, and listing all of the files in a folder. You can follow along with this by using the collections-example repository. Click on the link for the repo: https:\/\/github.com\/profstein\/collections-exampleClick Use this templateGo through the steps to create your version of the repositoryClone that new repository to VS Code. List all pages with a tag By default 11ty creates a collection for each tag on a page. You can use this to tell it to&hellip;<\/p>\n","category_list_v2":"<a href=\"https:\/\/openlab.bmcc.cuny.edu\/mmp-350-fall-21\/category\/topics\/jamstack\/eleventy\/\" rel=\"category tag\">Eleventy<\/a>, <a href=\"https:\/\/openlab.bmcc.cuny.edu\/mmp-350-fall-21\/category\/projects\/eleventy-site\/\" rel=\"category tag\">Eleventy Site<\/a>, <a href=\"https:\/\/openlab.bmcc.cuny.edu\/mmp-350-fall-21\/category\/projects\/final\/\" rel=\"category tag\">Final<\/a>","author_info_v2":{"name":"Christopher Stein","url":"https:\/\/openlab.bmcc.cuny.edu\/mmp-350-fall-21\/author\/cstein\/"},"comments_num_v2":"1 comment","uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"post-thumbnail":false,"gform-image-choice-sm":false,"gform-image-choice-md":false,"gform-image-choice-lg":false},"uagb_author_info":{"display_name":"Christopher Stein","author_link":"https:\/\/openlab.bmcc.cuny.edu\/mmp-350-fall-21\/author\/cstein\/"},"uagb_comment_info":1,"uagb_excerpt":"There are a few ways that you can generate lists of pages (posts) in 11ty. This post looks at how to based on tags, custom front-matter variables, and listing all of the files in a folder. You can follow along with this by using the collections-example repository. Click on the link for the repo: https:\/\/github.com\/profstein\/collections-example&hellip;&hellip;","_links":{"self":[{"href":"https:\/\/openlab.bmcc.cuny.edu\/mmp-350-fall-21\/wp-json\/wp\/v2\/posts\/2258","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/openlab.bmcc.cuny.edu\/mmp-350-fall-21\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/openlab.bmcc.cuny.edu\/mmp-350-fall-21\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/openlab.bmcc.cuny.edu\/mmp-350-fall-21\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/openlab.bmcc.cuny.edu\/mmp-350-fall-21\/wp-json\/wp\/v2\/comments?post=2258"}],"version-history":[{"count":5,"href":"https:\/\/openlab.bmcc.cuny.edu\/mmp-350-fall-21\/wp-json\/wp\/v2\/posts\/2258\/revisions"}],"predecessor-version":[{"id":2265,"href":"https:\/\/openlab.bmcc.cuny.edu\/mmp-350-fall-21\/wp-json\/wp\/v2\/posts\/2258\/revisions\/2265"}],"wp:attachment":[{"href":"https:\/\/openlab.bmcc.cuny.edu\/mmp-350-fall-21\/wp-json\/wp\/v2\/media?parent=2258"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/openlab.bmcc.cuny.edu\/mmp-350-fall-21\/wp-json\/wp\/v2\/categories?post=2258"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/openlab.bmcc.cuny.edu\/mmp-350-fall-21\/wp-json\/wp\/v2\/tags?post=2258"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/openlab.bmcc.cuny.edu\/mmp-350-fall-21\/wp-json\/wp\/v2\/coauthors?post=2258"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}