diff --git a/public/wp-content/uploads/2025/06/cropped-Screenshot-2025-06-15-at-1.59.23_PM-300x159-removebg-preview-180x180.png b/public/wp-content/uploads/2025/06/cropped-Screenshot-2025-06-15-at-1.59.23_PM-300x159-removebg-preview-180x180.png new file mode 100644 index 0000000..906e6a1 Binary files /dev/null and b/public/wp-content/uploads/2025/06/cropped-Screenshot-2025-06-15-at-1.59.23_PM-300x159-removebg-preview-180x180.png differ diff --git a/public/wp-content/uploads/2025/06/cropped-Screenshot-2025-06-15-at-1.59.23_PM-300x159-removebg-preview-192x192.png b/public/wp-content/uploads/2025/06/cropped-Screenshot-2025-06-15-at-1.59.23_PM-300x159-removebg-preview-192x192.png new file mode 100644 index 0000000..c459b8d Binary files /dev/null and b/public/wp-content/uploads/2025/06/cropped-Screenshot-2025-06-15-at-1.59.23_PM-300x159-removebg-preview-192x192.png differ diff --git a/public/wp-content/uploads/2025/06/cropped-Screenshot-2025-06-15-at-1.59.23_PM-300x159-removebg-preview-32x32.png b/public/wp-content/uploads/2025/06/cropped-Screenshot-2025-06-15-at-1.59.23_PM-300x159-removebg-preview-32x32.png new file mode 100644 index 0000000..6dde89c Binary files /dev/null and b/public/wp-content/uploads/2025/06/cropped-Screenshot-2025-06-15-at-1.59.23_PM-300x159-removebg-preview-32x32.png differ diff --git a/public/wp-content/uploads/2025/06/d2b9123d-49a5-4e9e-b39d-b2ab74381797-150x150.jpeg b/public/wp-content/uploads/2025/06/d2b9123d-49a5-4e9e-b39d-b2ab74381797-150x150.jpeg new file mode 100644 index 0000000..aefd96b Binary files /dev/null and b/public/wp-content/uploads/2025/06/d2b9123d-49a5-4e9e-b39d-b2ab74381797-150x150.jpeg differ diff --git a/public/wp-content/uploads/2025/06/fb1ff635-d713-4dff-8262-995ea063c13d-150x150.jpeg b/public/wp-content/uploads/2025/06/fb1ff635-d713-4dff-8262-995ea063c13d-150x150.jpeg new file mode 100644 index 0000000..dfbee18 Binary files /dev/null and b/public/wp-content/uploads/2025/06/fb1ff635-d713-4dff-8262-995ea063c13d-150x150.jpeg differ diff --git a/public/wp-content/uploads/2025/06/image-removebg-preview.png b/public/wp-content/uploads/2025/06/image-removebg-preview.png new file mode 100644 index 0000000..5a85d50 Binary files /dev/null and b/public/wp-content/uploads/2025/06/image-removebg-preview.png differ diff --git a/public/wp-content/uploads/2025/06/pexels-photo-1236421-1236421-220x300.jpg b/public/wp-content/uploads/2025/06/pexels-photo-1236421-1236421-220x300.jpg new file mode 100644 index 0000000..b6c083b Binary files /dev/null and b/public/wp-content/uploads/2025/06/pexels-photo-1236421-1236421-220x300.jpg differ diff --git a/public/wp-content/uploads/2025/06/pexels-photo-1236421-1236421-752x1024.jpg b/public/wp-content/uploads/2025/06/pexels-photo-1236421-1236421-752x1024.jpg new file mode 100644 index 0000000..04a7853 Binary files /dev/null and b/public/wp-content/uploads/2025/06/pexels-photo-1236421-1236421-752x1024.jpg differ diff --git a/public/wp-content/uploads/2025/06/pexels-photo-1236421-1236421-scaled.jpg b/public/wp-content/uploads/2025/06/pexels-photo-1236421-1236421-scaled.jpg new file mode 100644 index 0000000..f089819 Binary files /dev/null and b/public/wp-content/uploads/2025/06/pexels-photo-1236421-1236421-scaled.jpg differ diff --git a/public/wp-content/uploads/2025/06/pixlr-image-generator-6852721300106a49ef49034b-300x300.jpg b/public/wp-content/uploads/2025/06/pixlr-image-generator-6852721300106a49ef49034b-300x300.jpg new file mode 100644 index 0000000..3f806f8 Binary files /dev/null and b/public/wp-content/uploads/2025/06/pixlr-image-generator-6852721300106a49ef49034b-300x300.jpg differ diff --git a/public/wp-content/uploads/2025/07/RPL.png b/public/wp-content/uploads/2025/07/RPL.png new file mode 100644 index 0000000..37d471d Binary files /dev/null and b/public/wp-content/uploads/2025/07/RPL.png differ diff --git a/public/wp-content/uploads/2025/07/mentor-3512369_1280.jpg b/public/wp-content/uploads/2025/07/mentor-3512369_1280.jpg new file mode 100644 index 0000000..53f8a0b Binary files /dev/null and b/public/wp-content/uploads/2025/07/mentor-3512369_1280.jpg differ diff --git a/public/wp-content/uploads/elementor/thumbs/Migration-future-australia-r7jqyjculu61ydzz94zwmky24oekes2taopx24hd3c.png b/public/wp-content/uploads/elementor/thumbs/Migration-future-australia-r7jqyjculu61ydzz94zwmky24oekes2taopx24hd3c.png new file mode 100644 index 0000000..10dada7 Binary files /dev/null and b/public/wp-content/uploads/elementor/thumbs/Migration-future-australia-r7jqyjculu61ydzz94zwmky24oekes2taopx24hd3c.png differ diff --git a/public/wp-content/uploads/elementor/thumbs/PR-Australia-r7jqpvafkuauvul9ve3rmrp0wr4pf9nxfs4pq9c2h4.png b/public/wp-content/uploads/elementor/thumbs/PR-Australia-r7jqpvafkuauvul9ve3rmrp0wr4pf9nxfs4pq9c2h4.png new file mode 100644 index 0000000..71a6c0f Binary files /dev/null and b/public/wp-content/uploads/elementor/thumbs/PR-Australia-r7jqpvafkuauvul9ve3rmrp0wr4pf9nxfs4pq9c2h4.png differ diff --git a/public/wp-content/uploads/elementor/thumbs/RPL-r8449cmkno5if890q65m2xlkoc0jqxjasoh58up5zc.png b/public/wp-content/uploads/elementor/thumbs/RPL-r8449cmkno5if890q65m2xlkoc0jqxjasoh58up5zc.png new file mode 100644 index 0000000..e4ccf5e Binary files /dev/null and b/public/wp-content/uploads/elementor/thumbs/RPL-r8449cmkno5if890q65m2xlkoc0jqxjasoh58up5zc.png differ diff --git a/public/wp-content/uploads/elementor/thumbs/career-bijendra-sir-r7juads0rjdgs6e5oqchau1e6jow26qbi4k3ky7bwy.jpg b/public/wp-content/uploads/elementor/thumbs/career-bijendra-sir-r7juads0rjdgs6e5oqchau1e6jow26qbi4k3ky7bwy.jpg new file mode 100644 index 0000000..8a55dfb Binary files /dev/null and b/public/wp-content/uploads/elementor/thumbs/career-bijendra-sir-r7juads0rjdgs6e5oqchau1e6jow26qbi4k3ky7bwy.jpg differ diff --git a/public/wp-content/uploads/elementor/thumbs/compressed_fraud_image_under_2mb-r7jridq6vxbz216bdpsd9kodliliwqutcwixsf25qg.jpg b/public/wp-content/uploads/elementor/thumbs/compressed_fraud_image_under_2mb-r7jridq6vxbz216bdpsd9kodliliwqutcwixsf25qg.jpg new file mode 100644 index 0000000..4c7b6e2 Binary files /dev/null and b/public/wp-content/uploads/elementor/thumbs/compressed_fraud_image_under_2mb-r7jridq6vxbz216bdpsd9kodliliwqutcwixsf25qg.jpg differ diff --git a/public/wp-content/uploads/elementor/thumbs/mentor-3512369_1280-r843m5xw2sew1hxg45cwks8966alvphnlx5z352rgo.jpg b/public/wp-content/uploads/elementor/thumbs/mentor-3512369_1280-r843m5xw2sew1hxg45cwks8966alvphnlx5z352rgo.jpg new file mode 100644 index 0000000..ff2103d Binary files /dev/null and b/public/wp-content/uploads/elementor/thumbs/mentor-3512369_1280-r843m5xw2sew1hxg45cwks8966alvphnlx5z352rgo.jpg differ diff --git a/public/wp-content/uploads/elementor/thumbs/pexels-photo-7163956-7163956-scaled-r7fvhsbi458lc1m0wz89g7f03sdjg52qxlmabibvpc.jpg b/public/wp-content/uploads/elementor/thumbs/pexels-photo-7163956-7163956-scaled-r7fvhsbi458lc1m0wz89g7f03sdjg52qxlmabibvpc.jpg new file mode 100644 index 0000000..7e4d0f5 Binary files /dev/null and b/public/wp-content/uploads/elementor/thumbs/pexels-photo-7163956-7163956-scaled-r7fvhsbi458lc1m0wz89g7f03sdjg52qxlmabibvpc.jpg differ diff --git a/src/index.js b/src/index.js index 45e7911..e5653c4 100644 --- a/src/index.js +++ b/src/index.js @@ -53,10 +53,10 @@ app.use('*', async (c, next) => { // ── HOME ──────────────────────────────────────────────────────────────────── app.get('/', async c => { - const ann = await c.env.DB.prepare( - `SELECT * FROM announcements WHERE active=1 AND (expires_at IS NULL OR expires_at > datetime('now')) ORDER BY created_at DESC LIMIT 1` - ).first().catch(() => null); - return c.html(homePage(c.get('user'), ann)); + const { results: anns } = await c.env.DB.prepare( + `SELECT * FROM announcements WHERE active=1 AND (expires_at IS NULL OR expires_at > datetime('now')) ORDER BY created_at DESC LIMIT 10` + ).all().catch(() => ({ results: [] })); + return c.html(homePage(c.get('user'), anns || [])); }); // ── REGISTER ──────────────────────────────────────────────────────────────── diff --git a/src/templates.js b/src/templates.js index a500019..7c7f490 100644 --- a/src/templates.js +++ b/src/templates.js @@ -158,34 +158,96 @@ const BASE_URL = 'https://careersgateway.com.au'; const DEFAULT_IMAGE = 'https://careersgateway.com.au/wp-content/uploads/2025/06/pexels-photo-1236421-1236421-scaled.jpg'; const SITE_NAME = 'Careers Gateway Australia'; -function announcementBanner(ann) { - if (!ann) return ''; - return ` -
-
- 🎉 -
- ${esc(ann.title)} - ${esc(ann.body)} +function announcementBanner(anns) { + if (!anns || !anns.length) return ''; + const slides = anns.map((a, i) => ` +
+ 🎉 +
+ ${esc(a.title)} + ${esc(a.body)}
- ${ann.cta_label && ann.cta_url ? `${esc(ann.cta_label)}` : ''} - + ${a.cta_label && a.cta_url ? `${esc(a.cta_label)}` : ''} + +
`).join(''); + + const dots = anns.length > 1 ? ` +
+ ${anns.map((a, i) => ``).join('')} +
` : ''; + + const navButtons = anns.length > 1 ? ` + + ` : ''; + + return ` +
+
+
+ ${navButtons} +
${slides}
+
+ ${dots}
`; } -function layout(title, body, user = null, extraHead = '', meta = {}, announcement = null) { +function layout(title, body, user = null, extraHead = '', meta = {}, announcements = []) { const fullTitle = `${title} — ${SITE_NAME}`; const description = meta.description || 'Your trusted partner for education, migration, recruitment, and career services in Australia. Search CRICOS courses, get expert visa advice, and more.'; const image = meta.image || DEFAULT_IMAGE; @@ -249,7 +311,7 @@ ${extraHead}
-${announcementBanner(announcement)} +${announcementBanner(announcements)} ${body} /g,'>').replace(/"/g,'"'); } -function homePage(user, announcement = null) { +function homePage(user, announcements = []) { return layout('Your Gateway to Success', `
@@ -526,7 +588,7 @@ function homePage(user, announcement = null) {
- `, user, '', { url: '/', description: 'Careers Gateway Australia — your trusted partner for education, migration, recruitment, RPL, and visa services. Search 26,000+ CRICOS courses and book a free consultation.', image: 'https://careersgateway.com.au/wp-content/uploads/2025/06/pexels-photo-1236421-1236421-scaled.jpg' }, announcement); + `, user, '', { url: '/', description: 'Careers Gateway Australia — your trusted partner for education, migration, recruitment, RPL, and visa services. Search 26,000+ CRICOS courses and book a free consultation.', image: 'https://careersgateway.com.au/wp-content/uploads/2025/06/pexels-photo-1236421-1236421-scaled.jpg' }, announcements); } function coursesPage(user, results, params, fromCache, error, savedCode = '') { diff --git a/wrangler.toml b/wrangler.toml index db32132..20037b2 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -3,6 +3,10 @@ main = "src/index.js" compatibility_date = "2024-11-01" compatibility_flags = ["nodejs_compat"] +[assets] +directory = "./public" +binding = "ASSETS" + [triggers] # Run daily at 9am AEST (23:00 UTC previous day) crons = ["0 23 * * *"]