Skip to content

Commit a1949b1

Browse files
committed
feat: homepage for doc site
1 parent d9c9796 commit a1949b1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1322
-202
lines changed

.github/workflows/deploy.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ jobs:
2525
steps:
2626
- name: Checkout your repository using git
2727
uses: actions/checkout@v4
28-
- run: mv .knosys/sites/default/package-deploy.json .knosys/sites/default/package.json
28+
- run: |
29+
mv .knosys/sites/default/package-deploy.json .knosys/sites/default/package.json
30+
cp .knosys/presets/tailwind/doc.js .knosys/sites/default/tailwind.config.js
2931
- name: Install, build, and upload your site output
3032
uses: withastro/action@v2
3133
with:

.knosys/presets/tailwind/app.js

+169
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
const { nextui } = require('@nextui-org/react')
2+
const { fontFamily } = require('tailwindcss/defaultTheme')
3+
4+
/** @type {import('tailwindcss').Config} */
5+
module.exports = {
6+
darkMode: 'class',
7+
content: [
8+
'./src/shared/components/**/*.{js,ts,jsx,tsx}',
9+
'./src/domain/**/*.{js,ts,jsx,tsx}',
10+
'./src/entry/**/*.{js,ts,jsx,tsx}',
11+
'./src/app/**/*.{js,ts,jsx,tsx}',
12+
'./node_modules/@nextui-org/theme/dist/**/*.{js,ts,jsx,tsx}',
13+
],
14+
theme: {
15+
screens: {
16+
sm: '640px',
17+
md: '768px',
18+
lg: '1024px',
19+
xl: '1280px',
20+
'2xl': '1536px',
21+
'3xl': '1920px',
22+
},
23+
extend: {
24+
dropShadow: {
25+
'3xl': '0 4px 12px rgba(0, 0, 0, 0.08)',
26+
'4xl': '0px 0px 24px rgba(0, 0, 0, 0.12)',
27+
'st': '0px -4px 14px 0px rgba(26, 26, 26, 0.08)',
28+
},
29+
fontFamily: {
30+
sans: ['var(--font-pt_mono)', ...fontFamily.sans],
31+
},
32+
backgroundImage: {
33+
'gradient-l-r':
34+
'linear-gradient(90deg, rgba(1, 219, 131, 0.6) 0%, transparent 40.29%, transparent 40.29%, transparent 100%)',
35+
'gradient-t-b': 'linear-gradient(180deg, #00FFA3 -21.21%, #F3FF65 100%)',
36+
'signin-gradient': 'radial-gradient(circle at 100% 0%, transparent 12px, #f1f1f1 0)',
37+
'signup-gradient': 'radial-gradient(circle at 0% 0%, transparent 12px, #f1f1f1 0)',
38+
'home-green-ball-gradient-l-r': 'linear-gradient(360deg, #00B56C 0%, rgba(1, 219, 131, 0.00) 100%)',
39+
'home-contributor-bg': 'linear-gradient(180deg, #F8F8F8 0%, rgba(248, 248, 248, 0.00) 100%)',
40+
'ticketLocation': 'linear-gradient(180deg, #ABEFD3 0%, #4BFBB4 100%)'
41+
},
42+
colors: {
43+
green: {
44+
DEFAULT: '#01DB83',
45+
50: '#d6f4ea',
46+
100: '#00A663',
47+
},
48+
yellow: {
49+
DEFAULT: '#FCF192',
50+
50: '#EFE37F',
51+
},
52+
orange: {
53+
DEFAULT: '#FDB17E',
54+
50: '#FDB17E',
55+
},
56+
red: {
57+
DEFAULT: '#E43150',
58+
50: '#E43150',
59+
},
60+
gray: {
61+
DEFAULT: '#1A1A1A',
62+
50: 'rgba(26, 26, 26, 0.8)',
63+
100: 'rgba(26, 26, 26, 0.6)',
64+
200: '#7C7C7C',
65+
300: '#F3F3F3',
66+
400: 'rgba(26, 26, 26, 0.06)',
67+
500: 'rgba(26, 26, 26, 0.4)',
68+
600: 'rgba(26, 26, 26, 0.1)',
69+
700: '#282828',
70+
800: 'rgba(26, 26, 26, 0.04)',
71+
900: '#EFEFEF',
72+
1000: '#f8f8f8',
73+
1100: 'rgba(26, 26, 26, 0.2)',
74+
1200: '#ebebeb',
75+
1300: 'rgba(26, 26, 26, 0.7)',
76+
1400: '#F1F1F1',
77+
},
78+
global: {
79+
main: '#051613',
80+
'bg-secondary': '#173C32',
81+
primary: '#F3FF65',
82+
},
83+
},
84+
borderRadius: {
85+
none: '0',
86+
DEFAULT: '8px',
87+
md: '4px',
88+
lg: '12px',
89+
xl: '16px',
90+
'2xl': '20px',
91+
},
92+
keyframes: {
93+
// shimmer: {
94+
// '100%': {
95+
// transform: 'translateX(100%)',
96+
// },
97+
// },
98+
// barrage: {
99+
// from: {
100+
// transform: 'translateX(0px)',
101+
// },
102+
// to: {
103+
// transform: 'translateX(-100px)',
104+
// },
105+
// },
106+
},
107+
animation: {
108+
'spin-10s': 'spin 10s linear infinite'
109+
// barrage: 'barrage linear 5s infinite',
110+
},
111+
aspectRatio: {
112+
'19/10': '19 / 10',
113+
},
114+
},
115+
},
116+
plugins: [
117+
require('daisyui'),
118+
nextui({
119+
themes: {
120+
light: {
121+
colors: {
122+
background: '#FFFFFF', // or DEFAULT
123+
foreground: '#1a1a1a', // or 50 to 900 DEFAULT
124+
primary: {
125+
foreground: '#FFFFFF',
126+
DEFAULT: '#1a1a1a',
127+
},
128+
// ... rest of the colors
129+
},
130+
},
131+
}
132+
})
133+
],
134+
daisyui: {
135+
themes: [
136+
// {'dark': {
137+
// 'primary': '#793ef9',
138+
// 'primary-focus': '#570df8',
139+
// 'primary-content': '#ffffff',
140+
// 'secondary': '#f000b8',
141+
// 'secondary-focus': '#bd0091',
142+
// 'secondary-content': '#ffffff',
143+
// 'accent': '#37cdbe',
144+
// 'accent-focus': '#2aa79b',
145+
// 'accent-content': '#ffffff',
146+
// 'neutral': '#2a2e37',
147+
// 'neutral-focus': '#16181d',
148+
// 'neutral-content': '#ffffff',
149+
// 'base-100': '#3d4451',
150+
// 'base-200': '#2a2e37',
151+
// 'base-300': '#16181d',
152+
// 'base-content': '#ebecf0',
153+
// 'info': '#66c6ff',
154+
// 'success': '#87d039',
155+
// 'warning': '#e2d562',
156+
// 'error': '#ff6f6f'
157+
// }},
158+
{'light': {
159+
'primary': '#1a1a1a',
160+
'primary-content': '#fff',
161+
'base-100': '#fff',
162+
'base-200': '#f8f8f8',
163+
'base-300': '#ebebeb',
164+
'base-content': 'rgba(26, 26, 26, 0.06)',
165+
}},
166+
]
167+
}
168+
// require('@tailwindcss/line-clamp')
169+
}

