Fix using databag for featured proj

This commit is contained in:
HackerNCoder 2022-10-27 20:03:10 +02:00
parent 27bd6e7d79
commit 84deb41dbf
3 changed files with 9 additions and 8 deletions

View file

@ -1,8 +1,9 @@
[lucahboad]
title = Lucah Born Of A Dream
path = /projects/lucahboad/
path = "/projects/lucahboad/"
sort_key = 0
[butterflysoup]
title = Butterfly Soup
path = /projects/butterflysoup/
path = "/projects/butterflysoup/"
sort_key = 1

View file

@ -6,15 +6,15 @@
<section class="projects-section bg-light" id="projects">
<div class="container px-4 px-lg-5">
{% for id, item in bag('featured').items() %}
{% set image = url(item.path+'main.jpg') %}
{% set image = item.path+'main.jpg' %}
<div class="row gx-0 mb-5 mb-md-0 justify-content-center">
<div class="col-lg-6"><img class="img-fluid" src="{{ image }}" alt="project image" /></div>
<div class="col-lg-6 {% if item.sort_key % 2 == 0 or item.sort_key == 0 %} order-lg-first {% endif %} ">
<div class="col-lg-6"><img class="img-fluid" src="{{ image|url }}" alt="project image" /></div>
<div class="col-lg-6 {% if item.sort_key|int % 2 == 0 or item.sort_key|int == 0 %} order-lg-first {% endif %} ">
<div class="bg-black text-center h-100 project">
<div class="d-flex h-100">
<div class="my-4 my-lg-auto w-100 text-center">
<h2 class="text-white mb-5">{{ item.title }}</h2>
<a href="{{ path|url }}" class="btn btn-primary"><i class="fa fa-search" aria-hidden="true"></i> {{ _("Details") }}</a>
<a href="{{ item.path|url }}" class="btn btn-primary"><i class="fa fa-search" aria-hidden="true"></i> {{ _("Details") }}</a>
</div>
</div>
</div>

0
templates/projects.html Normal file
View file