📘
Lab Website Template docs
  • Introduction
    • Overview
    • Is this right for me?
    • Gallery
    • Support
  • Getting Started
    • Set up your site
    • Set up your URL
    • Tidy up your repo
    • Change your site
    • Preview your site
  • Basics
    • Repo structure
    • Configure your site
    • Edit pages
    • Write basic content
    • Use your logo
    • Customize your theme
    • Team members
    • Blog posts
    • Citations
    • Components
      • Section
      • Figure
      • Button
      • Icon
      • Feature
      • List
      • Citation
      • Card
      • Portrait
      • Post Excerpt
      • Alert
      • Tags
      • Float
      • Grid
      • Cols
      • Search
      • Site Search
  • Advanced
    • Update your template
    • Embeds
    • Math, diagrams, videos, etc.
    • Analytics
    • Data and collections
    • Jekyll plugins
    • Custom components
    • Background knowledge
Powered by GitBook
On this page
  • Data
  • Collections
  1. Advanced

Data and collections

PreviousAnalyticsNextJekyll plugins

Last updated 8 months ago

Jekyll provides two main ways to create and maintain large lists/sets of items: data and collections.

The template comes with , but if you need to create more/different ones, here's how.

This page just explains how to make these lists. To actually display them on your site, use the .

Data

If you want to have a large set of structured or nested items in a single file, use a .

Put a .yaml file in the /_data folder with any name, and fill it with data. The structure of the data can be arbitrary.

Example:

/_data/some-list.yaml
# some item
- title: Some name
  tags:
    - tag A
    - tag B
  description: Some description

# another item
...

Collections

Example:

/_some-list/some-file.md
---
title: Some name
tags:
  - tag A
  - tag B
description: Some description
---

Some Markdown content
/_some-list/another-file.md
---
title: Another name
---

Some Markdown content

If you want to have a large set of items in separate files that can also generate their own separate pages on your site, use .

Put .md files in a folder prefixed with a _, and fill their with data. To generate a separate page for each item in the collection, set output: true in your config file .

collections
list component
data file
as described here
front matters
a few placeholder data lists for common needs