Skip to content

Commit d0959b0

Browse files
authored
Merge pull request #94 from raifdmueller/main
feat: Add comprehensive SEO optimization
2 parents 753d85e + d725aac commit d0959b0

6 files changed

Lines changed: 555 additions & 4 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ jobs:
3232
working-directory: ./website
3333
run: npm ci
3434

35-
- name: Extract metadata from anchor files
35+
- name: Extract metadata and generate sitemap
3636
working-directory: ./scripts
3737
run: |
3838
npm ci
3939
node extract-metadata.js
40+
node generate-sitemap.js
4041
4142
- name: Copy documentation files to public directory
4243
run: |

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
},
99
"scripts": {
1010
"test": "echo \"Error: no test specified\" && exit 1",
11-
"extract-metadata": "node scripts/extract-metadata.js"
11+
"extract-metadata": "node scripts/extract-metadata.js",
12+
"generate-sitemap": "node scripts/generate-sitemap.js",
13+
"build": "npm run extract-metadata && npm run generate-sitemap"
1214
},
1315
"keywords": [],
1416
"author": "",

scripts/generate-sitemap.js

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#!/usr/bin/env node
2+
3+
/**
4+
* generate-sitemap.js
5+
*
6+
* Generates sitemap.xml for the Semantic Anchors website
7+
*/
8+
9+
const fs = require('fs');
10+
const path = require('path');
11+
12+
// Paths
13+
const ANCHORS_DATA = path.join(__dirname, '..', 'website', 'public', 'data', 'anchors.json');
14+
const OUTPUT_FILE = path.join(__dirname, '..', 'website', 'public', 'sitemap.xml');
15+
const BASE_URL = 'https://llm-coding.github.io/Semantic-Anchors';
16+
17+
// Read anchors data
18+
const anchorsData = JSON.parse(fs.readFileSync(ANCHORS_DATA, 'utf-8'));
19+
20+
// Generate sitemap
21+
const today = new Date().toISOString().split('T')[0];
22+
23+
let sitemap = `<?xml version="1.0" encoding="UTF-8"?>
24+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
25+
<!-- Homepage -->
26+
<url>
27+
<loc>${BASE_URL}/</loc>
28+
<lastmod>${today}</lastmod>
29+
<changefreq>weekly</changefreq>
30+
<priority>1.0</priority>
31+
</url>
32+
33+
<!-- About Page -->
34+
<url>
35+
<loc>${BASE_URL}/#/about</loc>
36+
<lastmod>${today}</lastmod>
37+
<changefreq>monthly</changefreq>
38+
<priority>0.8</priority>
39+
</url>
40+
41+
<!-- Contributing Page -->
42+
<url>
43+
<loc>${BASE_URL}/#/contributing</loc>
44+
<lastmod>${today}</lastmod>
45+
<changefreq>monthly</changefreq>
46+
<priority>0.7</priority>
47+
</url>
48+
49+
`;
50+
51+
// Add all anchors
52+
anchorsData.forEach(anchor => {
53+
sitemap += ` <!-- Anchor: ${anchor.title} -->
54+
<url>
55+
<loc>${BASE_URL}/#/anchor/${anchor.id}</loc>
56+
<lastmod>${today}</lastmod>
57+
<changefreq>monthly</changefreq>
58+
<priority>0.6</priority>
59+
</url>
60+
61+
`;
62+
});
63+
64+
sitemap += `</urlset>
65+
`;
66+
67+
// Write sitemap
68+
fs.writeFileSync(OUTPUT_FILE, sitemap, 'utf-8');
69+
70+
console.log(`✓ Sitemap generated: ${OUTPUT_FILE}`);
71+
console.log(`✓ Total URLs: ${anchorsData.length + 3} (3 pages + ${anchorsData.length} anchors)`);