.knosys/presets/tailwind/doc.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const { nextui } = require('@nextui-org/react');
2+
const starlightPlugin = require('@astrojs/starlight-tailwind');
3+
4+
/** @type {import('tailwindcss').Config} */
5+
module.exports = {
6+
content: [
7+
'./.knosys/sites/default/src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}',
8+
'./node_modules/@nextui-org/theme/dist/**/*.{js,ts,jsx,tsx}',
9+
],
10+
theme: {
11+
extend: {},
12+
},
13+
darkMode: 'class',
14+
plugins: [nextui(), starlightPlugin()],
15+
};

.knosys/scripts/command/site.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const { resolveRootPath } = require('../helper');
44

55
module.exports = {
66
execute: (subCmd = 'dev') => {
7-
const cmds = ['astro --root .knosys/sites/default'];
7+
const cmds = ['cross-env OB_SITE=DOC astro --root .knosys/sites/default'];
88

99
if (subCmd) {
1010
cmds.push(subCmd);

.knosys/sites/default/astro.config.mjs

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// @ts-check
22
import { defineConfig } from 'astro/config';
3+
import react from '@astrojs/react';
4+
import tailwind from '@astrojs/tailwind';
35
import starlight from '@astrojs/starlight';
46

57
// https://astro.build/config
@@ -16,14 +18,23 @@ export default defineConfig({
1618
locales: ['en', 'zh'],
1719
},
1820
integrations: [
21+
react({ experimentalReactChildren: true }),
22+
tailwind({
23+
applyBaseStyles: false,
24+
}),
1925
starlight({
20-
title: 'OpenBuild Official Website Dev Docs',
26+
title: 'OpenBuild Dev Docs',
27+
favicon: '/favicon.png',
2128
social: {
2229
github: 'https://github.com/openbuildxyz/openbuild-frontend',
2330
},
2431
customCss: [
32+
'./src/shared/styles/tailwind-starlight.css',
2533
'./src/shared/styles/doc.css',
2634
],
35+
components: {
36+
SiteTitle: './src/shared/controls/astro-brand-logo',
37+
},
2738
sidebar: [
2839
{
2940
label: 'Guides',

.knosys/sites/default/package-deploy.json

+16-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,21 @@
1414
"astro": "astro"
1515
},
1616
"dependencies": {
17-
"@astrojs/starlight": "^0.30.3",
18-
"astro": "^5.1.1"
17+
"@astrojs/react": "3.6.2",
18+
"@astrojs/starlight": "0.28.5",
19+
"@astrojs/starlight-tailwind": "2.0.3",
20+
"@astrojs/tailwind": "5.1.2",
21+
"@nextui-org/react": "2.4.8",
22+
"@types/react": "18.3.12",
23+
"@types/react-dom": "18.3.1",
24+
"astro": "4.16.7",
25+
"autoprefixer": "10.4.19",
26+
"clsx": "2.1.1",
27+
"framer-motion": "10.18.0",
28+
"lucide-react": "0.454.0",
29+
"postcss": "8.4.47",
30+
"react": "18.3.1",
31+
"react-dom": "18.3.1",
32+
"tailwindcss": "3.4.14"
1933
}
2034
}
6.51 KB
Loading

.knosys/sites/default/public/favicon.svg

-1
This file was deleted.
Binary file not shown.
Binary file not shown.
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
User-agent: *
2+
3+
Disallow: /cgi-bin/
4+
Disallow: /assets/
5+
Disallow: /categories/
6+
Disallow: /tags/
7+
Disallow: /archives/
8+
9+
Disallow: /404.html
+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { defineCollection } from 'astro:content';
2-
import { docsLoader } from '@astrojs/starlight/loaders';
32
import { docsSchema } from '@astrojs/starlight/schema';
43

54
export const collections = {
6-
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
5+
docs: defineCollection({ schema: docsSchema() }),
76
};

.knosys/sites/default/src/content/docs/index.mdx

-11
This file was deleted.

.knosys/sites/default/src/content/docs/zh/index.mdx

-11
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
// Import the global.css file here so that it is included on
3+
// all pages through the use of the <BaseHead /> component.
4+
import '@/styles/tailwind-default.css';
5+
import '@/styles/global.css';
6+
import { resolvePath } from '@/utils';
7+
8+
interface Props {
9+
title: string;
10+
description: string;
11+
image?: string;
12+
}
13+
14+
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
15+
16+
const { title, description, image = resolvePath('/blog-placeholder-1.jpg') } = Astro.props;
17+
---
18+
19+
<!-- Global Metadata -->
20+
<meta charset="utf-8" />
21+
<meta name="viewport" content="width=device-width,initial-scale=1" />
22+
<link rel="icon" type="image/png" href={resolvePath('/favicon.png')} />
23+
24+
<!-- Font preloads -->
25+
<link rel="preload" href={resolvePath('/fonts/atkinson-regular.woff')} as="font" type="font/woff" crossorigin />
26+
<link rel="preload" href={resolvePath('/fonts/atkinson-bold.woff')} as="font" type="font/woff" crossorigin />
27+
28+
<!-- Canonical URL -->
29+
<link rel="canonical" href={canonicalURL} />
30+
31+
<!-- Primary Meta Tags -->
32+
<title>{title}</title>
33+
<meta name="title" content={title} />
34+
<meta name="description" content={description} />
35+
36+
<!-- Open Graph / Facebook -->
37+
<meta property="og:type" content="website" />
38+
<meta property="og:url" content={Astro.url} />
39+
<meta property="og:title" content={title} />
40+
<meta property="og:description" content={description} />
41+
<meta property="og:image" content={new URL(image, Astro.url)} />
42+
43+
<!-- Twitter -->
44+
<meta property="twitter:card" content="summary_large_image" />
45+
<meta property="twitter:url" content={Astro.url} />
46+
<meta property="twitter:title" content={title} />
47+
<meta property="twitter:description" content={description} />
48+
<meta property="twitter:image" content={new URL(image, Astro.url)} />

0 commit comments

Comments
 (0)