Skip to content

Commit f48c08e

Browse files
committed
feat: initial project structure
1 parent cf99e5b commit f48c08e

40 files changed

+3185
-306
lines changed

build.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@ import { defineBuildConfig } from 'unbuild'
33
export default defineBuildConfig({
44
entries: [
55
'src/index',
6+
'src/theme',
7+
'src/schema',
68
{ input: 'src/routes/', outDir: 'dist/routes/' },
9+
{ input: 'src/components/', outDir: 'dist/components/' },
10+
{ input: 'src/layouts/', outDir: 'dist/layouts/' },
11+
{ input: 'src/styles/', outDir: 'dist/styles/' },
712
],
813
declaration: true,
914
clean: true,
15+
externals: ['astro:content', 'astro/zod'],
1016
stubOptions: {
1117
jiti: {
1218
esmResolve: true,

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ export default antfu(
66
type: 'lib',
77
astro: true,
88
unocss: true,
9+
markdown: true,
910
},
1011
)

package.json

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,16 @@
2020
"types": "./dist/index.d.ts",
2121
"import": "./dist/index.mjs"
2222
},
23-
"./routes/*": "./dist/routes/*"
23+
"./theme": {
24+
"types": "./dist/theme.d.ts",
25+
"import": "./dist/theme.mjs"
26+
},
27+
"./schema": {
28+
"types": "./dist/schema.d.ts",
29+
"import": "./dist/schema.mjs"
30+
},
31+
"./routes/*": "./dist/routes/*",
32+
"./components/*": "./dist/components/*"
2433
},
2534
"main": "./dist/index.mjs",
2635
"module": "./dist/index.mjs",
@@ -50,14 +59,21 @@
5059
"playground:build": "nr -C playground build"
5160
},
5261
"peerDependencies": {
62+
"@unocss/reset": "^0.63.2",
5363
"astro": "^4.15.0",
5464
"unocss": "^0.63.2"
5565
},
66+
"dependencies": {
67+
"dayjs": "^1.11.13",
68+
"fast-glob": "^3.3.2",
69+
"nprogress": "^0.2.0"
70+
},
5671
"devDependencies": {
5772
"@antfu/eslint-config": "^3.3.2",
5873
"@antfu/ni": "^0.23.0",
5974
"@antfu/utils": "^0.7.10",
6075
"@types/node": "^22.5.4",
76+
"@types/nprogress": "^0.2.3",
6177
"@unocss/eslint-plugin": "^0.63.2",
6278
"astro": "^4.15.11",
6379
"bumpp": "^9.5.2",
@@ -67,7 +83,7 @@
6783
"lint-staged": "^15.2.10",
6884
"pnpm": "^9.9.0",
6985
"simple-git-hooks": "^2.11.1",
70-
"typescript": "^5.5.4",
86+
"typescript": "5.5.4",
7187
"unbuild": "^2.0.0",
7288
"unocss": "^0.63.2",
7389
"vite": "^5.4.3",

playground/astro.config.mjs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1+
import mdx from '@astrojs/mdx'
2+
13
// @ts-check
24
import { defineConfig } from 'astro/config'
3-
45
import AntfuMeIntegration from 'astro-antfu.me'
56

7+
import UnoCSS from 'unocss/astro'
8+
69
// https://astro.build/config
710
export default defineConfig({
8-
integrations: [AntfuMeIntegration()],
11+
integrations: [mdx(), AntfuMeIntegration(), UnoCSS()],
12+
vite: {
13+
ssr: {
14+
external: ['astro-antfu.me'],
15+
},
16+
},
917
})

playground/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@
1212
},
1313
"dependencies": {
1414
"@astrojs/check": "^0.9.3",
15+
"@astrojs/mdx": "^3.1.7",
1516
"astro": "^4.15.11",
1617
"astro-antfu.me": "workspace:*",
1718
"typescript": "^5.6.2"
19+
},
20+
"devDependencies": {
21+
"@iconify/json": "^2.2.256",
22+
"@unocss/reset": "^0.63.2"
1823
}
1924
}
21.1 KB
Loading
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<p>If you enjoy my work and find them useful, consider sponsor me to help Open Source sustainable. Thank you!</p>
2+
3+
<p flex="~ gap-2 wrap">
4+
<a
5+
href="https://github.com/sponsors/adrian-ub"
6+
target="_blank"
7+
class="group inline-block btn-rose"
8+
>
9+
<span
10+
i-ph-heart-duotone
11+
group-hover="i-ph-heart-fill text-rose"
12+
transition-all
13+
duration-200
14+
ease-out
15+
/>
16+
Sponsor to support Adrián
17+
</a>
18+
</p>

playground/src/content/config.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
export const collections = {}
1+
import { defineCollection } from 'astro:content'
2+
import { pagesSchema } from 'astro-antfu.me/schema'
3+
4+
export const collections = {
5+
pages: defineCollection({
6+
schema: pagesSchema(),
7+
}),
8+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
title: John Doe
3+
---
4+
5+
import SponsorButton from '../../components/SponsorButton.astro'
6+
7+
Hey, I am John Doe, a fanatical open sourceror.
8+
9+
I love creating innovative solutions to complex problems. I am currently working at TechCorp, where I focus on developing cutting-edge web applications.
10+
11+
<div flex-auto />
12+
13+
---
14+
15+
Find me on
16+
17+
<p flex="~ gap-2 wrap" class="mt--2!">
18+
<a href="https://github.com/adrian-ub" target="_blank"><span op75 class="i-simple-icons-github" /> GitHub</a>
19+
<a href="https://www.twitter.com/AdrianUB" target="_blank"><span op75 class="i-ri-twitter-x-fill" /> Twitter</a>
20+
</p>
21+
22+
---
23+
24+
<SponsorButton />
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: 'Notes - John Doe'
3+
display: ''
4+
---
5+
6+
import SubNav from 'astro-antfu.me/components/SubNav.astro'
7+
import ListPosts from 'astro-antfu.me/components/ListPosts.astro'
8+
9+
<SubNav />
10+
11+
<ListPosts startsWith="notes/" />
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: 'Podcasts - John Doe'
3+
display: ''
4+
items:
5+
- title: 'Podcast test'
6+
date: '2024-10-04'
7+
path: 'https://github.com/adrian-ub'
8+
radio: true
9+
---
10+
11+
import SubNav from 'astro-antfu.me/components/SubNav.astro'
12+
import ListPosts from 'astro-antfu.me/components/ListPosts.astro'
13+
14+
<SubNav />
15+
16+
<ListPosts posts={frontmatter.items.reverse()} />
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: Blog - John Doe
3+
display: ''
4+
---
5+
6+
import SubNav from 'astro-antfu.me/components/SubNav.astro'
7+
import ListPosts from 'astro-antfu.me/components/ListPosts.astro'
8+
9+
<SubNav />
10+
11+
<ListPosts />

0 commit comments

Comments
 (0)