Skip to content

Commit f9848ba

Browse files
authored
chore: add expressive code (#768)
1 parent 5991d9a commit f9848ba

File tree

4 files changed

+157
-33
lines changed

4 files changed

+157
-33
lines changed

docs/astro.config.mjs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import mdx from "@astrojs/mdx";
55
import sitemap from "@astrojs/sitemap";
66
import { imageService } from "@unpic/astro/service";
77
import icon from "astro-icon";
8-
8+
import expressiveCode from "astro-expressive-code";
99
import netlify from "@astrojs/netlify";
1010

1111
// https://astro.build/config
@@ -33,17 +33,14 @@ export default defineConfig({
3333
"src/components/CodeEditor/index.tsx",
3434
],
3535
}),
36+
expressiveCode({
37+
themes: ["one-dark-pro"],
38+
}),
3639
mdx(),
3740
sitemap(),
3841
icon(),
3942
],
4043

41-
markdown: {
42-
shikiConfig: {
43-
theme: "one-dark-pro",
44-
},
45-
},
46-
4744
site: `https://unpic.pics`,
4845
adapter: netlify(),
4946
});

docs/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@
3232
"@types/node": "^22.10.7",
3333
"@types/react": "^19.0.7",
3434
"@types/react-dom": "^19.0.3",
35-
"@unpic/astro": "^",
35+
"@unpic/astro": "workspace:^",
3636
"@unpic/placeholder": "^0.1.2",
3737
"@unpic/react": "workspace:^",
3838
"astro": "^5.1.7",
39+
"astro-expressive-code": "^0.40.1",
3940
"astro-icon": "^1.1.5",
4041
"bluesky-comments-tag": "^0.0.2",
4142
"blurhash": "^2.0.5",
@@ -52,4 +53,4 @@
5253
"@types/pako": "^2.0.3",
5354
"html-escaper": "^3.0.3"
5455
}
55-
}
56+
}

docs/src/content/blog/unpic-1.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ for each provider separately.
5454

5555
<Image alt="Auto-complete of provider operations" src={operationsImg} />
5656

57-
```tsx
57+
```tsx {3}
5858
<Image
5959
src={imgUrl}
6060
operations={{ imgix: { flip: "h" }, bunny: { flop: true } }}
@@ -106,7 +106,7 @@ logic. You can provide your own transformer, or use a single, tree-shakable
106106
provider import. This is useful if you are using a single provider, or if you
107107
are building a custom component based on Unpic.
108108

109-
```tsx
109+
```tsx {2,4,9}
110110
// Import from the `/base` subpath
111111
import { Image } from "@unpic/react/base";
112112
// Import the transformer for the provider you are using

0 commit comments

Comments
 (0)