Improvements to projects and dynamic image resizing

This commit is contained in:
2025-01-19 21:19:45 +00:00
parent 56e771c454
commit b91245c8a1
7 changed files with 67 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
{% include 'header.html' %}
<main>
<section id="tech-article">
<section id="article">
<h1>{{ metadata.title}} </h1>
<p>{{ metadata.date | human_date }}</p>
<hr />

View File

@@ -15,7 +15,17 @@
<section id="projects">
{% for row in articles %}
<div class="project">
<img class="project-thumb" src="/projects/image/{{ row.image }}">
<img class="project-thumb"
srcset="
{% for i in range(200, 5100, 100) %}
/projects/image/{{ row.image }}?w={{i}} {{i}}w{{"," if not loop.last}}
{% endfor %}
"
sizes="
(max-width: 999px) 80vw,
(min-width: 1000px) 20vw
"
src="/projects/image/{{ row.image }}">
<div class="project-text">
{% if row.get('link') is not none %}
<a href="{{ row.link }}">