| 1 | --- |
| 2 | import '../styles/global.css'; |
| 3 | const base = import.meta.env.BASE_URL.replace(/\/$/, ''); |
| 4 | const { title, description, titleEn, titleZh, canonical: canonicalOverride, noindex = false } = Astro.props; |
| 5 | const canonical = canonicalOverride ?? new URL(Astro.url.pathname, Astro.site).href; |
| 6 | const ogImage = new URL(`${base}/og.png`, Astro.site).href; |
| 7 | --- |
| 8 | <!doctype html> |
| 9 | <html lang="en"> |
| 10 | <head> |
| 11 | <meta charset="utf-8" /> |
| 12 | <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| 13 | <title>{title}</title> |
| 14 | <meta name="description" content={description} /> |
| 15 | {noindex && <meta name="robots" content="noindex, nofollow" />} |
| 16 | <link rel="canonical" href={canonical} /> |
| 17 | <link rel="icon" href={`${base}/favicon.svg`} type="image/svg+xml" /> |
| 18 | <link rel="sitemap" href={`${base}/sitemap-index.xml`} /> |
| 19 | <meta name="theme-color" content="#ffffff" /> |
| 20 | <script is:inline> |
| 21 | (function(){try{var p=localStorage.getItem("reasonix-theme")||"system";var d=p==="dark"||(p==="system"&&window.matchMedia("(prefers-color-scheme: dark)").matches);document.documentElement.dataset.theme=d?"dark":"light";var m=document.querySelector('meta[name="theme-color"]');if(m)m.content=d?"#1f232b":"#ffffff";}catch(e){}})(); |
| 22 | </script> |
| 23 | <meta property="og:type" content="website" /> |
| 24 | <meta property="og:site_name" content="Reasonix" /> |
| 25 | <meta property="og:title" content={title} /> |
| 26 | <meta property="og:description" content={description} /> |
| 27 | <meta property="og:url" content={canonical} /> |
| 28 | <meta property="og:image" content={ogImage} /> |
| 29 | <meta property="og:image:width" content="1200" /> |
| 30 | <meta property="og:image:height" content="630" /> |
| 31 | <meta property="og:image:alt" content="Reasonix — a coding agent you can leave running" /> |
| 32 | <meta property="og:locale" content="en_US" /> |
| 33 | <meta property="og:locale:alternate" content="zh_CN" /> |
| 34 | <meta name="twitter:card" content="summary_large_image" /> |
| 35 | <meta name="twitter:title" content={title} /> |
| 36 | <meta name="twitter:description" content={description} /> |
| 37 | <meta name="twitter:image" content={ogImage} /> |
| 38 | <slot name="head" /> |
| 39 | </head> |
| 40 | <body data-motion="rich" data-lang="en" data-title-en={titleEn ?? title} data-title-zh={titleZh ?? title}> |
| 41 | <slot /> |
| 42 | <script> |
| 43 | import '../scripts/site.js'; |
| 44 | import '../scripts/fx.js'; |
| 45 | </script> |
| 46 | </body> |
| 47 | </html> |
| 48 |