Skip to content

Commit 22b33f4

Browse files
author
Jacob Knapp
committed
fix localized changes
1 parent 5f91824 commit 22b33f4

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

config/photos/.gitkeep

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Placeholder to ensure the photos directory exists in the repo.
2+
# Place .jpg/.jpeg/.png/.webp/.avif files here to be served at /photos/ and listed by /api/photos.

index.html

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,19 @@
7171
box-shadow: 0 20px 60px rgba(0,0,0,.35);
7272
text-align: center; /* Center names, date, and location */
7373
}
74-
.monogram { display:block; width:max-content; margin-left:0; margin-right:auto; padding:.25rem 1rem; border-radius:999px; border:1px solid rgba(255,255,255,.25);
75-
background: radial-gradient(ellipse at top left, var(--accent-1) 0%, transparent 70%), radial-gradient(ellipse at bottom right, var(--accent-2) 0%, transparent 60%);
76-
font-family: "Playfair Display", serif; letter-spacing: 1px; opacity:.95; }
74+
.monogram {
75+
display: inline-block;
76+
/* center within the header (parent has text-align:center) */
77+
margin: 0 0 .25rem;
78+
/* remove pill/button styling */
79+
padding: 0;
80+
border: none;
81+
border-radius: 0;
82+
background: transparent;
83+
font-family: "Playfair Display", serif;
84+
letter-spacing: 1px;
85+
opacity:.95;
86+
}
7787
h1.names { margin: .35rem 0 .25rem; font-family: "Great Vibes", cursive; font-size: clamp(2.2rem, 8vw, 4.2rem); font-weight: 400; letter-spacing:.4px; text-shadow: 0 2px 18px rgba(0,0,0,.45); }
7888
.tagline { font-size: clamp(1rem, 2.6vw, 1.2rem); opacity:.96 }
7989
.date { display:inline-block; margin-top:.4rem; font-weight:600; letter-spacing:.8px; background: linear-gradient(90deg, var(--accent-3), var(--accent-1)); -webkit-background-clip: text; background-clip: text; color: transparent; }

server.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ app.use((req, res, next) => {
4040

4141
app.use(express.static(ROOT, { extensions: ['html'], etag: true, lastModified: true }));
4242
app.use('/config', express.static(CONFIG_DIR, { etag: true, lastModified: true }));
43+
// Serve photos from config/photos under a stable /photos path used by the client
44+
app.use('/photos', express.static(PHOTO_DIR, { etag: true, lastModified: true }));
4345
// Serve favicons and related assets
4446
app.use('/favicon', express.static(FAVICON_DIR, { etag: true, lastModified: true }));
4547
app.get('/favicon.ico', (_req, res) => res.sendFile(path.join(FAVICON_DIR, 'wedding_bell_favicon.ico')));
@@ -58,6 +60,11 @@ app.get('/api/photos', async (_req, res) => {
5860
res.set('Cache-Control', 'no-store');
5961
res.json({ files });
6062
} catch (e) {
63+
// If the photos directory doesn't exist yet, treat as empty set
64+
if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) {
65+
warn('Photos directory not found; returning empty list');
66+
return res.json({ files: [] });
67+
}
6168
error('Failed to list photos:', e && e.stack ? e.stack : e);
6269
res.status(500).json({ error: e.message });
6370
}

0 commit comments

Comments
 (0)