@@ -32,7 +32,7 @@ which allow you to completely customize how images are generated.
3232
3333### Features
3434
35- - ** 🧩 Framework agnostic** : Generate one or more images from any valid Astro page
35+ - ** 🧩 Framework agnostic** : Generate images from any valid Astro page
3636 - Unlike other integrations for generating social images, not limited to preset layouts
3737 - Unlike [ Satori] , not limited to certain types of JSX elements or CSS properties
3838 - Use whatever front-end framework you want
@@ -79,7 +79,7 @@ Here's a high-level overview of how the integration works:
7979
8080> [ !NOTE]
8181> Some package managers may block Puppeteer's install scripts. Refer to the [ troubleshooting] ( #troubleshooting ) section
82- > if you run into this issue .
82+ > if you run into any issues .
8383
8484This package is available on both [ JSR] ( https://jsr.io/@twocaretcat/astro-snapshot ) and
8585[ npm] ( https://www.npmjs.com/package/@twocaretcat/astro-snapshot ) . It also supports the ` astro add ` command to update
@@ -144,7 +144,7 @@ vlt astro add astro-snapshot
144144</details >
145145
146146> [ !NOTE]
147- > This grabs the package from npm. If you want to use the JSR version, you will need to install it manually instead.
147+ > ` astro add ` grabs the package from npm. If you want to use the JSR version, you'll need to install it manually instead.
148148
149149If you run into any issues, try the manual installation steps below.
150150
@@ -240,14 +240,14 @@ vlt install @twocaretcat/astro-snapshot # npm
240240> - No need for separate type declarations
241241> - Faster, leaner installs without extraneous files
242242
243- #### 2. Configure
243+ #### 2. Add to Config
244244
245245Then, apply the integration to your ` astro.config.* ` file using the integrations property:
246246
247247``` diff
248- // astro.config.mjs
248+ // astro.config.mjs or astro.config.ts
249249import { defineConfig } from 'astro/config';
250- + import snapshot from 'astro-snapshot';
250+ + import snapshot from '@twocaretcat/ astro-snapshot';
251251
252252export default defineConfig({
253253 // ...
@@ -258,14 +258,14 @@ export default defineConfig({
258258
259259## 🕹️ Usage
260260
261- ### Configure the Integration
261+ ### Getting Started
262262
263263Add the integration to your ` astro.config.mjs ` or ` astro.config.ts ` file and pass in an object to configure it like so:
264264
265265``` js
266266// astro.config.mjs
267267import { defineConfig } from ' astro/config' ;
268- import snapshot from ' astro-snapshot' ;
268+ import snapshot from ' @twocaretcat/ astro-snapshot' ;
269269
270270export default defineConfig ({
271271 integrations: [
@@ -278,7 +278,7 @@ export default defineConfig({
278278 outputPath: ' public/og/home.png' ,
279279 },
280280 ],
281- // Multiple screenshots for about page (different sizes)
281+ // Multiple screenshots for about page (different sizes and formats )
282282 ' /about' : [
283283 {
284284 outputPath: ' public/og/about-og.png' ,
@@ -291,7 +291,7 @@ export default defineConfig({
291291 height: 1080 ,
292292 },
293293 {
294- outputPath: ' public/og/about-twitter.png ' ,
294+ outputPath: ' public/og/about-twitter.webp ' ,
295295 width: 1200 ,
296296 height: 675 ,
297297 },
@@ -305,7 +305,7 @@ export default defineConfig({
305305The ` defaults ` object is optional and can be used to set default values for all screenshots.
306306
307307> [ !NOTE]
308- > Input paths must reference a valid Astro page on your site. If not, you'll get a screenshot of a 404 page.
308+ > Input paths must reference a valid Astro page on your site. If not, you'll get a screenshot of a 404 page instead 😞 .
309309
310310The ` pages ` object is required. It maps URL paths to an array of screenshot configurations.
311311
@@ -325,7 +325,7 @@ Here's an example with all available configuration options:
325325``` js
326326// astro.config.mjs
327327import { defineConfig } from ' astro/config' ;
328- import snapshot from ' astro-snapshot' ;
328+ import snapshot from ' @twocaretcat/ astro-snapshot' ;
329329
330330export default defineConfig ({
331331 integrations: [
@@ -408,7 +408,7 @@ Using TypeScript? Import the `Config` type to get type checking:
408408``` js
409409// astro.config.ts
410410import { defineConfig } from ' astro/config' ;
411- import snapshot , { type Config } from ' astro-snapshot' ;
411+ import snapshot , { type Config } from ' @twocaretcat/ astro-snapshot' ;
412412
413413const ASTRO_SNAPSHOT_CONFIG: Config = {
414414 pages: {
@@ -467,7 +467,7 @@ Generate screenshots for all blog posts:
467467``` js
468468// astro.config.mjs
469469import { defineConfig } from ' astro/config' ;
470- import snapshot from ' astro-snapshot' ;
470+ import snapshot from ' @twocaretcat/ astro-snapshot' ;
471471
472472// Get all blog post slugs (implement based on your setup)
473473const blogPosts = await getBlogPostSlugs ();
0 commit comments