Skip to content

Commit 549872b

Browse files
chore: add astro-5 and vitepress-2 examples
1 parent bfe1121 commit 549872b

21 files changed

+854
-0
lines changed

examples/astro-5/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.astro

examples/astro-5/astro.config.mjs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { defineConfig } from 'astro/config'
2+
import Unfonts from 'unplugin-fonts/astro'
3+
4+
export default defineConfig({
5+
integrations: [
6+
Unfonts({
7+
google: {
8+
families: ['Crimson Pro', 'Open Sans', 'Material+Icons'],
9+
},
10+
11+
custom: {
12+
display: 'swap',
13+
families: {
14+
'Dancing Script': {
15+
src: './public/assets/fonts/DancingScript*',
16+
transform(font) {
17+
if (font.basename === 'DancingScript-Bold')
18+
font.weight = 700
19+
20+
return font
21+
},
22+
},
23+
},
24+
},
25+
26+
fontsource: {
27+
families: [
28+
{
29+
name: 'ABeeZee',
30+
weights: [400],
31+
styles: ['italic'],
32+
},
33+
{
34+
name: 'Truculenta',
35+
weights: [400, 700],
36+
},
37+
],
38+
},
39+
}),
40+
],
41+
})

examples/astro-5/package.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "astro-5",
3+
"private": true,
4+
"scripts": {
5+
"dev": "astro dev",
6+
"start": "astro dev",
7+
"build": "astro build",
8+
"preview": "astro preview",
9+
"astro": "astro"
10+
},
11+
"devDependencies": {
12+
"@fontsource/abeezee": "^5.1.0",
13+
"@fontsource/truculenta": "^5.1.0",
14+
"astro": "^5.12.0",
15+
"unplugin-fonts": "workspace:*"
16+
}
17+
}
79.3 KB
Binary file not shown.
79.3 KB
Binary file not shown.
Binary file not shown.
79.3 KB
Binary file not shown.

examples/astro-5/src/env.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/// <reference path="../.astro/types.d.ts" />
2+
/// <reference types="astro/client" />
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
import Unfont from 'unplugin-fonts/astro/component.astro';
3+
---
4+
5+
<html>
6+
<head>
7+
<Unfont />
8+
</head>
9+
<body>
10+
<h1>Hello Astro!</h1>
11+
<h2>I'm using a local font !</h2>
12+
<div class="fontsource-abeezee">I'm a ABeeZee fontsource</div>
13+
<div class="fontsource-truculenta">I'm a Truculenta fontsource</div>
14+
<a href="https://vitejs.dev/guide/features.html" target="_blank">Documentation</a>
15+
</body>
16+
</html>
17+
18+
<style>
19+
body {
20+
font-family: "Crimson Pro", Avenir, Helvetica, Arial, sans-serif;
21+
-webkit-font-smoothing: antialiased;
22+
-moz-osx-font-smoothing: grayscale;
23+
text-align: center;
24+
color: #2c3e50;
25+
margin-top: 60px;
26+
}
27+
28+
a {
29+
font-family: "Open Sans", Avenir, Helvetica, Arial, sans-serif;
30+
}
31+
32+
h2 {
33+
font-family: "Dancing Script", sans-serif;
34+
font-size: 3rem;
35+
font-weight: 600;
36+
}
37+
38+
.fontsource-abeezee {
39+
font-family: "ABeeZee", sans-serif;
40+
}
41+
42+
.fontsource-truculenta {
43+
font-family: "Truculenta", sans-serif;
44+
}
45+
</style>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
import Unfont from 'unplugin-fonts/astro/component.astro';
3+
---
4+
5+
<html>
6+
<head>
7+
<Unfont />
8+
</head>
9+
<body>
10+
<h1>Hello Astro!</h1>
11+
<h2>I'm using a local font in a subfolder !</h2>
12+
<div class="fontsource-abeezee">I'm a ABeeZee fontsource</div>
13+
<div class="fontsource-truculenta">I'm a Truculenta fontsource</div>
14+
<a href="https://vitejs.dev/guide/features.html" target="_blank">Documentation</a>
15+
</body>
16+
</html>
17+
18+
<style>
19+
body {
20+
font-family: "Crimson Pro", Avenir, Helvetica, Arial, sans-serif;
21+
-webkit-font-smoothing: antialiased;
22+
-moz-osx-font-smoothing: grayscale;
23+
text-align: center;
24+
color: #2c3e50;
25+
margin-top: 60px;
26+
}
27+
28+
a {
29+
font-family: "Open Sans", Avenir, Helvetica, Arial, sans-serif;
30+
}
31+
32+
h2 {
33+
font-family: "Dancing Script", sans-serif;
34+
font-size: 3rem;
35+
font-weight: 600;
36+
}
37+
38+
.fontsource-abeezee {
39+
font-family: "ABeeZee", sans-serif;
40+
}
41+
42+
.fontsource-truculenta {
43+
font-family: "Truculenta", sans-serif;
44+
}
45+
</style>

0 commit comments

Comments
 (0)