Skip to content

Commit f11ab84

Browse files
committed
Improve site readiness for web agents
1 parent 229d9b9 commit f11ab84

18 files changed

Lines changed: 616 additions & 68 deletions

‎index.html‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<meta name="author" content="Computational Biology at Berkeley" />
99
<meta name="theme-color" content="#FFFFFF" />
1010
<link rel="canonical" href="https://compbioatberkeley.github.io/" />
11+
<link rel="describedby" href="/llms.txt" type="text/markdown" />
1112
<link
1213
rel="icon"
1314
type="image/svg+xml"
@@ -65,14 +66,17 @@
6566
})();
6667
</script>
6768

68-
<!-- GitHub Pages SPA redirect handler -->
69+
<!-- Restore direct browser navigation for the noindex concept-review routes. -->
6970
<script>
70-
// Check if we were redirected from 404.html
71-
(function() {
72-
var redirect = sessionStorage.redirect;
73-
delete sessionStorage.redirect;
74-
if (redirect && redirect !== location.href) {
75-
history.replaceState(null, null, redirect);
71+
(function () {
72+
try {
73+
var redirect = sessionStorage.redirect;
74+
delete sessionStorage.redirect;
75+
if (redirect && redirect !== location.href) {
76+
history.replaceState(null, null, redirect);
77+
}
78+
} catch (error) {
79+
// Continue at the site root if session storage is unavailable.
7680
}
7781
})();
7882
</script>

‎public/404.html‎

Lines changed: 107 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,122 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
5-
<title>Computational Biology at Berkeley</title>
5+
<meta name="viewport" content="width=device-width, initial-scale=1" />
6+
<title>Page not found | Computational Biology at Berkeley</title>
7+
<meta
8+
name="description"
9+
content="The requested Computational Biology at Berkeley page could not be found."
10+
/>
611
<meta name="robots" content="noindex, nofollow" />
12+
<link rel="describedby" href="/llms.txt" type="text/markdown" />
713
<script>
814
(function () {
915
var projectName = "compbioatberkeley.github.io";
1016
var pathSegments = window.location.pathname.split("/").filter(Boolean);
1117
var isProjectPage =
12-
window.location.hostname.endsWith(".github.io") &&
13-
pathSegments[0] === projectName;
18+
window.location.hostname.endsWith(".github.io") && pathSegments[0] === projectName;
1419
var basePath = isProjectPage ? "/" + projectName + "/" : "/";
20+
var routePath = isProjectPage
21+
? "/" + pathSegments.slice(1).join("/")
22+
: window.location.pathname;
1523

16-
sessionStorage.redirect = window.location.href;
17-
window.location.replace(basePath);
24+
if (routePath === "/concepts" || routePath.startsWith("/concepts/")) {
25+
try {
26+
window.sessionStorage.redirect = window.location.href;
27+
} catch (error) {
28+
return;
29+
}
30+
window.location.replace(basePath);
31+
}
1832
})();
1933
</script>
34+
<style>
35+
:root {
36+
color-scheme: light dark;
37+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
38+
background: #f6f5f1;
39+
color: #182227;
40+
}
41+
42+
body {
43+
min-height: 100vh;
44+
margin: 0;
45+
display: grid;
46+
place-items: center;
47+
background-image:
48+
linear-gradient(rgba(24, 34, 39, 0.05) 1px, transparent 1px),
49+
linear-gradient(90deg, rgba(24, 34, 39, 0.05) 1px, transparent 1px);
50+
background-size: 24px 24px;
51+
}
52+
53+
main {
54+
width: min(42rem, calc(100% - 3rem));
55+
padding: 3rem 0;
56+
}
57+
58+
.eyebrow {
59+
color: #8a6a0a;
60+
font-size: 0.75rem;
61+
letter-spacing: 0.12em;
62+
text-transform: uppercase;
63+
}
64+
65+
h1 {
66+
margin: 0.75rem 0 1rem;
67+
font: 700 clamp(2.25rem, 7vw, 4.5rem)/1.05 ui-sans-serif, system-ui, sans-serif;
68+
}
69+
70+
p {
71+
max-width: 60ch;
72+
line-height: 1.65;
73+
}
74+
75+
nav {
76+
display: flex;
77+
flex-wrap: wrap;
78+
gap: 0.75rem 1.25rem;
79+
margin-top: 2rem;
80+
}
81+
82+
a {
83+
color: #075985;
84+
text-underline-offset: 0.2em;
85+
}
86+
87+
@media (prefers-color-scheme: dark) {
88+
:root {
89+
background: #101719;
90+
color: #eef1ed;
91+
}
92+
93+
body {
94+
background-image:
95+
linear-gradient(rgba(238, 241, 237, 0.06) 1px, transparent 1px),
96+
linear-gradient(90deg, rgba(238, 241, 237, 0.06) 1px, transparent 1px);
97+
}
98+
99+
a {
100+
color: #7dd3fc;
101+
}
102+
}
103+
</style>
20104
</head>
21-
<body></body>
105+
<body>
106+
<main>
107+
<p class="eyebrow">404 / recovery</p>
108+
<h1>Page not found</h1>
109+
<p>
110+
The requested page does not exist or may have moved. Use the site map for all public pages,
111+
or use the agent guide for a concise Markdown overview of this site.
112+
</p>
113+
<nav aria-label="Recovery links">
114+
<a href="/">Home</a>
115+
<a href="/sitemap.xml">Sitemap</a>
116+
<a href="/llms.txt">Agent guide (Markdown)</a>
117+
<a href="/agent-instructions.md">Agent instructions</a>
118+
<a href="/contact/">Contact</a>
119+
</nav>
120+
</main>
121+
</body>
22122
</html>

‎public/agent-instructions.md‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Agent instructions
2+
3+
Computational Biology at Berkeley is a UC Berkeley student organization. Use this site when a user needs public information about the organization's mission, events, officers, collaborations, recruitment, or ways to participate.
4+
5+
## Source selection
6+
7+
- Use [/calendar/](https://compbioatberkeley.github.io/calendar/) for scheduled events. Treat dates, times, and locations as mutable and report the page's current wording.
8+
- Use [/officers/](https://compbioatberkeley.github.io/officers/) for the public leadership roster. Preserve the academic-term label when naming officers.
9+
- Use [/signup/](https://compbioatberkeley.github.io/signup/) for public interest and update forms. Do not claim that a form was submitted unless the user or an authorized tool confirms completion.
10+
- Use [/collaborations/](https://compbioatberkeley.github.io/collaborations/) for partnership options and [/contact/](https://compbioatberkeley.github.io/contact/) for verified public contact channels.
11+
- The public general-inquiries email is [compbioatberkeley@gmail.com](mailto:compbioatberkeley@gmail.com). Do not infer or invent a phone number.
12+
- Use [/privacy/](https://compbioatberkeley.github.io/privacy/) before describing how the public site, analytics, forms, calendars, or linked services handle information.
13+
14+
## Boundaries
15+
16+
- Do not claim that a person is a current officer without the term shown on the Officers page.
17+
- Do not infer application status, membership, attendance, sponsorship, or a partnership from a public page or link.
18+
- Do not send forms, messages, applications, or other external submissions without explicit user authorization.
19+
- Do not ask users to provide sensitive health, research, academic, or identity data through public social channels.
20+
- Event details, rosters, forms, and recruitment windows may change. Re-fetch the relevant page for time-sensitive answers.
21+
22+
## Machine-readable discovery
23+
24+
- The complete index of public HTML pages is at [/sitemap.xml](https://compbioatberkeley.github.io/sitemap.xml).
25+
- Crawler policy is at [/robots.txt](https://compbioatberkeley.github.io/robots.txt).
26+
- The concise agent entry point is at [/llms.txt](https://compbioatberkeley.github.io/llms.txt).
27+
- The site publishes structured Schema.org `Organization`, `EducationalOrganization`, and `WebPage` data in its rendered HTML.
28+
29+
## Technical capabilities
30+
31+
No public API or MCP server is offered by this informational site. Do not invent API endpoints, tool calls, or transactional capabilities. GitHub repositories linked from the site are public project resources, not an API contract for this website.

‎public/llms.txt‎

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@
22

33
> Computational Biology at Berkeley is a UC Berkeley student organization connecting biology, computer science, and healthcare through education, research, projects, and community.
44

5-
The organization welcomes students at all experience levels. Use the pages below for current public information about its mission, events, leadership, collaborations, and ways to participate. Event details, officer rosters, and application forms may change between academic terms.
5+
The organization welcomes students at all experience levels. Event details, officer rosters, recruitment windows, and application forms may change between academic terms. Re-fetch the relevant page for time-sensitive answers. This informational site does not expose a public API or MCP server.
6+
7+
## When to use this site
8+
9+
- [Mission and programs](https://compbioatberkeley.github.io/about/): Use when answering what the organization does, who it serves, or how education, projects, networking, and community work fit together.
10+
- [Current events](https://compbioatberkeley.github.io/calendar/): Use for event dates, times, and locations; preserve the displayed timezone and treat details as mutable.
11+
- [Current leadership](https://compbioatberkeley.github.io/officers/): Use for public officer names, roles, bios, and links; always preserve the displayed academic term.
12+
- [Participation](https://compbioatberkeley.github.io/signup/): Use for public ways to join or receive updates; do not claim a form was submitted without confirmation.
13+
- [Partnerships](https://compbioatberkeley.github.io/collaborations/): Use for research, speaker, sponsorship, and industry collaboration options.
14+
- [Agent instructions](https://compbioatberkeley.github.io/agent-instructions.md): Use for source-selection rules, safety boundaries, and capability limits.
615

716
## Main pages
817

@@ -12,13 +21,23 @@ The organization welcomes students at all experience levels. Use the pages below
1221
- [Collaborations](https://compbioatberkeley.github.io/collaborations/): Partnership opportunities for students, faculty, alumni, research groups, and industry.
1322
- [Officers](https://compbioatberkeley.github.io/officers/): Fall 2026 and previous student leadership rosters, including submitted public bios and profile links.
1423
- [Join](https://compbioatberkeley.github.io/signup/): Interest form, newsletter signup, and community channels.
24+
- [Contact](https://compbioatberkeley.github.io/contact/): Verified public channels for general questions, partnerships, events, and participation.
25+
- [Privacy](https://compbioatberkeley.github.io/privacy/): How analytics, browser preferences, embedded services, forms, and external platforms handle information.
1526

1627
## Contact and community
1728

29+
- [Email](mailto:compbioatberkeley@gmail.com): General questions and collaboration inquiries; do not send sensitive information.
1830
- [LinkedIn](https://www.linkedin.com/company/computational-biology-at-berkeley/): Organization updates and professional contact.
1931
- [Linktree](https://linktr.ee/compbioatberkeley): Current collection of public links and contact destinations.
2032
- [GitHub](https://github.com/CompbioAtBerkeley): Public organization repositories.
2133

34+
## Machine-readable resources
35+
36+
- [Agent instructions](https://compbioatberkeley.github.io/agent-instructions.md): Detailed guidance on when to use each source and what agents must not infer or submit.
37+
- [Sitemap](https://compbioatberkeley.github.io/sitemap.xml): Canonical index of public HTML pages.
38+
- [Crawler policy](https://compbioatberkeley.github.io/robots.txt): Current crawler access policy and sitemap location.
39+
- [Organization identity](https://compbioatberkeley.github.io/): Rendered HTML includes Schema.org Organization, EducationalOrganization, PostalAddress, ContactPoint, and WebPage data.
40+
2241
## Optional
2342

2443
- [Instagram](https://www.instagram.com/ucb_compbio/): Event announcements, community updates, and recaps.

‎scripts/lib/site-seo.js‎

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { buildStructuredData } from "../../src/lib/siteStructuredData.js";
2+
13
const escapeXml = (value) =>
24
String(value)
35
.replaceAll("&", "&amp;")
@@ -50,6 +52,17 @@ export const buildRobotsTxt = ({ noindex, siteOrigin }) => {
5052
return `User-agent: *\nAllow: /\n\nSitemap: ${sitemapUrl}\n`;
5153
};
5254

55+
export const buildNotFoundHtml = ({ template, basePath = "/", sitemapUrl }) => {
56+
const normalizedBasePath = `/${basePath.replace(/^\/+|\/+$/g, "")}/`;
57+
const prefix = normalizedBasePath === "//" ? "/" : normalizedBasePath;
58+
const withBasePath = prefix === "/"
59+
? template
60+
: template.replaceAll('href="/', `href="${prefix}`);
61+
62+
if (!sitemapUrl) return withBasePath;
63+
return withBasePath.replace(/href="[^"]*\/sitemap\.xml"/, `href="${sitemapUrl}"`);
64+
};
65+
5366
export const buildPageHtml = ({
5467
template,
5568
appHtml,
@@ -61,29 +74,11 @@ export const buildPageHtml = ({
6174
const url = canonicalUrl(siteOrigin, page.path);
6275
const title = escapeHtml(page.title);
6376
const description = escapeHtml(page.description);
64-
const structuredData = [
65-
{
66-
"@context": "https://schema.org",
67-
"@type": "EducationalOrganization",
68-
name: siteIdentity.name,
69-
alternateName: siteIdentity.alternateName,
70-
url: canonicalUrl(siteOrigin, "/"),
71-
logo: canonicalUrl(siteOrigin, siteIdentity.logoPath),
72-
sameAs: siteIdentity.sameAs,
73-
},
74-
{
75-
"@context": "https://schema.org",
76-
"@type": "WebPage",
77-
name: page.title,
78-
description: page.description,
79-
url,
80-
isPartOf: {
81-
"@type": "WebSite",
82-
name: siteIdentity.name,
83-
url: canonicalUrl(siteOrigin, "/"),
84-
},
85-
},
86-
];
77+
const structuredData = buildStructuredData({
78+
page,
79+
siteIdentity,
80+
canonicalUrl: (pathname) => canonicalUrl(siteOrigin, pathname),
81+
});
8782

8883
let html = replaceRequired(
8984
template,

0 commit comments

Comments
 (0)