Skip to content

Commit

Permalink
use image alts from statamic
Browse files Browse the repository at this point in the history
  • Loading branch information
BobWez98 committed May 17, 2024
1 parent 92d0f13 commit 8b63e1d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ This package adds a blade directive. You can put a Asset in the blade directive
])
```

To allow the images to change on resize, add this include to your head in the layouts:
```php
@include('statamic-glide-directive::partials.head')
```

## Config

The package has some default config. By default it will use the presets defined in the config of this addon. If you've defined you're asset presets in the Statamic config, that will be used.
Expand Down
2 changes: 1 addition & 1 deletion resources/views/image.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<img
class="{{ $class }}"
src="{{ $presets['placeholder'] }}"
alt="{{ $alt }}"
alt="{{ $alt ?? $image->alt() }}"
width="{{ $image->width() }}"
height="{{ $image->height() }}"
onload="
Expand Down

0 comments on commit 8b63e1d

Please sign in to comment.