diff --git a/assets/css/index.css b/assets/css/index.css index 34dfef7..a8bf7bc 100644 --- a/assets/css/index.css +++ b/assets/css/index.css @@ -239,6 +239,16 @@ h1, h2, h3, h4, h5, h6 { padding-top: .75rem; color: var(--color-text-grey); } +.text figure ul { + line-height: 0; + display: grid; + gap: 1.5rem; + margin: 0; + grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); +} +.text figure ul li { + list-style: none; +} hr { border: 0; diff --git a/site/snippets/blocks/gallery.php b/site/snippets/blocks/gallery.php new file mode 100644 index 0000000..54554ae --- /dev/null +++ b/site/snippets/blocks/gallery.php @@ -0,0 +1,23 @@ + + diff --git a/site/snippets/blocks/image.php b/site/snippets/blocks/image.php index 577a3ac..ad408f4 100644 --- a/site/snippets/blocks/image.php +++ b/site/snippets/blocks/image.php @@ -13,47 +13,32 @@ https://getkirby.com/docs/guide/templates/snippets */ -$alt = $block->alt(); -$caption = $block->caption(); -$contain = $block->crop()->isFalse(); -$link = $block->link(); -$ratio = $block->ratio()->or('auto'); -$class = $ratio != 'auto' ? 'img' : 'auto'; -$src = null; -$lightbox = $link->isEmpty(); +$src = null; -if ($block->location() == 'web') { - $src = $block->src(); - $srcValue = $src->escape('attr'); -} elseif ($image = $block->image()->toFile()) { - $alt = $alt->or($image->alt()); - $src = $srcValue = $image->url(); +if ($block->location()->value() === 'web') { + $alt = $block->alt(); + $src = $block->src(); +} else if ($image = $block->image()->toFile()) { + $alt = $block->alt()->or($image->alt()); + $src = $image->url(); } -if ($ratio !== 'auto') { - $ratio = Str::split($ratio, '/'); - $w = $ratio[0] ?? 1; - $h = $ratio[1] ?? 1; -} - -$attrs = attr([ - 'class' => $class, - 'data-contain' => $contain, - 'data-lightbox' => $lightbox, - 'href' => $link->or($src), - 'style' => '--w:' . $w . '; --h:' . $h, -]); - ?> - +
- > - <?= esc($alt, 'attr') ?> - - isNotEmpty()): ?> + $alt, + 'contain' => $block->crop()->isFalse(), + 'lightbox' => $block->link()->isEmpty(), + 'href' => $block->link()->or($src), + 'src' => $src, + 'ratio' => $block->ratio()->or('auto') + ]) ?> + + caption()->isNotEmpty()): ?>
- + caption() ?>
diff --git a/site/snippets/image.php b/site/snippets/image.php new file mode 100644 index 0000000..7ea5060 --- /dev/null +++ b/site/snippets/image.php @@ -0,0 +1,12 @@ + $contain ?? false, + 'data-lightbox' => $lightbox ?? false, + 'href' => $href ?? $src, +]); + +?> +> + <?= esc($alt, 'attr') ?> +