Repository navigation
Expand file tree
/
Copy pathMenu.astro
More file actions
43 lines (43 loc) · 4.04 KB
/
Copy pathMenu.astro
File metadata and controls
43 lines (43 loc) · 4.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
import styles from '../styles.css?url';
import utilities from '../../.generated/tailwind.css?url';
import header from '../design/header.html?raw';
import footer from '../design/footer.html?raw';
import markMaster from '../../branding/mark.svg?raw';
const mark=markMaster.replace('width="142" height="156"','width="26" height="28" aria-hidden="true"');
import contact from '../../content/contact.json';
const {title,body,page,active,description,styles:pageStyles=[],scripts=[]}=Astro.props;
const current=active||(page==='library'||page==='compare'||page==='guide'?'library':page==='recommend'?'recommend':page==='rewrite'?'rewrite':page==='agents'?'agents':null);
const activeChrome=(markup)=>current?markup.replaceAll(`data-nav="${current}"`,`data-nav="${current}" aria-current="page"`):markup;
const route=Astro.url.pathname;
const canonical=new URL(route,'https://stack.menu').href;
const markdown=route==='/'?'/agent-content/index.md':'/agent-content'+route.replace(/\/$/,'')+'.md';
const siteDescription='Tools and guidance for choosing, building with or reconsidering an application stack using your own agent.';
const missing=title==='Page not found';
const website={'@type':'WebSite',name:'Stack Menu',url:'https://stack.menu/',description:siteDescription};
const schema=title==='Contact' ? {'@context':'https://schema.org','@graph':[website,contact,{'@type':'ContactPage',name:'Contact · Stack Menu',url:canonical,description,mainEntity:{'@id':contact['@id']}}]} : {'@context':'https://schema.org',...website};
---
<!doctype html><html lang="en"><head>
<meta charset="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>{title} · Stack Menu</title><meta name="description" content={description}/>
<meta name="robots" content={page==='utility' && title==='Page not found'?'noindex':'index,follow'}/>
<meta name="is-agentic-site-type" content="content"/>
{!missing && <link rel="canonical" href={canonical}/>}<link rel="icon" type="image/svg+xml" href="/favicon.svg"/><link rel="icon" type="image/svg+xml" href="/favicon-dark.svg" media="(prefers-color-scheme: dark)"/>
<link rel="stylesheet" href={utilities}/><link rel="stylesheet" href="/design/site.css"/><link rel="stylesheet" href="/design/stack-folders.css"/><link rel="stylesheet" href="/design/stack-guide.css"/><link rel="stylesheet" href={styles}/>{pageStyles.map(href=><link rel="stylesheet" href={href}/>)}{!missing && <link rel="alternate" type="text/markdown" href={markdown}/>}
<link rel="describedby" type="text/plain" href="/llms.txt"/><link rel="related" type="application/json" href="/selection-index.json"/>
<meta property="og:type" content="website"/><meta property="og:site_name" content="Stack Menu"/>
<meta property="og:title" content={title}/><meta property="og:description" content={description}/><meta property="og:url" content={canonical}/>
<meta property="og:image" content="https://stack.menu/share-card.png"/><meta property="og:image:width" content="1200"/><meta property="og:image:height" content="630"/><meta property="og:image:alt" content="Stack Menu: your agent’s guide to the right stack."/>
<meta property="og:image:type" content="image/png"/><meta name="twitter:card" content="summary_large_image"/><meta name="twitter:image" content="https://stack.menu/share-card.png"/><meta name="twitter:image:alt" content="Stack Menu: your agent’s guide to the right stack."/>
<script type="application/ld+json" set:html={JSON.stringify(schema).replace(/</g,'\\u003c')}/>
{!missing && <script is:inline src="/analytics.js" defer></script>}
</head><body data-page={page}>
<a class="skip" href="#main">Skip to content</a>
<Fragment set:html={activeChrome(header.replace('{{BRAND_MARK}}',mark))}/>
<Fragment set:html={body}/>
<Fragment set:html={activeChrome(footer.replace('{{BRAND_MARK}}',mark).replaceAll('{{TOOLS_EMAIL}}',contact.contactPoint[0].email))}/>
<script is:inline src="/design/site.js" defer></script>
<script is:inline src="/design/data.js" defer></script>
<script is:inline src="/design/stack-folders.js" defer></script>
{scripts.map(src=><script is:inline src={src} defer></script>)}
</body></html>