mirror of
https://github.com/wasp-lang/open-saas.git
synced 2025-11-23 11:58:33 +01:00
format
This commit is contained in:
@@ -1,16 +1,24 @@
|
||||
import path from 'path';
|
||||
import { existsSync } from 'fs';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { existsSync } from "fs";
|
||||
import path from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
|
||||
export const BANNER_PATH = '/banner-images';
|
||||
export const BANNER_PATH = "/banner-images";
|
||||
|
||||
export const DEFAULT_BANNER_IMAGE = 'opensaas.webp';
|
||||
export const DEFAULT_BANNER_IMAGE = "opensaas.webp";
|
||||
|
||||
export const getBannerImageFilename = ({ path }: { path: string }) =>
|
||||
path.replace(/.*\//, '').replace(/\.\w+$/, '.webp');
|
||||
path.replace(/.*\//, "").replace(/\.\w+$/, ".webp");
|
||||
|
||||
export const checkBannerImageExists = ({ bannerImageFileName }: { bannerImageFileName: string }) => {
|
||||
export const checkBannerImageExists = ({
|
||||
bannerImageFileName,
|
||||
}: {
|
||||
bannerImageFileName: string;
|
||||
}) => {
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const imagePath = path.join(__dirname, `../../public/${BANNER_PATH}`, bannerImageFileName);
|
||||
const imagePath = path.join(
|
||||
__dirname,
|
||||
`../../public/${BANNER_PATH}`,
|
||||
bannerImageFileName,
|
||||
);
|
||||
return existsSync(imagePath);
|
||||
};
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { defineCollection } from 'astro:content';
|
||||
import { i18nSchema, docsSchema } from '@astrojs/starlight/schema';
|
||||
import { blogSchema } from 'starlight-blog/schema';
|
||||
import { z } from 'astro:content';
|
||||
import { docsSchema, i18nSchema } from "@astrojs/starlight/schema";
|
||||
import { defineCollection, z } from "astro:content";
|
||||
import { blogSchema } from "starlight-blog/schema";
|
||||
|
||||
export const collections = {
|
||||
docs: defineCollection({
|
||||
@@ -16,5 +15,5 @@ export const collections = {
|
||||
},
|
||||
}),
|
||||
}),
|
||||
i18n: defineCollection({ type: 'data', schema: i18nSchema() }),
|
||||
};
|
||||
i18n: defineCollection({ type: "data", schema: i18nSchema() }),
|
||||
};
|
||||
|
||||
18
opensaas-sh/blog/src/virtual.d.ts
vendored
18
opensaas-sh/blog/src/virtual.d.ts
vendored
@@ -1,22 +1,22 @@
|
||||
declare module 'virtual:starlight-blog-config' {
|
||||
const StarlightBlogConfig: import('./libs/config').StarlightBlogConfig;
|
||||
declare module "virtual:starlight-blog-config" {
|
||||
const StarlightBlogConfig: import("./libs/config").StarlightBlogConfig;
|
||||
|
||||
export default StarlightBlogConfig;
|
||||
}
|
||||
declare module 'virtual:starlight/user-config' {
|
||||
const Config: import('@astrojs/starlight/types').StarlightConfig;
|
||||
declare module "virtual:starlight/user-config" {
|
||||
const Config: import("@astrojs/starlight/types").StarlightConfig;
|
||||
|
||||
export default Config;
|
||||
}
|
||||
declare module 'virtual:starlight/user-images' {
|
||||
type ImageMetadata = import('astro').ImageMetadata;
|
||||
declare module "virtual:starlight/user-images" {
|
||||
type ImageMetadata = import("astro").ImageMetadata;
|
||||
export const logos: {
|
||||
dark?: ImageMetadata;
|
||||
light?: ImageMetadata;
|
||||
};
|
||||
}
|
||||
declare module 'virtual:astro-config' {
|
||||
const Config: import('@astrojs/types').Config;
|
||||
declare module "virtual:astro-config" {
|
||||
const Config: import("@astrojs/types").Config;
|
||||
|
||||
export default Config;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user