try some photo gallery stuff

This commit is contained in:
CherryKitten 2024-06-07 13:04:31 +02:00
parent 63d481643e
commit c3e8ed233f
Signed by: sammy
GPG key ID: 98D8F75FB0658276
37 changed files with 64 additions and 0 deletions

View file

@ -0,0 +1,6 @@
+++
paginate_by = 4
sort_by = "date"
template = "index.html"
title = "Photo gallery"
+++

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 MiB

View file

@ -0,0 +1,10 @@
+++
title = "Photo gallery Test photos number two"
template = "gallery.html"
date = 2024-06-07
+++
Another few photos for testing my new gallery layout
{{ gallery() }}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 MiB

View file

@ -0,0 +1,10 @@
+++
title = "Photo gallery Test photos"
template = "gallery.html"
date = 2024-06-06
+++
All photos shot on a phone camera over the last years.
{{ gallery() }}

14
sass/gallery.scss Normal file
View file

@ -0,0 +1,14 @@
@import "variables";
.gallery {
display: grid;
grid-auto-flow: row dense;
grid-auto-rows: 1fr;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: 1fr 1fr 1fr;
gap: 2em 2em;
grid-template-areas:
". . ."
". . ."
". . .";
}

View file

@ -4,5 +4,6 @@
@import 'logo';
@import 'main';
@import 'post';
@import 'gallery';
@import 'pagination';
@import 'footer';

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

13
templates/gallery.html Normal file
View file

@ -0,0 +1,13 @@
{% extends "index.html" %}
{%- block title -%}
{{ title_macros::title(page_title=page.title, main_title=config.title) }}
{%- endblock -%}
{% block content %}
<div class="post">
{{ post_macros::header(page=page) }}
{{ post_macros::content(page=page, summary=false) }}
{{ post_macros::earlier_later(page=page) }}
</div>
{% endblock content %}

View file

@ -0,0 +1,10 @@
<div class="gallery">
{% for asset in page.assets -%}
{%- if asset is matching("[.](jpg|png)$") -%}
{% set image = resize_image(path=asset, width=960, height=720, op="fit") %}
<a href="{{ get_url(path=asset) }}" target="_blank">
<img src="{{ image.url }}" />
</a>
{%- endif %}
{%- endfor %}
</div>