<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: sjjensen</title>
    <description>The latest articles on DEV Community by sjjensen (@sjjensen).</description>
    <link>https://dev.to/sjjensen</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F711466%2F65603871-51a0-42a8-9ea4-6113c59c39db.png</url>
      <title>DEV Community: sjjensen</title>
      <link>https://dev.to/sjjensen</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sjjensen"/>
    <language>en</language>
    <item>
      <title>Eleventy: Create "View all posts in collection" link</title>
      <dc:creator>sjjensen</dc:creator>
      <pubDate>Thu, 23 Sep 2021 15:20:10 +0000</pubDate>
      <link>https://dev.to/sjjensen/eleventy-create-view-all-posts-in-collection-link-5cp2</link>
      <guid>https://dev.to/sjjensen/eleventy-create-view-all-posts-in-collection-link-5cp2</guid>
      <description>&lt;p&gt;I'm trying to build a site in Eleventy. The site has blog posts in two collections: A and B. When I'm reading a post in the collection A, I'd like to have a link after the post content that says, "View all A posts". And when I'm reading a post in collection B, I'd like to see a "View all B posts" link.&lt;/p&gt;

&lt;p&gt;The blog posts share the same _includes template post.html. In that template, I should be able to create an if statement in nunjucks that goes something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{% if post in collections.A %}&amp;lt;a href="/a"&amp;gt;View all A posts&amp;lt;/a&amp;gt;
{% elif post in collections.B %}&amp;lt;a href="/b"&amp;gt;View all B posts&amp;lt;/a&amp;gt;
{% endif %}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That code snippet doesn't work though. Any ideas?&lt;/p&gt;

</description>
      <category>help</category>
      <category>eleventy</category>
    </item>
  </channel>
</rss>
