mirror of
https://github.com/fmhy/edit.git
synced 2026-02-03 17:51:07 +11:00
posts setup
This commit is contained in:
parent
8f457fa166
commit
5ae23bea33
14 changed files with 528 additions and 229 deletions
|
|
@ -9,7 +9,7 @@ import { renderAsync } from "@resvg/resvg-js";
|
|||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const __fonts = resolve(__dirname, "../fonts");
|
||||
|
||||
export async function generateImages(config: SiteConfig) {
|
||||
export async function generateImages(config: SiteConfig): Promise<void> {
|
||||
const pages = await createContentLoader("**/*.md", { excerpt: true }).load();
|
||||
const template = await readFile(resolve(__dirname, "./Template.vue"), "utf-8");
|
||||
|
||||
|
|
@ -57,7 +57,12 @@ interface GenerateImagesOptions {
|
|||
fonts: SatoriOptions["fonts"];
|
||||
}
|
||||
|
||||
async function generateImage({ page, template, outDir, fonts }: GenerateImagesOptions) {
|
||||
async function generateImage({
|
||||
page,
|
||||
template,
|
||||
outDir,
|
||||
fonts,
|
||||
}: GenerateImagesOptions): Promise<void> {
|
||||
const { frontmatter, url } = page;
|
||||
|
||||
const options: SatoriOptions = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue