File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,6 +40,14 @@ will output as:
4040
4141` <img src="data:image/png;base64,iVBOR…8f8luO3RPLKe4AAAAAElFTkSuQmCC" width="640" height="640" onload="console.log('loaded')" /> `
4242
43+ If you want to override the output, you can publish the view to your own views folder by running:
44+
45+ ```
46+ php artisan vendor:publish --tag="statamic-blurhash"
47+ ```
48+
49+ it will then be found at ` resources/views/vendor/statamic-blurhash/output.blade.php `
50+
4351
4452### Encoding a BlurHash image
4553
Original file line number Diff line number Diff line change 1+ <img src =" {{ $src } }" {!! $params ! !} />
Original file line number Diff line number Diff line change @@ -9,4 +9,11 @@ class ServiceProvider extends AddonServiceProvider
99 protected $ tags = [
1010 Tags \BlurHash::class,
1111 ];
12+
13+ public function bootAddon ()
14+ {
15+ $ this ->publishes ([
16+ __DIR__ .'/../resources/views ' => base_path ('resources/views/vendor/statamic-blurhash ' ),
17+ ], 'statamic-blurhash ' );
18+ }
1219}
Original file line number Diff line number Diff line change @@ -55,8 +55,11 @@ public function decode($encodedString = null)
5555 public function index ()
5656 {
5757 $ image = $ this ->params ->get ('image ' );
58-
59- return '<img src=" ' .$ this ->decode ($ this ->encode ($ image )).'" ' .$ this ->renderAttributesFromParams (['image ' ]).' /> ' ;
58+
59+ return view ('statamic-blurhash::output ' , [
60+ 'src ' => $ this ->decode ($ this ->encode ($ image )),
61+ 'params ' => $ this ->renderAttributesFromParams (['image ' ]),
62+ ]);
6063 }
6164
6265 /**
You can’t perform that action at this time.
0 commit comments