This is a photo gallery demo project for Netlify Large Media made with photos from Unsplash and built with Hugo.
This project has two branches:
- master: A photo gallery that does not have Netlify Large Media enabled yet. You can follow the README instructions to deploy this with your Netlify account and start using Large Media yourself.
- large-media-sample: A copy of the photo gallery, with Netlify Large Media enabled. You can go to the files in the static/images folder to see how large media assets are managed with Git. This branch is used to deploy the demo site, https://netlify-photo-gallery.netlify.com/.
-
Deploy to Netlify with "Deploy to Netlify" button. This will create a new Netlify site and copy the repository to your GitHub account.
-
Find your newly created repository on GitHub and clone it to your local computer with
git clone
. -
Follow the instructions for Enabling Netlify Large Media to enable Large Media for the newly deployed site.
-
Specify which files to track using the
git lfs track
command. The following example tracksjpg
andpng
files. Tracking them is required for this photo gallery, so you can start tracking them:- To track jpg files:
git lfs track "*.jpg"
. - To track png files:
git lfs track "*.png"
.
- To track jpg files:
-
Find out more about how to configure file tracking in the documentation.
-
After making sure you
git add
andgit commit
your changes, rungit push origin master
to push your changes to GitHub. It'll be automatically deployed to Netlify using Large Media. -
When your deploy is done, try running transformations with the image files. For example, you can tweak the layout file at
layouts/photos_s/list.html
.
This site is built with Hugo, and works with Hugo version 0.42 and above. Run hugo version
in your teminal to see if you have Hugo installed. If it's not installed, or you have a version below 0.42, follow the Hugo documentation to install the current version.
When Hugo is installed, cd
into this repository and run:
hugo server
After building the site, the terminal will output the URL for the local server. It will hot reload when you save changes.
- Add some images in
static/images
folder, and the info todata/photos.json
.- You can check which files/suffix are currently tracked by checking
.gitattributes
file.
- You can check which files/suffix are currently tracked by checking
- Once it's done, you can
git add
,git commit
, thengit push
to push them to Netlify Large Media! - By running
git lfs ls-files
, you can double check which files are managed by Large Media.
With Netlify Large Media, you can do cool things like image transformation. You can visit the documentation for more detail.