Create components for project cards

This commit is contained in:
TheThomaas 2024-02-10 21:08:57 +01:00
parent fdb14d6a35
commit 0d648729f7
3 changed files with 28 additions and 20 deletions

View file

@ -0,0 +1,16 @@
<li>
<article class="card" {% if background %}style="--background: {{ background }}"{% endif %}>
<div class="top">
<span></span>
<div class="links">
{%- for link in links -%}
<a href="{{ link.link }}" target="_blank" title="{{ link.title }}" class="{{ link.icon }}"></a>
{%- endfor -%}
</div>
</div>
<div class="content">
<h3>{{ title }}</h3>
<p>{{ description }}</p>
</div>
</article>
</li>

View file

@ -0,0 +1,12 @@
{% if projects %}
<ul class="project-grid">
{%- for project in projects -%}
{% assign data = project.data %}
{% render "partials/components/card",
background: data.background,
links: data.links,
title: data.title,
description: data.description %}
{%- endfor -%}
</ul>
{% endif %}

View file

@ -1,20 +0,0 @@
<ul>
{%- for project in projects -%}
<li>
<article {% if project.data.background %}style="--background: {{ project.data.background }}"{% endif %}>
<div class="top">
<span></span>
<div class="links">
{%- for link in project.data.links -%}
<a href="{{ link.link }}" target="_blank" title="{{ link.title }}" class="{{ link.icon }}"></a>
{%- endfor -%}
</div>
</div>
<div class="content">
<h3>{{ project.data.title }}</h3>
<p>{{ project.data.description }}</p>
</div>
</article>
</li>
{%- endfor -%}
</ul>