Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: use vitepress v1 #993

Merged
merged 14 commits into from
Aug 6, 2022
204 changes: 110 additions & 94 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,100 +1,15 @@
import type { DefaultTheme } from 'vitepress';
import { defineConfig } from 'vitepress';
import { apiPages } from './api-pages';
import { currentVersion, oldVersions } from './versions';

const nav: DefaultTheme.NavItem[] = [
{ text: 'Guide', link: '/guide/' },
// { text: 'Playground', link: '/playground/' },
{
text: 'Ecosystem',
items: [
{ text: 'Discord ', link: 'https://chat.fakerjs.dev' },
{ text: 'StackBlitz ', link: 'https://fakerjs.dev/new' },
{ text: 'Twitter ', link: 'https://twitter.com/faker_js' },
],
},
{
text: 'About',
items: [
{
text: 'Announcements',
link: '/about/announcements',
},
{
text: 'Team',
link: '/about/team',
},
],
},
{
text: currentVersion,
items: [
{
text: 'Release Notes',
link: 'https://github.com/faker-js/faker/releases',
},
...oldVersions.map(({ version, link }) => ({
text: version,
link,
})),
],
},
];

const sidebar: DefaultTheme.MultiSideBarConfig = {
'/about': [
{
text: 'About',
children: [
{
text: 'Announcements',
link: '/about/announcements',
children: [
{ text: '2022-01-14', link: '/about/announcements/2022-01-14' },
],
},
{
text: 'Team',
link: '/about/team',
},
],
},
],
'/': [
{
text: 'Guide',
children: [
{
text: 'Getting Started',
link: '/guide/',
},
],
},
{
text: 'API',
children: apiPages,
},
{
text: 'Migrating from Faker v5',
link: '/migration-guide-v5/',
},
],
};

const algolia: DefaultTheme.AlgoliaSearchOptions = {
apiKey: process.env.API_KEY,
appId: process.env.APP_ID,
indexName: 'fakerjs',
};

const description =
'Generate massive amounts of fake (but reasonable) data for testing and development.';
const image = 'https://fakerjs.dev/social-image.png';

export default defineConfig({
title: 'Faker',
description,

head: [
['link', { rel: 'icon', href: '/logo.svg' }],
['meta', { name: 'theme-color', content: '#40af7c' }],
Expand Down Expand Up @@ -141,15 +56,116 @@ export default defineConfig({
},
],
],

themeConfig: {
repo: 'faker-js/faker',
logo: '/logo.svg',
docsDir: 'docs',
docsBranch: 'main',
editLinks: true,
editLinkText: 'Suggest changes to this page',
nav,
sidebar,
algolia,

editLink: {
pattern: 'https://github.com/faker-js/faker/edit/main/docs/:path',
text: 'Suggest changes to this page',
},

socialLinks: [
{ icon: 'twitter', link: 'https://twitter.com/faker_js' },
{ icon: 'discord', link: 'https://chat.fakerjs.dev' },
{ icon: 'github', link: 'https://github.com/faker-js/faker' },
],

algolia: {
apiKey: process.env.API_KEY,
appId: process.env.APP_ID,
indexName: 'fakerjs',
},

footer: {
message: 'Released under the MIT License.',
copyright: 'Copyright © 2022-present Faker.',
},

nav: [
{ text: 'Guide', link: '/guide/' },
// { text: 'Playground', link: '/playground/' },
{
text: 'Ecosystem',
items: [{ text: 'StackBlitz ', link: 'https://fakerjs.dev/new' }],
},
{
text: 'About',
items: [
{
text: 'Announcements',
link: '/about/announcements',
},
{
text: 'Team',
link: '/about/team',
},
],
},
{
text: currentVersion,
items: [
{
text: 'Release Notes',
link: 'https://github.com/faker-js/faker/releases',
},
...oldVersions.map(({ version, link }) => ({
text: version,
link,
})),
],
},
],

sidebar: {
'/guide/': [
{
text: 'Guide',
items: [
{
text: 'Getting Started',
link: '/guide/',
},
],
},
{
text: 'API',
items: apiPages,
},
{
text: 'Migrations',
items: [
{
text: 'Migrating from Faker v5',
link: '/guide/migration-guide-v5',
},
],
},
],
'/api/': [
{
text: 'API',
items: apiPages,
},
],
Shinigami92 marked this conversation as resolved.
Show resolved Hide resolved
'/about/': [
{
text: 'About',
items: [
{
text: 'Announcements',
link: '/about/announcements',
// children: [
// { text: '2022-01-14', link: '/about/announcements/2022-01-14' },
// ],
Shinigami92 marked this conversation as resolved.
Show resolved Hide resolved
},
{
text: 'Team',
link: '/about/team',
},
],
},
],
},
},
});
4 changes: 3 additions & 1 deletion docs/about/team.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
---
layout: page
title: Team
description: The development of Faker is guided by an international team.
---

<script setup>
import TeamPage from './team/TeamPage.vue'
import TeamPage from './team/TeamPage.vue'
</script>

<TeamPage />
7 changes: 0 additions & 7 deletions docs/about/team/TeamMember.ts

This file was deleted.

76 changes: 0 additions & 76 deletions docs/about/team/TeamMember.vue

This file was deleted.

Loading