Photon is a fast and straightforward way to publish your photos with 11ty. The process is easy while the website is blazing fast and comes without any tracking or other junk. All you need is a bit of Git knowledge and a place to host your 100% static website.
A live example, running the main branch of this repository, is available on photon-11ty.netlify.com.
You can get started very quickly by deploying Photon - 11ty
to Netlify. Press the Deploy to Netlify
button and you are up and running.
- Pre-optimized image resolutions based on the need of your visitor.
- Improved lazy loading of your images
- Every photo has its own URL
- Basic open graph support
- Support for light and dark themes (based on the settings of your visitor)
- Keyboard shortcuts
- RSS feed
- Option for adding other social media references
- Support for Netlify deploy button
- Fork this repository
- Clear everything inside
/uploads
&/posts
- Add a high-resolution version of your photos inside the
/uploads
directory. Keep in mind, you don't do any image optimization beforehand. Photon will resize and optimize the images during its build process. - Deploy the version you've forked to Netlify or any other hosting provider
- Be happy!
Photon has two simple rules:
- You need to put all images inside the
/uploads
directory. - To show these images on your website, you need to create a markdown file inside the
/posts
directory. This markdown file handles everything from referencing the image you want to show to handling additional metadata for this specific post.
A post looks like this:
---
layout: layouts/photo.njk
date: 2020-03-01
caption: Test 1
imageSource: andy-feliciotti-YNkjiFhMtck-unsplash.jpg
imageAlt: This is the alt text
---
layout
: Don't change this! This is the template your photo will be render in.date
: This is the published date of this post. You can set it to everything you want, but please stick to the formatting (YEAR-MONTH-DAY)caption
: A simple caption for your imageimageSource
: Reference the file name of the photo you want to reference. Photo looks inside/uploads
to find it.imageAlt
: Add a simple alternative text describing the image. This can help people who depend on assistive technologies like screen reader.
language
: Add the HTML language code to tell the primary language you are using on your site to the browser. Defaulten
title
: Give your site a proper titleurl
: Enter the URL your site is going to live onslogan
: Give your site a quick summary. This will be available on your homepage.favicon
: Customise your favicon with an emojiauthor.name
: Add your name hereauthor.email
: Add your email address here, so people can contact you if you wantseo.title
: Add a SEO title here. Used on the homepage.seo.description
: Add a SEO description here. Used on the homepage.social.twitter
: If you want to link to your twitter account, add it here. A reference will be displayed in the homepage.social.instagram
: If you want to link to your Instagram account, add it here. A reference will be displayed in the homepage.
- iOS Shortcut for optimized uploading from your iPhone
- Webmentions (Not decided yet)
- Web sharing API integration (Not decided yet)
- PWA/Service worker support (Not decided yet)
- Offline support (Not decided yet)
- If you have an idea, please add it to the open issues
This project is based on the fantastic 11ty. It was a little inspired by the awesome Photo Stream project made by Tim Van Damme. The pictures displayed on the demo version are all coming from Unsplash.