Skip to content

Commit ba0bd60

Browse files
authored
Merge pull request #70 from Project-MONAI/fix/remove-client-side-meta-replacements
fix: Move meta tag replacements from client-side to static HTML
2 parents b5f3a86 + 2dacfba commit ba0bd60

20 files changed

+223
-172
lines changed

404.html

+13-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
<!DOCTYPE html>
2-
<html lang="en">
3-
<!-- Include Head Component with SEO parameters -->
2+
<html lang="en" style="scroll-behavior: smooth">
3+
<!-- Page-specific meta tags -->
4+
<title>404 - Page Not Found</title>
5+
<meta name="description" content="The page you were looking for could not be found. Please check the URL or navigate back to the homepage.">
6+
<meta property="og:title" content="404 - Page Not Found">
7+
<meta property="og:description" content="The page you were looking for could not be found. Please check the URL or navigate back to the homepage.">
8+
<meta property="og:url" content="https://monai.io/404.html">
9+
<meta name="twitter:title" content="404 - Page Not Found">
10+
<meta name="twitter:description" content="The page you were looking for could not be found. Please check the URL or navigate back to the homepage.">
11+
<link rel="canonical" href="https://monai.io/404.html">
12+
13+
<!-- Include Head Component -->
414
<!-- #include file="components/head.html" -->
5-
<!-- Replace with actual values -->
6-
<script>
7-
document.head.innerHTML = document.head.innerHTML
8-
.replace('${title}', '404 - Page Not Found')
9-
.replace('${description}', 'The page you were looking for could not be found. Please check the URL or navigate back to the homepage.')
10-
.replace('${canonical_url}', 'https://monai.io/404.html');
11-
</script>
1215

13-
<body class="bg-neutral-lightgray">
16+
<body class="flex flex-col min-h-screen">
1417
<!-- Include Header Component -->
1518
<!-- #include file="components/header.html" -->
1619

about.html

+13-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
<!DOCTYPE html>
2-
<html lang="en" class="scroll-smooth">
3-
2+
<html lang="en" style="scroll-behavior: smooth">
3+
4+
<!-- Page-specific meta tags -->
5+
<title>MONAI - About Us</title>
6+
<meta name="description" content="Project MONAI was originally started by NVIDIA & King's College London to establish an inclusive community of AI researchers for the development and exchange of best practices for A">
7+
<meta property="og:title" content="MONAI - About Us">
8+
<meta property="og:description" content="Project MONAI was originally started by NVIDIA & King's College London to establish an inclusive community of AI researchers for the development and exchange of best practices for A">
9+
<meta property="og:url" content="https://monai.io/about.html">
10+
<meta name="twitter:title" content="MONAI - About Us">
11+
<meta name="twitter:description" content="Project MONAI was originally started by NVIDIA & King's College London to establish an inclusive community of AI researchers for the development and exchange of best practices for A">
12+
<link rel="canonical" href="https://monai.io/about.html">
13+
14+
<!-- Include Head Component -->
415
<!-- #include file="components/head.html" -->
5-
<script>
6-
document.head.innerHTML = document.head.innerHTML
7-
.replace('${title}', 'MONAI - About Us')
8-
.replace('${description}', 'Project MONAI was originally started by NVIDIA & King\'s College London to establish an inclusive community of AI researchers for the development and exchange of best practices for AI in healthcare imaging.')
9-
.replace('${canonical_url}', 'https://monai.io/about.html');
10-
</script>
1116

1217
<body class="flex flex-col min-h-screen">
1318
<!-- #include file="components/header.html" -->

components/head.html

-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<!-- Head Component -->
2-
<!-- Parameters: title, description, canonical_url -->
32
<head>
43
<!-- Global site tag (gtag.js) - Google Analytics -->
54
<script async src="https://www.googletagmanager.com/gtag/js?id=G-QVGBCPFPJ6"></script>
@@ -15,28 +14,18 @@
1514
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
1615

