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

9308cca4bc41554139ad4bbba7f5e6d5a54dcda1
wotaku/docs/.vitepress/configs/hooks/satoriConfig.ts
taskylizard wotaku 2bea9706e6c 1 year ago

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})
Keyboard shortcuts

Global

⌘K
Command palette & jump
/
Focus search
?
Show this help
g d
Dashboard
g e
Explore repositories
g n
Notifications

Repository & editor

t
Find file in repository
y
Copy immutable SHA permalink
g c
Code tab
g i
Issues tab
g m
Merge requests tab
g b
Builds tab
⌘↵
Submit active form