|
| 1 | +import { defineConfig } from 'vitepress' |
| 2 | +import { redirectsPlugin, defaultPluginOptions } from './plugins/redirects' |
| 3 | + |
| 4 | +// Read the path prefix from RTD's canonical URL env var when present |
| 5 | +// (e.g. https://<slug>.readthedocs.build/en/171/ → /en/171/), so all |
| 6 | +// asset URLs resolve correctly under the PR-preview subpath. Defaults |
| 7 | +// to '/' for the GitHub Pages build at zarr.dev. |
| 8 | +const rtdUrl = process.env.READTHEDOCS_CANONICAL_URL |
| 9 | +const base = rtdUrl ? new URL(rtdUrl).pathname : '/' |
| 10 | + |
| 11 | +export default defineConfig({ |
| 12 | + base, |
| 13 | + title: 'Zarr', |
| 14 | + description: 'Zarr is a community project to develop specifications and software for storage of large N-dimensional typed arrays, also commonly known as tensors.', |
| 15 | + cleanUrls: true, |
| 16 | + lastUpdated: true, |
| 17 | + sitemap: { hostname: 'https://zarr.dev' }, |
| 18 | + head: [ |
| 19 | + ['link', { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }], |
| 20 | + ['link', { rel: 'icon', type: 'image/png', sizes: '16x16', href: '/favicon-16x16.png' }], |
| 21 | + ['link', { rel: 'icon', type: 'image/png', sizes: '32x32', href: '/favicon-32x32.png' }], |
| 22 | + ['link', { rel: 'apple-touch-icon', sizes: '180x180', href: '/apple-touch-icon.png' }], |
| 23 | + ['link', { rel: 'manifest', href: '/site.webmanifest' }], |
| 24 | + ['link', { rel: 'mask-icon', href: '/safari-pinned-tab.svg', color: '#5bbad5' }], |
| 25 | + ['meta', { name: 'apple-mobile-web-app-title', content: 'Zarr' }], |
| 26 | + ['meta', { name: 'application-name', content: 'Zarr' }], |
| 27 | + ['meta', { name: 'theme-color', content: '#ffffff' }], |
| 28 | + ['meta', { property: 'og:type', content: 'website' }], |
| 29 | + ['meta', { property: 'og:site_name', content: 'Zarr' }], |
| 30 | + ['meta', { property: 'og:title', content: 'Zarr' }], |
| 31 | + ['meta', { property: 'og:description', content: 'An open, community-driven format for storing large arrays in any key-value store, including cloud object storage.' }], |
| 32 | + ['meta', { property: 'og:image', content: 'https://zarr.dev/android-chrome-512x512.png' }], |
| 33 | + ['meta', { property: 'og:url', content: 'https://zarr.dev/' }], |
| 34 | + ['meta', { name: 'twitter:card', content: 'summary' }], |
| 35 | + ['meta', { name: 'twitter:title', content: 'Zarr' }], |
| 36 | + ['meta', { name: 'twitter:description', content: 'An open, community-driven format for storing large arrays in any key-value store, including cloud object storage.' }], |
| 37 | + ['meta', { name: 'twitter:image', content: 'https://zarr.dev/android-chrome-512x512.png' }], |
| 38 | + ['script', { async: '', src: 'https://www.googletagmanager.com/gtag/js?id=G-BCRR9QE7Z0' }], |
| 39 | + ['script', {}, `window.dataLayer = window.dataLayer || []; |
| 40 | +function gtag(){dataLayer.push(arguments);} |
| 41 | +gtag('js', new Date()); |
| 42 | +gtag('config', 'G-BCRR9QE7Z0');`], |
| 43 | + ], |
| 44 | + srcExclude: [ |
| 45 | + 'docs/**', |
| 46 | + 'README.md', |
| 47 | + 'NOTICE.md', |
| 48 | + ], |
| 49 | + vite: { |
| 50 | + plugins: [redirectsPlugin(defaultPluginOptions(process.cwd()))], |
| 51 | + }, |
| 52 | + themeConfig: { |
| 53 | + logo: '/android-chrome-192x192.png', |
| 54 | + search: { provider: 'local' }, |
| 55 | + nav: [ |
| 56 | + { text: 'Adopters', link: '/adopters' }, |
| 57 | + { text: 'Community', link: '/community' }, |
| 58 | + { text: 'Conventions', link: '/conventions' }, |
| 59 | + { text: 'Datasets', link: '/datasets' }, |
| 60 | + { text: 'Implementations', link: '/implementations' }, |
| 61 | + { text: 'Office Hours', link: '/office-hours' }, |
| 62 | + { text: 'Slides', link: '/slides' }, |
| 63 | + { |
| 64 | + text: 'External', |
| 65 | + items: [ |
| 66 | + { text: 'Blog', link: 'https://zarr.dev/blog/' }, |
| 67 | + { text: 'Specification', link: 'https://zarr-specs.readthedocs.io/' }, |
| 68 | + { text: 'ZEPs', link: 'https://zarr.dev/zeps/' }, |
| 69 | + { text: 'Documentation', link: 'https://zarr.readthedocs.io/en/stable/' }, |
| 70 | + ], |
| 71 | + }, |
| 72 | + ], |
| 73 | + socialLinks: [ |
| 74 | + { |
| 75 | + icon: { |
| 76 | + svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 530"><path d="M135.72 44.03C202.216 93.951 273.74 195.17 300 249.49c26.262-54.316 97.782-155.54 164.28-205.46C512.26 8.009 590-19.862 590 68.825c0 17.712-10.155 148.79-16.111 170.07-20.703 73.984-96.144 92.854-163.25 81.433 117.3 19.964 147.14 86.092 82.697 152.22-122.39 125.59-175.91-31.511-189.63-71.766-2.514-7.38-3.69-10.832-3.708-7.896-.017-2.936-1.193.516-3.707 7.896-13.714 40.255-67.233 197.36-189.63 71.766-64.444-66.128-34.605-132.26 82.697-152.22-67.108 11.421-142.55-7.45-163.25-81.433C20.15 217.612 9.997 86.535 9.997 68.825c0-88.687 77.742-60.816 125.72-24.795z" fill="currentColor"/></svg>', |
| 77 | + }, |
| 78 | + link: 'https://bsky.app/profile/zarr.dev', |
| 79 | + ariaLabel: 'Bluesky', |
| 80 | + }, |
| 81 | + { icon: 'mastodon', link: 'https://fosstodon.org/@zarr' }, |
| 82 | + { icon: 'github', link: 'https://github.com/zarr-developers' }, |
| 83 | + { |
| 84 | + icon: { |
| 85 | + svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12c0 1.81.49 3.51 1.34 4.97L2 22l5.16-1.35A9.95 9.95 0 0 0 12 22c5.52 0 10-4.48 10-10S17.52 2 12 2z" fill="currentColor"/></svg>', |
| 86 | + }, |
| 87 | + link: 'https://ossci.zulipchat.com/', |
| 88 | + ariaLabel: 'Zulip', |
| 89 | + }, |
| 90 | + ], |
| 91 | + editLink: { |
| 92 | + pattern: 'https://github.com/zarr-developers/zarr-developers.github.io/edit/main/:path', |
| 93 | + text: 'Edit this page on GitHub', |
| 94 | + }, |
| 95 | + footer: { |
| 96 | + message: 'Released under the MIT License.', |
| 97 | + copyright: 'Copyright © Zarr contributors', |
| 98 | + }, |
| 99 | + }, |
| 100 | +}) |
0 commit comments