Tulip Theme Docs

Data Collections

To fill the blogs, or article in every categories. Eleventy construct collections of contents. Lets see the example article inside the collection, where

Inside content folder, this is where we fill the contents inside the templates. As you can see

Syntax Markdown
---
tags: blog
title: Hot Take—Social Media is Considered Harmful
---

This will place this mypost.md into the post collection with all other articles of content that same tag post.

In our Tulip Theme, we have two different collections journal and blog.

./src
└── content
    ├── journal
    ├── blog

For the blog we just put tags blog in every markdown article inside our folder link blog.

Same with journal where the markdowns are inside folder journal.

To list the collections of blog let's say, use the collections object inside our nunjucks file index.njk

Syntax Nunjucks
<ul>
{%- for article in collections.blog -%}
  <li>{{ article.data.title }}</li>
{%- endfor -%}
</ul>

Content structure

content
└── about
└── blog
└── docs
└── help
└── journal
└── landing-dark
└── landing-light
└── portfolio
└── preview
└── terms
└── 404.md
└── index.njk
  1. about: About page
  2. blog: Blog page with article contents
  3. help: Help Page
  4. journal: Journal Page
  5. landing-dark: Landing page with dark background
  6. landing-light: Landing page with light background
  7. portfolio: Portfolio page with project contents
  8. preview: Showcase preview page
  9. terms: Sample terms service page
  10. 404.md: page not found
  11. index.njk: Home page

Coming soon for more layouts