Add expand feature to subprojects

This commit is contained in:
david-swift 2025-03-11 21:55:33 +01:00
parent be8a904508
commit 449429cf75
4 changed files with 17 additions and 6 deletions

View File

@ -1,11 +1,10 @@
+++ +++
weight = 1 weight = 2
title = "Blogs" title = "Blogs"
description = "Duckling offers the blogs feature borrowed from Duckquill 🦆" description = "Duckling offers the blogs feature borrowed from Duckquill 🦆"
[taxonomies] [taxonomies]
tags = ["Demo", "Test"] tags = ["Demo", "Test"]
[extra] [extra]
preview = "duckling.jpg" preview = "duckling.jpg"
url = "/blog"
+++ +++
Check out the [sample blog](/blog) to see the blogging feature in action!

View File

@ -1,5 +1,5 @@
+++ +++
weight = 2 weight = 1
title = "Subprojects" title = "Subprojects"
description = "Showcase parts of your project!" description = "Showcase parts of your project!"
[taxonomies] [taxonomies]
@ -7,8 +7,13 @@ tags = ["Demo", "Test"]
[extra] [extra]
preview = "duckling.jpg" preview = "duckling.jpg"
badge = "New" badge = "New"
expand = true
+++ +++
I'm an example for a subproject! I'm an example for a subproject!
The [subprojects page](/subprojects) shows multiple subprojects in a grid. The [subprojects page](/subprojects) shows multiple subprojects in a grid.
<br>
{{ image(url="duckling.jpg", alt="This is an image", no_hover=true) }}

View File

@ -3,7 +3,6 @@
flex-wrap: wrap; flex-wrap: wrap;
article { article {
width: calc(50% - 0.5rem);
min-width: 300px; min-width: 300px;
flex-grow: 1; flex-grow: 1;
@ -22,6 +21,14 @@
} }
} }
article:not(.expand) {
width: calc(50% - 0.5rem);
}
.expand {
flex-grow: 2;
}
.badge { .badge {
color: var(--accent-color); color: var(--accent-color);
pointer-events: none; pointer-events: none;

View File

@ -1,6 +1,6 @@
<div id="subproject-list"> <div id="subproject-list">
{%- for page in section.pages %} {%- for page in section.pages %}
<article> <article class="{%- if page.extra.expand -%}expand{%- endif -%}">
{%- if page.extra.url -%} {%- if page.extra.url -%}
<a href="{{ page.extra.url }}"></a> <a href="{{ page.extra.url }}"></a>
{%- else -%} {%- else -%}