Quick and dirty image gallery using Photoswipe, yall, sharp, and ejs.
npm init -y
npm install
npx webpack
node make-template.js --imageDir /path/to/images > images.htmlNginx example:
server {
listen 0.0.0.0:443 ssl;
include /etc/nginx/ssl.conf;
http2 on;
root /var/www/tsgal;
location / {
try_files $uri $uri/ =404;
}
}
-
Image lazy loading is baked into browsers by default these days:
<img loading="lazy" />