Skip to content

Commit 57836c4

Browse files
authored
Merge branch 'main' into candlestick-api
2 parents 5e044f8 + 99f5d12 commit 57836c4

File tree

130 files changed

+2299
-534
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+2299
-534
lines changed

.github/scripts/data/baseline.json

Lines changed: 77 additions & 1 deletion
Large diffs are not rendered by default.

SEO_METADATA_GUIDE.md

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ Every page automatically receives:
6161
```html
6262
<title>Page Title | Chainlink Documentation</title>
6363
<meta name="description" content="..." />
64-
<meta name="keywords" content="..." />
6564
<link rel="canonical" href="..." />
6665
<meta property="og:title" content="..." />
66+
<meta property="og:type" content="article" />
6767
<meta property="og:description" content="..." />
6868
<meta name="twitter:card" content="summary_large_image" />
6969
```
@@ -78,12 +78,26 @@ Every page automatically receives:
7878
"name": "Deploy Your First Smart Contract",
7979
"description": "Learn to deploy smart contracts in 10 minutes",
8080
"totalTime": "PT10M",
81-
"author": { "@type": "Organization", "name": "Chainlink" },
82-
"publisher": { "@type": "Organization", "name": "Chainlink" }
81+
"author": { "@type": "Organization", "name": "Chainlink Labs" },
82+
"publisher": { "@type": "Organization", "name": "Chainlink Documentation" }
8383
}
8484
</script>
8585
```
8686

87+
### Canonical URLs
88+
89+
- Non-versioned pages can override canonical with `metadata.canonical`.
90+
- Relative values are resolved to absolute URLs using the site base.
91+
- Versioned API reference pages set canonicals/alternates via the version head component.
92+
- Latest version: `rel="canonical"`; other versions: `rel="alternate"`.
93+
- `hreflang` is not used for versioning.
94+
95+
### Open Graph Type
96+
97+
- `og:type` is set contextually:
98+
- `website`: for `/`, `/ccip`, `/ccip/directory*`, `/data-feeds`, `/vrf`, `/chainlink-functions`, `/chainlink-automation`, `/chainlink-local`, `/resources`.
99+
- `article`: for all other pages.
100+
87101
## Content Types & Templates
88102

89103
### Quickstarts
@@ -157,7 +171,7 @@ metadata:
157171
**Generated Schema**: TechArticle + LearningResource
158172

159173
- `educationalLevel`: From `difficulty` field
160-
- `teaches`: Auto-generated from content analysis
174+
- `teaches`: Derived from content type and product (e.g., "Concept for CCIP")
161175
- `learningResourceType`: "Concept"
162176

163177
### Guides
@@ -317,15 +331,20 @@ excerpt: "ccip cross-chain token transfer tutorial hardhat solidity intermediate
317331

318332
### Image Guidelines
319333

320-
**Path Format**: `/images/[product]/[descriptive-name].png`
334+
**Path Format**:
335+
336+
- Standard pages: `metadata.image` should be an absolute path like `/images/[product]/[descriptive-name].png`.
337+
- Quickstarts: `frontmatter.image` is a filename resolved to `/images/quickstarts/feature/{filename}`.
321338

322339
**Requirements:**
323340

324341
- Minimum 1200x630px for social sharing
325-
- Use WebP format when possible
342+
- Prefer PNG or JPG for broad preview compatibility
343+
- WebP is acceptable, but some bots preview PNG/JPG more reliably
344+
- Avoid animated GIFs for social previews (often heavy; many platforms show only the first frame)
326345
- Include alt text context in filename
327346

328-
**Note**: Images are optional - the system automatically falls back to the Chainlink logo for social sharing if no custom image is provided.
347+
**Note**: The system falls back to the Chainlink logo if no custom image is provided. The current implementation sets `og:image:type` to `image/png`; using PNG avoids type mismatches.
329348

330349
### Content Hierarchy
331350

@@ -339,21 +358,6 @@ excerpt: "ccip cross-chain token transfer tutorial hardhat solidity intermediate
339358

340359
## Validation & Testing
341360

342-
### Build-Time Validation
343-
344-
Run the validation script to check structured data compliance:
345-
346-
```bash
347-
npm run validate-structured-data
348-
```
349-
350-
This script validates:
351-
352-
- Required Schema.org properties
353-
- ISO 8601 duration formats
354-
- URL validity
355-
- Content type classification
356-
357361
### Manual Testing Tools
358362

359363
**Google Rich Results Test:**
@@ -449,8 +453,8 @@ Run `npm run build` and check for errors in console.
449453
**Reality**: Minimal impact
450454

451455
- JSON-LD scripts are small (typically <2KB)
452-
- Processed at build time, not runtime
453-
- No additional HTTP requests
456+
- Processed at build time (no client-side runtime cost)
457+
- Social image existence is validated at build time; no client-side requests
454458
- Automatic fallbacks prevent missing data
455459

456460
---
@@ -477,12 +481,6 @@ When updating existing content for better SEO:
477481
- [ ] Add `metadata.lastModified` when updating content
478482
- [ ] Add `metadata.version` for API references
479483

480-
### Validation
481-
482-
- [ ] Test with validation script: `npm run validate-structured-data`
483-
- [ ] Check Rich Results Test
484-
- [ ] Verify social sharing preview
485-
486484
## Current Implementation Status
487485

488486
**✅ Fully Implemented Features:**

astro.config.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const redirectSources = new Set(
2828
// https://astro.build/config
2929
export default defineConfig({
3030
site: "https://docs.chain.link",
31+
trailingSlash: "never",
3132
redirects: {
3233
"/ccip/directory": "/ccip/directory/mainnet",
3334
"/ccip/supported-networks": "/ccip/directory/mainnet",
@@ -106,6 +107,25 @@ export default defineConfig({
106107
adapter: vercel(),
107108
vite: {
108109
plugins: [yaml()],
110+
build: {
111+
target: "esnext", // Use latest ES features, no transpilation for modern browsers
112+
// Optimize CSS delivery
113+
cssMinify: true,
114+
// Increase the threshold for inlining assets to reduce render-blocking CSS
115+
assetsInlineLimit: 20000, // Inline CSS files up to 20KB to eliminate render-blocking
116+
// Removed manual chunking to prevent serverless function bloat
117+
// rollupOptions: {
118+
// output: {
119+
// manualChunks: ...
120+
// }
121+
// },
122+
},
123+
esbuild: {
124+
target: "esnext", // Match build target for consistency
125+
},
126+
css: {
127+
devSourcemap: false,
128+
},
109129
},
110130
legacy: {
111131
collections: false,

package-lock.json

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"@nanostores/preact": "^0.5.2",
6363
"@nanostores/react": "^0.8.4",
6464
"@openzeppelin/contracts": "^4.9.6",
65-
"astro": "^5.12.8",
65+
"astro": "^5.12.9",
6666
"bignumber.js": "^9.3.1",
6767
"clipboard": "^2.0.11",
6868
"dotenv": "^16.6.1",
@@ -74,7 +74,7 @@
7474
"lodash": "^4.17.21",
7575
"marked": "^15.0.12",
7676
"nanostores": "^0.11.4",
77-
"pino": "^9.7.0",
77+
"pino": "^9.8.0",
7878
"preact": "^10.26.9",
7979
"react-instantsearch": "^7.16.2",
8080
"rehype-autolink-headings": "^7.1.0",
@@ -98,7 +98,7 @@
9898
"@rollup/plugin-yaml": "^4.1.2",
9999
"@types/jest": "^29.5.14",
100100
"@types/lodash": "^4.17.20",
101-
"@types/node": "^20.19.9",
101+
"@types/node": "^20.19.10",
102102
"@types/node-fetch": "^2.6.13",
103103
"@types/prismjs": "^1.26.5",
104104
"@types/react": "^19.1.9",
@@ -114,7 +114,7 @@
114114
"eslint-plugin-n": "^15.7.0",
115115
"eslint-plugin-prettier": "^5.5.0",
116116
"eslint-plugin-promise": "^6.1.1",
117-
"hardhat": "^2.26.1",
117+
"hardhat": "^2.26.2",
118118
"husky": "^9.1.7",
119119
"jest-yaml-transform": "^0.2.0",
120120
"lint-staged": "^15.5.2",

0 commit comments

Comments
 (0)