Git Product home page Git Product logo

eleventy-stock-gallery's Introduction

eleventy-stock-gallery

A starter repository intended to help you build a photo gallery website using the Eleventy static site generator.

Live Demo

Getting started

1. Clone this Repository

git clone https://github.com/tannerdolby/eleventy-stock-gallery.git

2. Navigate to project folder

cd eleventy-stock-gallery

3. Install dependencies

npm install

4. Add your own photos or skip to step 5!

Edit _data/gallery.json to include the appropiate image metadata for new images added.

Serving responsive images

Use the sharpImages function inside .eleventy.js to create three resized versions of the original image.

sharpImages("./images/road-fog.jpg");
# Output to /images/ directory
road-fog-large.jpg
road-fog-med.jpg
road-fog-small.jpg

More options for image optimization

  • Squoosh - Make images smaller using best-in-class codecs, right in the browser.
  • eleventy-img - Utility to perform build-time image transformations.

5. Run Eleventy!

To build your _site output

npm run build

To build your _site and serve it locally

npm run --serve

To run in debug mode

npm run debug

Sources of data

  • Global Data Files:
    • _data/gallery.json - Holds all image metadata
    • _data/site.json - Some site data
    • _data/speedlify.js - Speedlify API data files (static API with cached speedlify instance generated JSON)

Project notes

  • .eleventy.js is currently configured to use manual passthrough file copy to include the following directories in the _site output.

    • /images/
    • /css/
    • /favicon_data/
    • /js/
  • /_includes/ houses the two layouts for this project.

    • _includes/layouts/base.njk: home page template

    • _includes/layouts/feature.njk: featured image page template

eleventy-stock-gallery's People

Contributors

tannerdolby avatar nhoizey avatar dependabot[bot] avatar

Watchers

James Cloos 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.