mirror of
https://github.com/wasp-lang/open-saas.git
synced 2025-06-12 09:50:55 +02:00
fix docs header and links
This commit is contained in:
parent
c089283ad1
commit
8c52e6c481
@ -1,13 +1,14 @@
|
|||||||
import { defineConfig } from 'astro/config';
|
import { defineConfig } from 'astro/config';
|
||||||
import starlight from '@astrojs/starlight';
|
import starlight from '@astrojs/starlight';
|
||||||
import starlightBlog from 'starlight-blog';
|
import starlightBlog from 'starlight-blog';
|
||||||
|
import { BASE_URL } from './constants';
|
||||||
|
|
||||||
// https://astro.build/config
|
// https://astro.build/config
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
site: 'https://opensaas.sh',
|
site: BASE_URL,
|
||||||
integrations: [
|
integrations: [
|
||||||
starlightBlog({
|
starlightBlog({
|
||||||
title: 'The Best Blog Ever',
|
title: 'Blog',
|
||||||
authors: {
|
authors: {
|
||||||
vince: {
|
vince: {
|
||||||
name: 'Vince',
|
name: 'Vince',
|
||||||
@ -18,7 +19,7 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
starlight({
|
starlight({
|
||||||
title: 'Open SaaS',
|
title: 'OpenSaaS.sh',
|
||||||
description: 'Open SaaS is a free, open-source, full-stack SaaS starter kit for React + NodeJS.',
|
description: 'Open SaaS is a free, open-source, full-stack SaaS starter kit for React + NodeJS.',
|
||||||
logo: {
|
logo: {
|
||||||
src: '/src/assets/logo.png',
|
src: '/src/assets/logo.png',
|
||||||
@ -28,9 +29,10 @@ export default defineConfig({
|
|||||||
baseUrl: 'https://github.com/wasp-lang/open-saas/edit/main',
|
baseUrl: 'https://github.com/wasp-lang/open-saas/edit/main',
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
SiteTitle: './src/components/MyHeader.astro',
|
||||||
MarkdownContent: 'starlight-blog/overrides/MarkdownContent.astro',
|
MarkdownContent: 'starlight-blog/overrides/MarkdownContent.astro',
|
||||||
Sidebar: 'starlight-blog/overrides/Sidebar.astro',
|
Sidebar: 'starlight-blog/overrides/Sidebar.astro',
|
||||||
ThemeSelect: 'starlight-blog/overrides/ThemeSelect.astro',
|
// ThemeSelect: 'starlight-blog/overrides/ThemeSelect.astro',
|
||||||
},
|
},
|
||||||
social: {
|
social: {
|
||||||
github: 'https://github.com/wasp-lang/open-saas',
|
github: 'https://github.com/wasp-lang/open-saas',
|
||||||
|
1
docs/constants.ts
Normal file
1
docs/constants.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export const BASE_URL = 'https://opensaas.sh'
|
89
docs/src/components/MyHeader.astro
Normal file
89
docs/src/components/MyHeader.astro
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
---
|
||||||
|
import { logos } from 'virtual:starlight/user-images';
|
||||||
|
import config from 'virtual:starlight/user-config';
|
||||||
|
import blogConfig from 'virtual:starlight-blog-config'
|
||||||
|
import type { Props } from '@astrojs/starlight/props';
|
||||||
|
import { BASE_URL } from '../../constants';
|
||||||
|
|
||||||
|
---
|
||||||
|
<a href={BASE_URL} class="site-title sl-flex">
|
||||||
|
{
|
||||||
|
config.logo && logos.dark && (
|
||||||
|
<>
|
||||||
|
<img
|
||||||
|
class:list={{ 'light:sl-hidden': !('src' in config.logo) }}
|
||||||
|
alt={config.logo.alt}
|
||||||
|
src={logos.dark.src}
|
||||||
|
width={logos.dark.width}
|
||||||
|
height={logos.dark.height}
|
||||||
|
/>
|
||||||
|
{/* Show light alternate if a user configure both light and dark logos. */}
|
||||||
|
{!('src' in config.logo) && (
|
||||||
|
<img
|
||||||
|
class="dark:sl-hidden"
|
||||||
|
alt={config.logo.alt}
|
||||||
|
src={logos.light?.src}
|
||||||
|
width={logos.light?.width}
|
||||||
|
height={logos.light?.height}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
<span class:list={{ 'sr-only': config.logo?.replacesTitle }}>
|
||||||
|
{config.title}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
<div>
|
||||||
|
<a href="/">Docs</a>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<a href="/blog">{blogConfig.title}</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.site-title {
|
||||||
|
justify-self: flex-start;
|
||||||
|
max-width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
align-items: center;
|
||||||
|
gap: var(--sl-nav-gap);
|
||||||
|
font-size: var(--sl-text-h4);
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--sl-color-text-accent);
|
||||||
|
text-decoration: none;
|
||||||
|
white-space: nowrap;
|
||||||
|
padding-inline-end: 1rem;
|
||||||
|
border-inline-end: 1px solid var(--sl-color-gray-5);
|
||||||
|
}
|
||||||
|
img {
|
||||||
|
height: calc(var(--sl-nav-height) - 2 * var(--sl-nav-pad-y));
|
||||||
|
width: auto;
|
||||||
|
max-width: 100%;
|
||||||
|
object-fit: contain;
|
||||||
|
object-position: 0 50%;
|
||||||
|
}
|
||||||
|
div {
|
||||||
|
border-inline-end: 1px solid var(--sl-color-gray-5);
|
||||||
|
margin-left: 1rem;
|
||||||
|
align-self: center;
|
||||||
|
gap: 1rem;
|
||||||
|
height: 100%;
|
||||||
|
padding-inline-end: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 50rem) {
|
||||||
|
div {
|
||||||
|
align-items: center;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
a {
|
||||||
|
color: var(--sl-color-text-accent);
|
||||||
|
font-weight: 600;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
a:hover {
|
||||||
|
opacity: 0.66;
|
||||||
|
}
|
||||||
|
</style>
|
22
docs/src/virtual.d.ts
vendored
Normal file
22
docs/src/virtual.d.ts
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
export default Config;
|
||||||
|
}
|
||||||
|
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;
|
||||||
|
|
||||||
|
export default Config;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user