Skip to content

Commit

Permalink
Merge pull request #251 from hey-api/chore/support-i18n-in-docs
Browse files Browse the repository at this point in the history
chore(docs): add support for localization
  • Loading branch information
jordanshatford authored Apr 4, 2024
2 parents 10b3b56 + 324be08 commit 87c635f
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 20 deletions.
5 changes: 5 additions & 0 deletions .changeset/quiet-schools-matter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"openapi-ts-docs": minor
---

docs: add support for localization of docs
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# OpenAPI TypeScript 👋

✨ Turn your OpenAPI specification into a beautiful TypeScript client
<div align="center">
<img width="150" height="150" src="./docs/public/logo.png" alt="Logo">
<h1 align="center"><b>OpenAPI Typescript</b></h1>
<p align="center">✨ Turn your OpenAPI specification into a beautiful TypeScript client.</p>
</div>

## About

Expand Down
23 changes: 7 additions & 16 deletions docs/.vitepress/config.ts → docs/.vitepress/config/en.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
import { defineConfig } from 'vitepress'
import { defineConfig } from 'vitepress';

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "OpenAPI TypeScript",
description: "Turn your OpenAPI specification into a beautiful TypeScript client",
head: [
['link', { rel: 'icon', type: 'image/png', href: '/logo.png' }],
],
lang: 'en-US',
description: 'Turn your OpenAPI specification into a beautiful TypeScript client',
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
logo: '/logo.png',
nav: [
{ text: 'Guide', link: '/introduction' },
],
Expand All @@ -23,11 +17,8 @@ export default defineConfig({
{ text: 'Configuration', link: '/configuration' },
{ text: 'Interceptors', link: '/interceptors' },
{ text: 'Migrating', link: '/migrating' },
]
}
],
},
],
socialLinks: [
{ icon: 'github', link: 'https://github.com/hey-api/openapi-ts' }
]
}
})
},
});
11 changes: 11 additions & 0 deletions docs/.vitepress/config/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineConfig } from 'vitepress';

import en from './en';
import shared from './shared';

export default defineConfig({
...shared,
locales: {
root: { label: 'English', ...en },
},
});
19 changes: 19 additions & 0 deletions docs/.vitepress/config/shared.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { defineConfig } from 'vitepress';

export default defineConfig({
title: 'OpenAPI TypeScript',
lastUpdated: true,
sitemap: {
hostname: 'https://heyapi.vercel.app',
},
head: [
['link', { rel: 'icon', type: 'image/png', href: '/logo.png' }],
],
themeConfig: {
logo: '/logo.png',
socialLinks: [
{ icon: 'npm', link: 'https://www.npmjs.com/package/@hey-api/openapi-ts' },
{ icon: 'github', link: 'https://github.com/hey-api/openapi-ts' },
],
}
});
1 change: 0 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
# https://vitepress.dev/reference/default-theme-home-page
layout: home

hero:
Expand Down

0 comments on commit 87c635f

Please sign in to comment.