Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct image path settings for astro assets support #621

Merged
merged 2 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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%;
}
Loading