Files
corp/src/.vitepress/config.mts
2025-02-18 13:41:33 -04:00

113 lines
3.6 KiB
TypeScript

import { defineConfig } from 'vitepress'
import { SitemapStream } from 'sitemap'
import { createWriteStream } from 'node:fs'
import { resolve } from 'node:path'
// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "Dexorder",
// this description is put into the meta tag for SEO
description: "Power up Uniswap with limit orders, stoplosses, DCA's, breakout orders, and more. 100% noncustodial and EVM-native.",
head: [
[ 'meta', { name: 'viewport', content: 'width=device-width, initial-scale=1'}],
[ 'link', { rel: 'icon', href: '/favicon.ico' }],
// [ 'link', { rel: 'canonical', href: 'https://dexorder.trade/' }],
[ 'link', { rel: 'preconnect', href: 'https://fonts.googleapis.com' }],
[ 'link', { rel: 'preconnect', href: 'https://fonts.gstatic.com', crossorigin: '' }],
[ 'link', { rel: 'stylesheet', href: 'https://fonts.googleapis.com/css2?family=Manrope:wght@200..800&family=Victor+Mono:ital,wght@0,100..700;1,100..700&display=swap' }],
],
transformHead({assets}) {
// put the path of local assets into the <head>
let fontFile = assets.find(file => /forgotten_futurist\.\w+\.ttf/.test(file))
// adjust the regex accordingly for new fonts
// fontFile ||= assets.find(file => /forgotten_futurist\.\w+\.woff2/.test(file))
if (fontFile) {
return [
[
'link',
{
rel: 'preload',
href: fontFile,
as: 'font',
type: 'font/ttf',
crossorigin: ''
}
]
]
}
},
appearance: 'force-dark',
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
logo: {
light: '/dexorder_full_lightmode.svg',
dark: '/dexorder_full_darkmode.svg',
},
siteTitle: ' ',
nav: [
{ text: 'Home', link: '/' },
{ text: 'Docs', link: '/introduction' },
{ text: 'App', link: 'https://app.dexorder.trade/', target: 'dexorderapp', props: {} }
],
sidebar: [
{
text: 'About',
items: [
{text: 'Introduction', link: '/introduction',},
{text: 'Features', link: '/features',},
{text: 'Fees', link: '/fees',},
]
},
{
text: 'Legal',
items: [
{text: 'Terms of Service', link: '/terms-of-service',},
{text: 'Execution Policy', link: '/execution-policy',},
// {text: 'Privacy Policy', link: '/privacy-policy',}, TODO
]
},
],
socialLinks: [
{ icon: 'twitter', link: 'https://twitter.com/Dexorder_trade' },
{ icon: 'discord', link: 'https://discord.gg/fqp9JXXQyt' },
{ icon: 'github', link: 'https://github.com/dexorder-trade/contract' },
],
footer: {
copyright: `© ${new Date().getFullYear()} Dexorder Trading Services Ltd. (BVI)`,
},
},
// FFS I cannot stop markdown-it from rendering (c) as ©
markdown: {
config: (md) => {
md.disable(['replacements'], false)
},
},
// Sitemap generation
transformHtml: (_, id, { pageData }) => {
if (!/[\\/]404\.html$/.test(id))
links.push({
// you might need to change this if not using clean urls mode
url: pageData.relativePath.replace(/((^|\/)index)?\.md$/, '$2'),
lastmod: pageData.lastUpdated
})
},
buildEnd: async ({ outDir }) => {
const sitemap = new SitemapStream({
hostname: 'https://dexorder.trade/'
})
const writeStream = createWriteStream(resolve(outDir, 'sitemap.xml'))
sitemap.pipe(writeStream)
links.forEach((link) => sitemap.write(link))
sitemap.end()
await new Promise((r) => writeStream.on('finish', r))
},
})
const links = []