|
| 1 | +--- |
| 2 | +import { loadNodes } from '../../lib/nodes'; |
| 3 | +import type { Node } from '../../lib/nodes'; |
| 4 | +import ogImage from '../../images/og-image.png'; |
| 5 | +
|
| 6 | +export async function getStaticPaths() { |
| 7 | + const nodes = await loadNodes(); |
| 8 | + return nodes.map((node) => ({ params: { id: node.id }, props: { node } })); |
| 9 | +} |
| 10 | +
|
| 11 | +interface Props { node: Node; } |
| 12 | +const { node } = Astro.props; |
| 13 | +
|
| 14 | +const siteUrl = Astro.site ? Astro.site.href.replace(/\/$/, '') : ''; |
| 15 | +const base = import.meta.env.BASE_URL.replace(/\/$/, ''); |
| 16 | +const ogImageUrl = `${siteUrl}${ogImage.src}`; |
| 17 | +const spaUrl = `${siteUrl}${base}/?event=${node.id}`; |
| 18 | +
|
| 19 | +const title = `${node.event_name} — Processing Community Day 2026`; |
| 20 | +const description = node.event_short_description; |
| 21 | +--- |
| 22 | + |
| 23 | +<!DOCTYPE html> |
| 24 | +<html lang="en"> |
| 25 | + <head> |
| 26 | + <meta charset="utf-8" /> |
| 27 | + <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| 28 | + <title>{title}</title> |
| 29 | + <meta name="description" content={description} /> |
| 30 | + <meta name="robots" content="noindex" /> |
| 31 | + <meta http-equiv="refresh" content={`0;url=${spaUrl}`} /> |
| 32 | + <link rel="canonical" href={spaUrl} /> |
| 33 | + <meta property="og:title" content={title} /> |
| 34 | + <meta property="og:description" content={description} /> |
| 35 | + <meta property="og:type" content="website" /> |
| 36 | + <meta property="og:url" content={spaUrl} /> |
| 37 | + <meta property="og:image" content={ogImageUrl} /> |
| 38 | + <meta property="og:image:width" content="1200" /> |
| 39 | + <meta property="og:image:height" content="630" /> |
| 40 | + <meta name="twitter:card" content="summary_large_image" /> |
| 41 | + <meta name="twitter:title" content={title} /> |
| 42 | + <meta name="twitter:description" content={description} /> |
| 43 | + <meta name="twitter:image" content={ogImageUrl} /> |
| 44 | + </head> |
| 45 | + <body> |
| 46 | + <script is:inline define:vars={{ spaUrl }}> |
| 47 | + window.location.replace(spaUrl); |
| 48 | + </script> |
| 49 | + <a href={spaUrl}>{`View ${node.event_name} on the PCD 2026 map`}</a> |
| 50 | + </body> |
| 51 | +</html> |
0 commit comments