Skip to content

KyleMit/jsmarathon-eleventy

Repository files navigation

Eleventy Project for JS Marathon

Brought to you by This Dot Labs

Check out our live eleventy website

Video Tutorials

Links

Part 1

Quickstart

# setup
npm init -y
git init
npx gitignore node
npm install @11ty/eleventy

# run
eleventy --serve

Create Some Content

  • about.njk
  • contact.md
  • index.md

Create a Layout

  • Create _includes/defaultLayout.njk

  • Inject {{content | safe}}

  • Add frontmatter to point to layout

    ---
    layout: defaultLayout.njk
    ---

Create Eleventy Config

Create / Consume Properties

  • Add title property to frontmatter
  • Consume {{title}} elsewhere (in layout)

Push to Netlify

  • Commit changes
  • Push to Github
  • New Site From Git

Templating

Add Global Data

Part 2

The Cat API

Data Stage 1 - Hard Coded

Data Stage 2 - Live Pull

Data Stage 3 - Pull + Cache