mirror of
https://github.com/wasp-lang/open-saas.git
synced 2025-11-21 04:49:12 +01:00
format
This commit is contained in:
@@ -1,32 +1,32 @@
|
||||
import { defineConfig } from 'astro/config';
|
||||
import starlight from '@astrojs/starlight';
|
||||
import starlightBlog from 'starlight-blog';
|
||||
import starlight from "@astrojs/starlight";
|
||||
import { defineConfig } from "astro/config";
|
||||
import starlightBlog from "starlight-blog";
|
||||
|
||||
import tailwind from '@astrojs/tailwind';
|
||||
import tailwind from "@astrojs/tailwind";
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({
|
||||
site: 'https://your-site.com',
|
||||
trailingSlash: 'always',
|
||||
site: "https://your-site.com",
|
||||
trailingSlash: "always",
|
||||
integrations: [
|
||||
starlight({
|
||||
title: 'Your SaaS',
|
||||
customCss: ['./src/styles/tailwind.css'],
|
||||
description: 'Documentation for your SaaS.',
|
||||
title: "Your SaaS",
|
||||
customCss: ["./src/styles/tailwind.css"],
|
||||
description: "Documentation for your SaaS.",
|
||||
logo: {
|
||||
src: '/src/assets/logo.webp',
|
||||
alt: 'Your SaaS',
|
||||
src: "/src/assets/logo.webp",
|
||||
alt: "Your SaaS",
|
||||
},
|
||||
head: [
|
||||
// Add your script tags here. Below is an example for Google analytics, etc.
|
||||
{
|
||||
tag: 'script',
|
||||
tag: "script",
|
||||
attrs: {
|
||||
src: 'https://www.googletagmanager.com/gtag/js?id=<YOUR-GOOGLE-ANALYTICS-ID>',
|
||||
src: "https://www.googletagmanager.com/gtag/js?id=<YOUR-GOOGLE-ANALYTICS-ID>",
|
||||
},
|
||||
},
|
||||
{
|
||||
tag: 'script',
|
||||
tag: "script",
|
||||
content: `
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
@@ -37,49 +37,49 @@ export default defineConfig({
|
||||
},
|
||||
],
|
||||
editLink: {
|
||||
baseUrl: 'https://github.com/<your-repo>',
|
||||
baseUrl: "https://github.com/<your-repo>",
|
||||
},
|
||||
components: {
|
||||
SiteTitle: './src/components/MyHeader.astro',
|
||||
ThemeSelect: './src/components/MyThemeSelect.astro',
|
||||
Head: './src/components/HeadWithOGImage.astro',
|
||||
PageTitle: './src/components/TitleWithBannerImage.astro',
|
||||
SiteTitle: "./src/components/MyHeader.astro",
|
||||
ThemeSelect: "./src/components/MyThemeSelect.astro",
|
||||
Head: "./src/components/HeadWithOGImage.astro",
|
||||
PageTitle: "./src/components/TitleWithBannerImage.astro",
|
||||
},
|
||||
social: {
|
||||
github: 'https://github.com/wasp-lang/open-saas',
|
||||
twitter: 'https://twitter.com/wasplang',
|
||||
discord: 'https://discord.gg/aCamt5wCpS',
|
||||
github: "https://github.com/wasp-lang/open-saas",
|
||||
twitter: "https://twitter.com/wasplang",
|
||||
discord: "https://discord.gg/aCamt5wCpS",
|
||||
},
|
||||
sidebar: [
|
||||
{
|
||||
label: 'Start Here',
|
||||
label: "Start Here",
|
||||
items: [
|
||||
{
|
||||
label: 'Introduction',
|
||||
link: '/',
|
||||
label: "Introduction",
|
||||
link: "/",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: 'Guides',
|
||||
label: "Guides",
|
||||
items: [
|
||||
{
|
||||
label: 'Example Guide',
|
||||
link: '/guides/example/',
|
||||
label: "Example Guide",
|
||||
link: "/guides/example/",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
plugins: [
|
||||
starlightBlog({
|
||||
title: 'Blog',
|
||||
customCss: ['./src/styles/tailwind.css'],
|
||||
title: "Blog",
|
||||
customCss: ["./src/styles/tailwind.css"],
|
||||
authors: {
|
||||
Dev: {
|
||||
name: 'Dev',
|
||||
title: 'Dev @ Your SaaS',
|
||||
picture: '/CRAIG_ROCK.png', // Images in the `public` directory are supported.
|
||||
url: 'https://your-site.com',
|
||||
name: "Dev",
|
||||
title: "Dev @ Your SaaS",
|
||||
picture: "/CRAIG_ROCK.png", // Images in the `public` directory are supported.
|
||||
url: "https://your-site.com",
|
||||
},
|
||||
},
|
||||
}),
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "blog",
|
||||
"type": "module",
|
||||
"version": "0.0.1",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "astro dev",
|
||||
"start": "astro dev",
|
||||
"astro": "astro",
|
||||
"build": "astro check && astro build",
|
||||
"dev": "astro dev",
|
||||
"preview": "astro preview",
|
||||
"astro": "astro"
|
||||
"start": "astro dev"
|
||||
},
|
||||
"dependencies": {
|
||||
"@astrojs/check": "^0.9.4",
|
||||
|
||||
@@ -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 = 'default-banner.webp';
|
||||
export const DEFAULT_BANNER_IMAGE = "default-banner.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
template/blog/src/virtual.d.ts
vendored
18
template/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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import starlightPlugin from "@astrojs/starlight-tailwind";
|
||||
import colors from "tailwindcss/colors";
|
||||
|
||||
const yellow = colors.yellow
|
||||
const gray = colors.gray
|
||||
const yellow = colors.yellow;
|
||||
const gray = colors.gray;
|
||||
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
export default {
|
||||
@@ -10,7 +10,8 @@ export default {
|
||||
theme: {
|
||||
extend: {
|
||||
colors: {
|
||||
accent: yellow, gray
|
||||
accent: yellow,
|
||||
gray,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"extends": "astro/tsconfigs/strict",
|
||||
"extends": "astro/tsconfigs/strict"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user