1716
<!-- SEO Meta Tags -->
18-
<title>${title} | MONAI - Medical Open Network for AI</title>
19-
<meta name="description" content="${description}">
2017
<meta name="keywords" content="MONAI, Medical Imaging, AI, Deep Learning, Healthcare, PyTorch, Open Source">
2118
<meta name="author" content="Project MONAI">
2219

2320
<!-- Open Graph Meta Tags -->
24-
<meta property="og:title" content="${title} | MONAI">
25-
<meta property="og:description" content="${description}">
2621
<meta property="og:type" content="website">
27-
<meta property="og:url" content="${canonical_url}">
2822
<meta property="og:image" content="https://monai.io/assets/img/MONAI-logo_color.png">
2923

3024
<!-- Twitter Card Meta Tags -->
3125
<meta name="twitter:card" content="summary_large_image">
3226
<meta name="twitter:site" content="@ProjectMONAI">
33-
<meta name="twitter:title" content="${title} | MONAI">
34-
<meta name="twitter:description" content="${description}">
3527
<meta name="twitter:image" content="https://monai.io/assets/img/MONAI-logo_color.png">
3628

37-
<!-- Canonical URL -->
38-
<link rel="canonical" href="${canonical_url}">
39-
4029
<!-- Favicon -->
4130
<link rel="shortcut icon" href="./assets/img/favicon.png" type="image/png">
4231
<link rel="apple-touch-icon" href="./assets/img/favicon.png">

core.html

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
<!DOCTYPE html>
2-
<html lang="en" style="scroll-behavior: smooth">
2+
<html lang="en" class="scroll-smooth">
3+
<!-- Page-specific meta tags -->
4+
<title>MONAI Core</title>
5+
<meta name="description" content="MONAI Core is the flagship library of Project MONAI, providing powerful capabilities for medical AI development. It features medical-specific image transforms, state-of-the-art models like UNETR for 3D segmentation, and advanced frameworks like Auto3DSeg for automated model selection.">
6+
<meta property="og:title" content="MONAI Core">
7+
<meta property="og:description" content="MONAI Core is the flagship library of Project MONAI, providing powerful capabilities for medical AI development. It features medical-specific image transforms, state-of-the-art models like UNETR for 3D segmentation, and advanced frameworks like Auto3DSeg for automated model selection.">
8+
<meta property="og:url" content="https://monai.io/core.html">
9+
<meta name="twitter:title" content="MONAI Core">
10+
<meta name="twitter:description" content="MONAI Core is the flagship library of Project MONAI, providing powerful capabilities for medical AI development. It features medical-specific image transforms, state-of-the-art models like UNETR for 3D segmentation, and advanced frameworks like Auto3DSeg for automated model selection.">
11+
<link rel="canonical" href="https://monai.io/core.html">
312

13+
<!-- Include Head Component -->
414
<!-- #include file="components/head.html" -->
5-
<script>
6-
document.head.innerHTML = document.head.innerHTML
7-
.replace('${title}', 'MONAI Core')
8-
.replace('${description}', 'MONAI Core is the flagship library of Project MONAI, providing powerful capabilities for medical AI development. It features medical-specific image transforms, state-of-the-art models like UNETR for 3D segmentation, and advanced frameworks like Auto3DSeg for automated model selection.')
9-
.replace('${canonical_url}', 'https://monai.io/core.html');
10-
</script>
1115

12-
<body>
16+
<body class="flex flex-col min-h-screen">
1317
<!-- #include file="components/header.html" -->
1418

1519
<main class="flex-grow pt-20">

deploy.html