website/index.html

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,64 @@
44
<meta charset="UTF-8" />
55
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<meta name="description" content="Semantic Anchors - A curated catalog of well-defined terms for LLM communication" />
8-
<title>Semantic Anchors</title>
7+
8+
<!-- Primary Meta Tags -->
9+
<title>Semantic Anchors - Curated Catalog for LLM Communication</title>
10+
<meta name="title" content="Semantic Anchors - Curated Catalog for LLM Communication" />
11+
<meta name="description" content="60+ curated semantic anchors - well-defined terms, methodologies, and frameworks for precise communication with Large Language Models. Browse by category or role." />
12+
<meta name="keywords" content="semantic anchors, LLM, large language models, AI communication, prompt engineering, software development, TDD, architecture patterns, design principles" />
13+
<meta name="author" content="LLM Coding Community" />
14+
<meta name="language" content="English, German" />
15+
16+
<!-- Canonical URL -->
17+
<link rel="canonical" href="https://llm-coding.github.io/Semantic-Anchors/" />
18+
19+
<!-- Language Alternates -->
20+
<link rel="alternate" hreflang="en" href="https://llm-coding.github.io/Semantic-Anchors/" />
21+
<link rel="alternate" hreflang="de" href="https://llm-coding.github.io/Semantic-Anchors/?lang=de" />
22+
<link rel="alternate" hreflang="x-default" href="https://llm-coding.github.io/Semantic-Anchors/" />
23+
24+
<!-- Open Graph / Facebook -->
25+
<meta property="og:type" content="website" />
26+
<meta property="og:url" content="https://llm-coding.github.io/Semantic-Anchors/" />
27+
<meta property="og:title" content="Semantic Anchors - Curated Catalog for LLM Communication" />
28+
<meta property="og:description" content="60+ curated semantic anchors for precise LLM communication. Browse methodologies, frameworks, and patterns by category or professional role." />
29+
<meta property="og:image" content="https://llm-coding.github.io/Semantic-Anchors/og-image.png" />
30+
<meta property="og:image:width" content="1200" />
31+
<meta property="og:image:height" content="630" />
32+
<meta property="og:locale" content="en_US" />
33+
<meta property="og:locale:alternate" content="de_DE" />
34+
<meta property="og:site_name" content="Semantic Anchors" />
35+
36+
<!-- Twitter -->
37+
<meta name="twitter:card" content="summary_large_image" />
38+
<meta name="twitter:url" content="https://llm-coding.github.io/Semantic-Anchors/" />
39+
<meta name="twitter:title" content="Semantic Anchors - Curated Catalog for LLM Communication" />
40+
<meta name="twitter:description" content="60+ curated semantic anchors for precise LLM communication. Browse by category or role." />
41+
<meta name="twitter:image" content="https://llm-coding.github.io/Semantic-Anchors/twitter-card.png" />
42+
43+
<!-- Structured Data (Schema.org) -->
44+
<script type="application/ld+json">
45+
{
46+
"@context": "https://schema.org",
47+
"@type": "WebSite",
48+
"name": "Semantic Anchors",
49+
"alternateName": "Semantic Anchors for LLMs",
50+
"url": "https://llm-coding.github.io/Semantic-Anchors/",
51+
"description": "A curated catalog of 60+ semantic anchors - well-defined terms, methodologies, and frameworks for precise communication with Large Language Models",
52+
"inLanguage": ["en", "de"],
53+
"publisher": {
54+
"@type": "Organization",
55+
"name": "LLM Coding Community",
56+
"url": "https://github.com/LLM-Coding"
57+
},
58+
"potentialAction": {
59+
"@type": "SearchAction",
60+
"target": "https://llm-coding.github.io/Semantic-Anchors/#/search?q={search_term_string}",
61+
"query-input": "required name=search_term_string"
62+
}
63+
}
64+
</script>
965
</head>
1066
<body>
1167
<div id="app"></div>

website/public/robots.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# robots.txt for Semantic Anchors
2+
3+
User-agent: *
4+
Allow: /
5+
6+
# Sitemaps
7+
Sitemap: https://llm-coding.github.io/Semantic-Anchors/sitemap.xml
8+
9+
# Disallow search bot indexing of specific paths if needed
10+
# (currently allowing all)

0 commit comments

Comments
 (0)