mirror of
https://github.com/fmhy/edit.git
synced 2026-03-11 08:55:38 +00:00
feat: new og image
This commit is contained in:
parent
6f1b1f2e20
commit
5c6d4c3b41
6 changed files with 20 additions and 28 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
# https://github.com/vitejs/vite/issues/17291
|
# https://github.com/vitejs/vite/issues/17291
|
||||||
[tools]
|
[tools]
|
||||||
node = "21"
|
node = "latest"
|
||||||
|
pnpm = "latest"
|
||||||
|
|
||||||
[tasks]
|
[tasks]
|
||||||
d = "nrr docs:dev --host"
|
d = "nrr docs:dev --host"
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,13 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
defineProps<{ title: string; description?: string }>()
|
defineProps<{ title: string; description?: string; image?: string }>()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<span
|
<span
|
||||||
tw="w-full h-full bg-black flex flex-col"
|
tw="w-full h-full bg-black flex flex-col"
|
||||||
style="
|
:style="{
|
||||||
background-image: linear-gradient(
|
backgroundImage: `url(${image})`
|
||||||
43deg,
|
}"
|
||||||
#b794f4 2%,
|
|
||||||
#b18df2 7.5%,
|
|
||||||
#ab87ef 13%,
|
|
||||||
#9f7aea 24%,
|
|
||||||
#8c6ee2 32%,
|
|
||||||
#7864d8 40%,
|
|
||||||
#4c51bf 56%,
|
|
||||||
#4949ae 60.5%,
|
|
||||||
#46419b 65%,
|
|
||||||
#3c366b 74%,
|
|
||||||
#2f315d 80.5%,
|
|
||||||
#272d47 87%,
|
|
||||||
#1a202c 100%
|
|
||||||
);
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
tw="p-10 w-full min-h-0 grow flex flex-col items-center justify-between"
|
tw="p-10 w-full min-h-0 grow flex flex-col items-center justify-between"
|
||||||
|
|
|
||||||
|
|
@ -102,12 +102,13 @@ async function generateImage({
|
||||||
|
|
||||||
// consola.info(url, title, description)
|
// consola.info(url, title, description)
|
||||||
const options: SatoriOptions = {
|
const options: SatoriOptions = {
|
||||||
width: 1200,
|
width: 1800,
|
||||||
height: 628,
|
height: 900,
|
||||||
fonts,
|
fonts,
|
||||||
props: {
|
props: {
|
||||||
title,
|
title,
|
||||||
description
|
description,
|
||||||
|
image: 'https://i.fmhy.net/og-base.jpg'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,13 +51,15 @@ const fonts: SatoriOptions['fonts'] = [
|
||||||
]
|
]
|
||||||
|
|
||||||
export default defineSatoriConfig({
|
export default defineSatoriConfig({
|
||||||
width: 1200,
|
width: 1800,
|
||||||
height: 628,
|
height: 900,
|
||||||
fonts,
|
fonts,
|
||||||
props: {
|
props: {
|
||||||
title: 'Title',
|
title: 'Title',
|
||||||
description:
|
description:
|
||||||
'Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat.',
|
'Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat.',
|
||||||
dir: '/j'
|
dir: '/j',
|
||||||
|
// I almost killed myself for this shit
|
||||||
|
image: 'https://i.fmhy.net/og-base.jpg'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
"docs:preview": "vitepress preview docs/",
|
"docs:preview": "vitepress preview docs/",
|
||||||
"format": "prettier -w --cache --check .",
|
"format": "prettier -w --cache --check .",
|
||||||
"licenser": "deno run --allow-read jsr:@kt3k/license-checker@3.3.1/main",
|
"licenser": "deno run --allow-read jsr:@kt3k/license-checker@3.3.1/main",
|
||||||
"og:dev": "x-satori -t ./docs/.vitepress/hooks/Template.vue -c ./.vitepress/hooks/satoriConfig.ts --dev"
|
"og:dev": "x-satori -t ./docs/.vitepress/hooks/Template.vue -c ./docs/.vitepress/hooks/satoriConfig.ts --dev"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fmhy/colors": "^0.0.11",
|
"@fmhy/colors": "^0.0.11",
|
||||||
|
|
@ -75,6 +75,9 @@
|
||||||
"@algolia/client-search",
|
"@algolia/client-search",
|
||||||
"search-insights"
|
"search-insights"
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
"onlyBuiltDependencies": [
|
||||||
|
"vue-demi"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
BIN
pnpm-lock.yaml
BIN
pnpm-lock.yaml
Binary file not shown.
Loading…
Reference in a new issue