fork of hey-api/openapi-ts because I need some additional things

docs: SEO improvements

Lubos a48f1616 1f9ec97e

+69 -29
+1
docs/.vitepress/config/en.ts
··· 305 305 }, 306 306 ], 307 307 }, 308 + title: 'Hey API', 308 309 });
+46 -17
docs/.vitepress/config/shared.ts
··· 1 1 import { defineConfig, type HeadConfig } from 'vitepress'; 2 2 3 + const domain = process.env.SITE_DOMAIN || 'http://localhost:5173'; 4 + 3 5 export default defineConfig({ 4 6 cleanUrls: true, 5 7 head: [ ··· 30 32 type: 'image/png', 31 33 }, 32 34 ], 33 - ['meta', { content: 'website', property: 'og:type' }], 34 - ['meta', { content: 'en', property: 'og:locale' }], 35 - [ 36 - 'meta', 37 - { 38 - content: 39 - '🚀 The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more.', 40 - property: 'og:title', 41 - }, 42 - ], 43 - ['meta', { content: 'OpenAPI TypeScript', property: 'og:site_name' }], 44 - ['meta', { content: '/images/logo-640w.png', property: 'og:image' }], 45 - ['meta', { content: 'https://heyapi.dev', property: 'og:url' }], 46 35 [ 47 36 'script', 48 37 {}, ··· 52 41 'script', 53 42 { defer: '', src: '/_vercel/insights/script.js' }, 54 43 ], 55 - ].filter(Boolean) as HeadConfig[], 56 - lastUpdated: false, 44 + ].filter(Boolean) as Array<HeadConfig>, 45 + lastUpdated: true, 57 46 sitemap: { 58 - hostname: 'https://heyapi.dev', 47 + hostname: domain, 48 + lastmodDateOnly: true, 49 + // filter out everything but index and `openapi-ts` pages 50 + transformItems: (items) => 51 + items.filter((item) => !item.url || item.url.startsWith('openapi-ts')), 59 52 }, 60 53 themeConfig: { 61 54 externalLinkIcon: true, ··· 69 62 { icon: 'github', link: 'https://github.com/hey-api/openapi-ts' }, 70 63 ], 71 64 }, 72 - title: 'Hey API', 65 + transformPageData: (pageData, context) => { 66 + pageData.frontmatter.head ??= []; 67 + 68 + const canonicalUrl = pageData.relativePath 69 + .replace(/index\.md$/, '') 70 + .replace(/\.md$/, context.siteConfig.cleanUrls ? '' : '.html'); 71 + const url = `${domain}/${canonicalUrl}`; 72 + 73 + const head: Array<HeadConfig> = pageData.frontmatter.head; 74 + head.unshift( 75 + ['link', { href: url, rel: 'canonical' }], 76 + ['meta', { content: 'website', property: 'og:type' }], 77 + ['meta', { content: 'en_US', property: 'og:locale' }], 78 + ['meta', { content: 'Hey API', property: 'og:site_name' }], 79 + [ 80 + 'meta', 81 + { content: `${domain}/images/logo-640w.png`, property: 'og:image' }, 82 + ], 83 + ['meta', { content: url, property: 'og:url' }], 84 + [ 85 + 'meta', 86 + { 87 + content: 88 + pageData.frontmatter.description || 89 + '🚀 The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more.', 90 + property: 'og:description', 91 + }, 92 + ], 93 + [ 94 + 'meta', 95 + { 96 + content: pageData.frontmatter.title || 'OpenAPI TypeScript', 97 + property: 'og:title', 98 + }, 99 + ], 100 + ); 101 + }, 73 102 });
+3 -2
docs/openapi-ts/plugins/fastify.md
··· 1 1 --- 2 - title: Fastify 3 - description: Fastify plugin for Hey API. Compatible with all our features. 2 + title: Fastify v5 Plugin 3 + description: Generate Fastify v5 route handlers from OpenAPI with the Fastify plugin for openapi-ts. Fully compatible with validators, transformers, and all core features. 4 4 --- 5 5 6 6 <Heading> ··· 30 30 31 31 ## Features 32 32 33 + - Fastify v5 support 33 34 - seamless integration with `@hey-api/openapi-ts` ecosystem 34 35 - type-safe route handlers 35 36 - minimal learning curve thanks to extending the underlying technology
+3 -2
docs/openapi-ts/plugins/tanstack-query.md
··· 1 1 --- 2 - title: TanStack Query 3 - description: TanStack Query plugin for Hey API. Compatible with all our features. 2 + title: TanStack Query v5 Plugin 3 + description: Generate TanStack Query v5 functions and query keys from OpenAPI with the TanStack Query plugin for openapi-ts. Fully compatible with validators, transformers, and all core features. 4 4 --- 5 5 6 6 <script setup lang="ts"> ··· 24 24 25 25 ## Features 26 26 27 + - TanStack Query v5 support 27 28 - seamless integration with `@hey-api/openapi-ts` ecosystem 28 29 - create query keys following the best practices 29 30 - type-safe query options, infinite query options, and mutation options
+3 -2
docs/openapi-ts/plugins/valibot.md
··· 1 1 --- 2 - title: Valibot 3 - description: Valibot plugin for Hey API. Compatible with all our features. 2 + title: Valibot v1 Plugin 3 + description: Generate Valibot v1 schemas from OpenAPI with the Valibot plugin for openapi-ts. Fully compatible with validators, transformers, and all core features. 4 4 --- 5 5 6 6 <!-- <script setup lang="ts"> ··· 24 24 25 25 ## Features 26 26 27 + - Valibot v1 support 27 28 - seamless integration with `@hey-api/openapi-ts` ecosystem 28 29 - Valibot schemas for requests, responses, and reusable definitions 29 30
+3 -2
docs/openapi-ts/plugins/zod.md
··· 1 1 --- 2 - title: Zod 3 - description: Zod plugin for Hey API. Compatible with all our features. 2 + title: Zod v4 Plugin 3 + description: Generate Zod v4 schemas from OpenAPI with the Zod plugin for openapi-ts. Fully compatible with validators, transformers, and all core features. 4 4 --- 5 5 6 6 <script setup lang="ts"> ··· 24 24 25 25 ## Features 26 26 27 + - Zod v4 support 27 28 - seamless integration with `@hey-api/openapi-ts` ecosystem 28 29 - Zod schemas for requests, responses, and reusable definitions 29 30
+3 -2
docs/openapi-ts/plugins/zod/mini.md
··· 1 1 --- 2 - title: Zod 3 - description: Zod plugin for Hey API. Compatible with all our features. 2 + title: Zod Mini Plugin 3 + description: Generate Zod Mini schemas from OpenAPI with the Zod plugin for openapi-ts. Fully compatible with validators, transformers, and all core features. 4 4 --- 5 5 6 6 <script setup lang="ts"> ··· 24 24 25 25 ## Features 26 26 27 + - Zod Mini support 27 28 - seamless integration with `@hey-api/openapi-ts` ecosystem 28 29 - Zod schemas for requests, responses, and reusable definitions 29 30
+3 -2
docs/openapi-ts/plugins/zod/v3.md
··· 1 1 --- 2 - title: Zod 3 - description: Zod plugin for Hey API. Compatible with all our features. 2 + title: Zod v3 Plugin 3 + description: Generate Zod v3 schemas from OpenAPI with the Zod plugin for openapi-ts. Fully compatible with validators, transformers, and all core features. 4 4 --- 5 5 6 6 <script setup lang="ts"> ··· 24 24 25 25 ## Features 26 26 27 + - Zod v3 support 27 28 - seamless integration with `@hey-api/openapi-ts` ecosystem 28 29 - Zod schemas for requests, responses, and reusable definitions 29 30
+4
docs/public/robots.txt
··· 1 + User-agent: * 2 + Allow: / 3 + 4 + Sitemap: https://heyapi.dev/sitemap.xml