Git Product home page Git Product logo

dleventy-cloud's Introduction

Eleventy Cloud Demo

Running Eleventy inside of a Netlify serverless function.

Run it

Locally

Requires netlify-cli for local testing, run npm install netlify-cli -g.

  1. Run npm start
  2. Navigate to the demo URL at http://localhost:8888/.netlify/functions/cloud?name=ZAAAACH

Production

  1. Deploy to Netlify
  2. There are no other steps 😅

How it works

  1. Use Eleventy as normal.
    • In this demo src is the input directory.
    • For this demo we include one Nunjucks template (./src/sample-nunjucks.njk), a Global Data file, an include template, and an Eleventy layout.
  2. ./netlify/functions/cloud.js is the code for running Eleventy in the serverless function.
    • This requires Eleventy 1.0. this demo is currently using a Canary build. Be careful here, Canary is considered unstable! Don’t use it in production.
    • ./netlify/functions/cloud.js compiles and renders ./src/sample-nunjucks.njk at request time and sets query parameters as Global Data in Eleventy’s cascade.
  3. bundle.sh automates bundling your build’s code into the serverless function for deployment. It puts files into your ./netlify/functions/cloud/ directory.

dleventy-cloud's People

Contributors

zachleat avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.