-
-
Notifications
You must be signed in to change notification settings - Fork 306
Expand file tree
/
Copy pathconfig.mts
More file actions
148 lines (139 loc) · 4.59 KB
/
Copy pathconfig.mts
File metadata and controls
148 lines (139 loc) · 4.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
import { withMermaid } from 'vitepress-plugin-mermaid';
import footnote from 'markdown-it-footnote';
import tailwindcss from '@tailwindcss/vite';
import llmstxt from 'vitepress-plugin-llms';
import { HeadConfig } from 'vitepress';
// @ts-expect-error This file gets generated once docs:generate is run
import apiRoutes from '../api/index.json';
const DESCRIPTION = 'A JavaScript library for reading, writing, and converting media files. Directly in the browser,'
+ ' and faster than anybunny else.';
// https://vitepress.dev/reference/site-config
export default withMermaid({
title: 'Mediabunny',
description: DESCRIPTION,
cleanUrls: true,
sitemap: {
hostname: 'https://mediabunny.dev',
},
head: [
['link', { rel: 'icon', type: 'image/png', href: '/mediabunny-logo.png' }],
['link', { rel: 'icon', type: 'image/svg+xml', href: '/mediabunny-logo.svg' }],
['meta', { property: 'og:type', content: 'website' }],
['meta', { property: 'og:site_name', content: 'Mediabunny' }],
['meta', { property: 'og:url', content: 'https://mediabunny.dev/' }],
['meta', { property: 'og:image', content: 'https://mediabunny.dev/mediabunny-og-image.png' }],
['meta', { property: 'og:locale', content: 'en-US' }],
['meta', { property: 'og:description', content: DESCRIPTION }],
['meta', { name: 'twitter:image', content: 'https://mediabunny.dev/mediabunny-og-image.png' }],
['meta', { name: 'twitter:card', content: 'summary_large_image' }],
['meta', { name: 'twitter:site', content: '@vanilagy' }],
['meta', { name: 'twitter:description', content: DESCRIPTION }],
],
themeConfig: {
logo: '/mediabunny-logo.svg',
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: 'Guide', link: '/guide/introduction', activeMatch: '/guide' },
{ text: 'API', link: '/api/', activeMatch: '/api' },
{ text: 'LLMs', link: '/llms', activeMatch: '/llms' },
{ text: 'Examples', link: '/examples', activeMatch: '/examples' },
{ text: 'Sponsors', link: '/#sponsors', activeMatch: '/#sponsors' },
{ text: 'License', link: 'https://github.com/Vanilagy/mediabunny#license' },
],
sidebar: {
'/guide': [
{
text: 'Getting started',
items: [
{ text: 'Introduction', link: '/guide/introduction' },
{ text: 'Installation', link: '/guide/installation' },
{ text: 'Quick start', link: '/guide/quick-start' },
],
},
{
text: 'Reading',
items: [
{ text: 'Reading media files', link: '/guide/reading-media-files' },
{ text: 'Media sinks', link: '/guide/media-sinks' },
{ text: 'Input formats', link: '/guide/input-formats' },
],
},
{
text: 'Writing',
items: [
{ text: 'Writing media files', link: '/guide/writing-media-files' },
{ text: 'Media sources', link: '/guide/media-sources' },
{ text: 'Output formats', link: '/guide/output-formats' },
],
},
{
text: 'Conversion',
items: [
{ text: 'Converting media files', link: '/guide/converting-media-files' },
],
},
{
text: 'Miscellaneous',
items: [
{ text: 'Packets & samples', link: '/guide/packets-and-samples' },
{ text: 'Supported formats & codecs', link: '/guide/supported-formats-and-codecs' },
],
},
{
text: 'Extensions',
items: [
{ text: 'mp3-encoder', link: '/guide/extensions/mp3-encoder' },
],
},
],
// Fails in CI without this
// eslint-disable-next-line @typescript-eslint/no-explicit-any
'/api': apiRoutes as any[],
},
socialLinks: [
{ icon: 'github', link: 'https://github.com/Vanilagy/mediabunny' },
{ icon: 'discord', link: 'https://discord.gg/hmpkyYuS4U' },
{ icon: 'x', link: 'https://x.com/vanilagy' },
{ icon: 'bluesky', link: 'https://bsky.app/profile/vanilagy.bsky.social' },
],
search: {
provider: 'local',
},
outline: {
level: [2, 3],
},
footer: {
message: 'Released under the Mozilla Public License 2.0.',
copyright: 'Copyright © 2025-present Vanilagy',
},
},
markdown: {
math: true,
theme: { light: 'github-light', dark: 'github-dark-dimmed' },
config(md) {
md.use(footnote);
},
},
vite: {
plugins: [
// eslint-disable-next-line @typescript-eslint/no-explicit-any
tailwindcss() as any,
llmstxt({
ignoreFiles: [
'api/*',
],
}),
],
},
outDir: '../dist-docs',
transformPageData(pageData) {
let title = pageData.title;
if (title !== 'Mediabunny') {
title += ' | Mediabunny';
}
((pageData.frontmatter['head'] ??= []) as HeadConfig[]).push(
['meta', { property: 'og:title', content: title }],
['meta', { property: 'twitter:title', content: title }],
);
},
});