Skip to content

Commit

Permalink
Correct image path settings for astro assets support (#621)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonswiss authored Sep 5, 2023
1 parent 196daee commit f47feaa
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/smart-poems-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@keystatic/templates-astro': patch
---

Add support for Astro assets with image directory and publicPath in Keystatic
config
5 changes: 4 additions & 1 deletion templates/astro/keystatic.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ export default config({
formatting: true,
dividers: true,
links: true,
images: true,
images: {
directory: 'src/assets/images/posts',
publicPath: '../../assets/images/posts/',
},
}),
},
}),
Expand Down
5 changes: 5 additions & 0 deletions templates/astro/src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ ol {
margin-bottom: 1rem;
color: #1d1d1d;
}

img {
height: auto;
max-width: 100%;
}

3 comments on commit f47feaa

@vercel
Copy link

@vercel vercel bot commented on f47feaa Sep 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

keystatic – ./dev-projects/next-app

keystatic-thinkmill-labs.vercel.app
keystatic.vercel.app
keystatic-git-main-thinkmill-labs.vercel.app

@vercel
Copy link

@vercel vercel bot commented on f47feaa Sep 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

keystar-ui – ./design-system/docs

keystar-ui-git-main-thinkmill-labs.vercel.app
keystar-ui.vercel.app
keystar-ui-thinkmill-labs.vercel.app
voussoir.vercel.app

@vercel
Copy link

@vercel vercel bot commented on f47feaa Sep 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.