+15-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
<!DOCTYPE html>
2-
<html lang="en" style="scroll-behavior: smooth;">
3-
2+
<html lang="en" class="scroll-smooth">
3+
<!-- Page-specific meta tags -->
4+
<title>MONAI Deploy</title>
5+
<meta name="description" content="MONAI Deploy is a comprehensive framework for developing, packaging, testing, and deploying medical AI applications in research and development environments. Through its modular arch">
6+
<meta property="og:title" content="MONAI Deploy">
7+
<meta property="og:description" content="MONAI Deploy is a comprehensive framework for developing, packaging, testing, and deploying medical AI applications in research and development environments. Through its modular arch">
8+
<meta property="og:url" content="https://monai.io/deploy.html">
9+
<meta name="twitter:title" content="MONAI Deploy">
10+
<meta name="twitter:description" content="MONAI Deploy is a comprehensive framework for developing, packaging, testing, and deploying medical AI applications in research and development environments. Through its modular arch">
11+
<link rel="canonical" href="https://monai.io/deploy.html">
12+
13+
<!-- Include Head Component -->
414
<!-- #include file="components/head.html" -->
15+
516
<style>
617
@keyframes fade-in {
718
from {
@@ -158,14 +169,8 @@
158169
border-color: #059669;
159170
}
160171
</style>
161-
<script>
162-
document.head.innerHTML = document.head.innerHTML
163-
.replace('${title}', 'MONAI Deploy')
164-
.replace('${description}', 'MONAI Deploy is a comprehensive framework for developing, packaging, testing, and deploying medical AI applications in research and development environments. Through its modular architecture and standardized workflows, it enables seamless integration of AI models into existing infrastructures.')
165-
.replace('${canonical_url}', 'https://monai.io/deploy.html');
166-
</script>
167-
168-
<body>
172+
173+
<body class="flex flex-col min-h-screen">
169174
<!-- #include file="components/header.html" -->
170175

171176
<main class="flex-grow pt-20">

index.html

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
<!DOCTYPE html>
22
<html lang="en" class="scroll-smooth">
3-
<!-- Include Head Component with SEO parameters -->
3+
<!-- Page-specific meta tags -->
4+
<title>MONAI - Medical Open Network for AI</title>
5+
<meta name="description" content="MONAI is the leading open-source framework for healthcare imaging AI, trusted by researchers and clinicians worldwide. Build, train, and deploy medical AI solutions with industry-standard tools.">
6+
<meta property="og:title" content="MONAI - Medical Open Network for AI">
7+
<meta property="og:description" content="MONAI is the leading open-source framework for healthcare imaging AI, trusted by researchers and clinicians worldwide. Build, train, and deploy medical AI solutions with industry-standard tools.">
8+
<meta property="og:url" content="https://monai.io/">
9+
<meta name="twitter:title" content="MONAI - Medical Open Network for AI">
10+
<meta name="twitter:description" content="MONAI is the leading open-source framework for healthcare imaging AI, trusted by researchers and clinicians worldwide. Build, train, and deploy medical AI solutions with industry-standard tools.">
11+
<link rel="canonical" href="https://monai.io/">
12+
13+
<!-- Include Head Component -->
414
<!-- #include file="components/head.html" -->
5-
<!-- Replace with actual values -->
6-
<script>
7-
document.head.innerHTML = document.head.innerHTML
8-
.replace('${title}', 'MONAI - Medical Open Network for AI')
9-
.replace('${description}', 'MONAI is the leading open-source framework for healthcare imaging AI, trusted by researchers and clinicians worldwide. Build, train, and deploy medical AI solutions with industry-standard tools.')
10-
.replace('${canonical_url}', 'https://monai.io/');
11-
</script>
1215

1316
<body class="flex flex-col min-h-screen">
1417
<!-- Include Header Component -->

label.html

+14-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
<!DOCTYPE html>
2-
<html lang="en" style="scroll-behavior: smooth;">
3-
2+
<html lang="en" class="scroll-smooth">
3+
<!-- Page-specific meta tags -->
4+
<title>MONAI Label</title>
5+
<meta name="description" content="MONAI Label is an intelligent image labeling and learning tool that uses AI assistance to reduce the time and effort of annotating new datasets. By utilizing user interactions, MONAI">
6+
<meta property="og:title" content="MONAI Label">
7+
<meta property="og:description" content="MONAI Label is an intelligent image labeling and learning tool that uses AI assistance to reduce the time and effort of annotating new datasets. By utilizing user interactions, MONAI">
8+
<meta property="og:url" content="https://monai.io/label.html">
9+
<meta name="twitter:title" content="MONAI Label">
10+
<meta name="twitter:description" content="MONAI Label is an intelligent image labeling and learning tool that uses AI assistance to reduce the time and effort of annotating new datasets. By utilizing user interactions, MONAI">
11+
<link rel="canonical" href="https://monai.io/label.html">
12+
13+
<!-- Include Head Component -->
414
<!-- #include file="components/head.html" -->
5-
<script>
6-
document.head.innerHTML = document.head.innerHTML
7-
.replace('${title}', 'MONAI Label')
8-
.replace('${description}', 'MONAI Label is an intelligent image labeling and learning tool that uses AI assistance to reduce the time and effort of annotating new datasets. By utilizing user interactions, MONAI Label trains an AI model for a specific task and continuously learns and updates that model as it receives additional annotated images.')
9-
.replace('${canonical_url}', 'https://monai.io/label.html');
10-
</script>
11-
12-
<body>
15+
16+
<body class="flex flex-col min-h-screen">
1317
<!-- #include file="components/header.html" -->
1418

1519
<main class="flex-grow pt-20">

mayo-case-study.html

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
<!DOCTYPE html>
2-
<html lang="en" class="scroll-smooth">
2+
<html lang="en" style="scroll-behavior: smooth">
33

4+
<!-- Page-specific meta tags -->
5+
<title>MONAI - Mayo Clinic Case Study</title>
6+
<meta name="description" content="Learn how Mayo Clinic's Center for Augmented Intelligence in Imaging (CAII) uses MONAI to integrate AI models within clinical-imaging workflows.">
7+
<meta property="og:title" content="MONAI - Mayo Clinic Case Study">
8+
<meta property="og:description" content="Learn how Mayo Clinic's Center for Augmented Intelligence in Imaging (CAII) uses MONAI to integrate AI models within clinical-imaging workflows.">
9+
<meta property="og:url" content="https://monai.io/mayo-case-study.html">
10+
<meta name="twitter:title" content="MONAI - Mayo Clinic Case Study">
11+
<meta name="twitter:description" content="Learn how Mayo Clinic's Center for Augmented Intelligence in Imaging (CAII) uses MONAI to integrate AI models within clinical-imaging workflows.">
12+
<link rel="canonical" href="https://monai.io/mayo-case-study.html">
13+
14+
<!-- Include Head Component -->
415
<!-- #include file="components/head.html" -->
5-
<script>
6-
document.head.innerHTML = document.head.innerHTML
7-
.replace('${title}', 'MONAI - Mayo Clinic Case Study')
8-
.replace('${description}', 'Learn how Mayo Clinic\'s Center for Augmented Intelligence in Imaging (CAII) uses MONAI to integrate AI models within clinical-imaging workflows.')
9-
.replace('${canonical_url}', 'https://monai.io/mayo-case-study.html');
10-
</script>
1116

1217
<body class="flex flex-col min-h-screen">
1318

model-zoo.html

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
<!DOCTYPE html>
2-
<html lang="en" class="scroll-smooth">
2+
<html lang="en" style="scroll-behavior: smooth">
33

4+
<!-- Page-specific meta tags -->
5+
<title>MONAI Model Zoo - Pre-trained Models for Medical Imaging</title>
6+
<meta name="description" content="Explore MONAI Model Zoo - a collection of pre-trained models for medical imaging tasks. Find and use state-of-the-art models for your healthcare AI applications.">
7+
<meta property="og:title" content="MONAI Model Zoo - Pre-trained Models for Medical Imaging">
8+
<meta property="og:description" content="Explore MONAI Model Zoo - a collection of pre-trained models for medical imaging tasks. Find and use state-of-the-art models for your healthcare AI applications.">
9+
<meta property="og:url" content="https://monai.io/model-zoo.html">
10+
<meta name="twitter:title" content="MONAI Model Zoo - Pre-trained Models for Medical Imaging">
11+
<meta name="twitter:description" content="Explore MONAI Model Zoo - a collection of pre-trained models for medical imaging tasks. Find and use state-of-the-art models for your healthcare AI applications.">
12+
<link rel="canonical" href="https://monai.io/model-zoo.html">
13+
14+
<!-- Include Head Component -->
415
<!-- #include file="components/head.html" -->
5-
<script>
6-
document.head.innerHTML = document.head.innerHTML
7-
.replace('${title}', 'MONAI Model Zoo - Pre-trained Models for Medical Imaging')
8-
.replace('${description}', 'Explore MONAI Model Zoo - a collection of pre-trained models for medical imaging tasks. Find and use state-of-the-art models for your healthcare AI applications.')
9-
.replace('${canonical_url}', 'https://monai.io/model-zoo.html');
10-
</script>
1116

1217
<body class="flex flex-col min-h-screen">
1318
<!-- #include file="components/header.html" -->

scripts/build-html.js

-20
Original file line numberDiff line numberDiff line change
@@ -72,30 +72,10 @@ function replaceIncludes(content, components) {
7272
return processed;
7373
}
7474

75-
function extractMetadata(content) {
76-
const titleMatch = content.match(/<title>(.*?)<\/title>/);
77-
const descriptionMatch = content.match(/<meta name="description" content="(.*?)">/);
78-
const canonicalMatch = content.match(/<link rel="canonical" href="(.*?)">/);
79-
80-
return {
81-
title: titleMatch ? titleMatch[1].split('|')[0].trim() : 'MONAI',
82-
description: descriptionMatch ? descriptionMatch[1] : '',
83-
canonical_url: canonicalMatch ? canonicalMatch[1] : 'https://monai.io'
84-
};
85-
}
86-
8775
function processTemplate(template, components) {
8876
// First pass: Replace includes
8977
let processed = replaceIncludes(template, components);
9078

91-
// Extract metadata from the processed content
92-
const metadata = extractMetadata(processed);
93-
94-
// Second pass: Replace template variables
95-
processed = processed.replace(/\${title}/g, metadata.title);
96-
processed = processed.replace(/\${description}/g, metadata.description);
97-
processed = processed.replace(/\${canonical_url}/g, metadata.canonical_url);
98-
9979
return processed;
10080
}
10181

start.html

+13-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
<!DOCTYPE html>
2-
<html lang="en">
3-
<!-- Include Head Component with SEO parameters -->
2+
<html lang="en" style="scroll-behavior: smooth">
3+
<!-- Page-specific meta tags -->
4+
<title>Get Started</title>
5+
<meta name="description" content="Get started with MONAI - the freely available, community-supported, PyTorch-based framework for deep learning in healthcare imaging.">
6+
<meta property="og:title" content="Get Started">
7+
<meta property="og:description" content="Get started with MONAI - the freely available, community-supported, PyTorch-based framework for deep learning in healthcare imaging.">
8+
<meta property="og:url" content="https://monai.io/started.html">
9+
<meta name="twitter:title" content="Get Started">
10+
<meta name="twitter:description" content="Get started with MONAI - the freely available, community-supported, PyTorch-based framework for deep learning in healthcare imaging.">
11+
<link rel="canonical" href="https://monai.io/started.html">
12+
13+
<!-- Include Head Component -->
414
<!-- #include file="components/head.html" -->
5-
<!-- Replace with actual values -->
6-
<script>
7-
document.head.innerHTML = document.head.innerHTML
8-
.replace('${title}', 'Get Started')
9-
.replace('${description}', 'Get started with MONAI - the freely available, community-supported, PyTorch-based framework for deep learning in healthcare imaging.')
10-
.replace('${canonical_url}', 'https://monai.io/started.html');
11-
</script>
1215

13-
<body class="bg-neutral-lightgray">
16+
<body class="flex flex-col min-h-screen">
1417
<!-- Include Header Component -->
1518
<!-- #include file="components/header.html" -->
1619

0 commit comments

Comments
 (0)