Skip to content
This repository has been archived by the owner on Feb 13, 2022. It is now read-only.

Commit

Permalink
improved snippet for kirby tag compability
Browse files Browse the repository at this point in the history
Signed-off-by: Bruno Meilick <[email protected]>
  • Loading branch information
bnomei committed Aug 28, 2018
1 parent 4d27040 commit 28de4dc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bnomei/kirby3-srcset",
"type": "plugin",
"version": "1.1.3",
"version": "1.1.4",
"license": "MIT",
"description": "Kirby 3 Plugin for creating image srcset using picture element",
"autoload": {
Expand Down
7 changes: 1 addition & 6 deletions snippets/srcset.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
<?php
// $file, $lazy, $isLazy, $preset, $sources, $img
?>
<picture class="srcset" data-preset="<?= $preset ?>">
<?php foreach ($sources as $s): ?>
<source <?= ($isLazy?'data-':'') ?>srcset="<?= $s['srcset'] ?>" type="<?= $s['type'] ?>" />
<?php endforeach; ?>
<img class="<?= $lazy ?>" <?= ($isLazy?'data-':'') ?>src="<?= $img['src'] ?>" alt="<?= $img['alt'] ?>" />
</picture>
<picture class="srcset" data-preset="<?= $preset ?>"><?php foreach ($sources as $s): ?><source <?= ($isLazy?'data-':'') ?>srcset="<?= $s['srcset'] ?>" type="<?= $s['type'] ?>" /><?php endforeach; ?> <img class="<?= $lazy ?>" <?= ($isLazy?'data-':'') ?>src="<?= $img['src'] ?>" alt="<?= $img['alt'] ?>" /></picture>

0 comments on commit 28de4dc

Please sign in to comment.