Skip to content

Commit

Permalink
Fix picture source srcset #128
Browse files Browse the repository at this point in the history
  • Loading branch information
qrac committed Sep 12, 2024
1 parent 7dfcab1 commit 3a44bb0
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docs",
"version": "3.1.5",
"version": "3.1.6",
"private": true,
"dependencies": {
"preact": "^10.16.0"
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "minista-monorepo",
"version": "3.1.5",
"version": "3.1.6",
"private": true,
"engines": {
"node": ">=14.15.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/create-minista/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "create-minista",
"description": "Scaffolding for minista projects",
"version": "3.1.5",
"version": "3.1.6",
"type": "module",
"bin": {
"create-minista": "./bin/create-minista.js"
Expand Down
2 changes: 1 addition & 1 deletion packages/create-minista/templates/minimal-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"semi": false
},
"devDependencies": {
"minista": "^3.1.5",
"minista": "^3.1.6",
"react": "^18.2.0",
"react-dom": "^18.2.0"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/create-minista/templates/minimal-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"devDependencies": {
"@types/react": "^18.2.16",
"@types/react-dom": "^18.2.7",
"minista": "^3.1.5",
"minista": "^3.1.6",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5.1.6"
Expand Down
2 changes: 1 addition & 1 deletion packages/minista/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "minista",
"description": "Static site generator with 100% static export from React and Vite",
"version": "3.1.5",
"version": "3.1.6",
"type": "module",
"engines": {
"node": ">=14.15.0"
Expand Down
8 changes: 4 additions & 4 deletions packages/minista/src/shared/image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ export function Picture({
sizes={sourceSizes}
width={sourceWidth}
height={sourceHeight}
data-minista-transform-target={resolveTarget(src)}
data-minista-image-src={src}
data-minista-transform-target={resolveTarget(item.src)}
data-minista-image-src={item.src}
data-minista-image-outname={outName}
data-minista-image-optimize={sourceOptimizeStr}
/>
Expand Down Expand Up @@ -217,8 +217,8 @@ export function Picture({
sizes={sourceSizes}
width={sourceWidth}
height={sourceHeight}
data-minista-transform-target={resolveTarget(src)}
data-minista-image-src={src}
data-minista-transform-target={resolveTarget(item.src)}
data-minista-image-src={item.src}
data-minista-image-outname={outName}
data-minista-image-optimize={sourceOptimizeStr}
/>
Expand Down
15 changes: 15 additions & 0 deletions playground/shared-image/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@ export default function () {
formats={["webp", "inherit"]}
/>
</div>
<div>
<Picture
src="/src/assets/image.png"
artDirectives={[
{
media: `(max-width: 600px)`,
src: "/src/assets/image2.png",
},
{
media: `(min-width: 601px)`,
src: "/src/assets/image.png",
},
]}
/>
</div>

<div>
<Image src="https://picsum.photos/id/1/800/600" width={800} />
Expand Down

0 comments on commit 3a44bb0

Please sign in to comment.