docs/.vitepress/configs/hooks/satoriConfig.ts

3df0ffeb7d8713f61ba2fa9a8554133c597af3e1
wotaku/docs/.vitepress/configs/hooks/satoriConfig.ts history · blame · raw

52 lines · 1454 bytes

 1/**
 2 *  All Rights Reserved
 3 *
 4 *  Copyright (c) 2025 taskylizard
 5 *
 6 *  All rights reserved. This code and its associated files may not be copied, modified, distributed, sublicensed, or used in any form, in whole or in part, without prior written permission from the copyright holder.
 7 */
 8import { readFile } from 'node:fs/promises'
 9import { dirname, resolve } from 'node:path'
10import { fileURLToPath } from 'node:url'
11import { defineSatoriConfig, type SatoriOptions } from 'x-satori/vue'
12const __dirname = dirname(fileURLToPath(import.meta.url))
13const __fonts = resolve(__dirname, '../fonts')
14
15const fonts: SatoriOptions['fonts'] = [
16  {
17    name: 'Inter',
18    data: await readFile(resolve(__fonts, 'Inter-Regular.otf')),
19    weight: 400,
20    style: 'normal'
21  },
22  {
23    name: 'Inter',
24    data: await readFile(resolve(__fonts, 'Inter-Medium.otf')),
25    weight: 500,
26    style: 'normal'
27  },
28  {
29    name: 'Inter',
30    data: await readFile(resolve(__fonts, 'Inter-SemiBold.otf')),
31    weight: 600,
32    style: 'normal'
33  },
34  {
35    name: 'Inter',
36    data: await readFile(resolve(__fonts, 'Inter-Bold.otf')),
37    weight: 700,
38    style: 'normal'
39  }
40]
41
42export default defineSatoriConfig({
43  width: 1800,
44  height: 900,
45  fonts,
46  props: {
47    title: 'Very Long Title so that I Can See How Shit Looks',
48    description:
49      'Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat.',
50    dir: '/j'
51  }
52})