From 27bd6e7d79338cc6af650affd1ef09332e71fa89 Mon Sep 17 00:00:00 2001 From: HackerNCoder Date: Thu, 27 Oct 2022 19:50:16 +0200 Subject: [PATCH] Attempt to use a databag for featured projects --- .../projects/butterflysoup/{image.jpg => main.jpg} | Bin databags/featured.ini | 8 ++++++++ models/index.ini | 3 --- templates/index.html | 12 ++++++------ 4 files changed, 14 insertions(+), 9 deletions(-) rename content/projects/butterflysoup/{image.jpg => main.jpg} (100%) create mode 100644 databags/featured.ini diff --git a/content/projects/butterflysoup/image.jpg b/content/projects/butterflysoup/main.jpg similarity index 100% rename from content/projects/butterflysoup/image.jpg rename to content/projects/butterflysoup/main.jpg diff --git a/databags/featured.ini b/databags/featured.ini new file mode 100644 index 0000000..29d1aae --- /dev/null +++ b/databags/featured.ini @@ -0,0 +1,8 @@ +[lucahboad] +title = Lucah Born Of A Dream +path = /projects/lucahboad/ +sort_key = 0 +[butterflysoup] +title = Butterfly Soup +path = /projects/butterflysoup/ +sort_key = 1 diff --git a/models/index.ini b/models/index.ini index 0c9733d..adaa9e0 100644 --- a/models/index.ini +++ b/models/index.ini @@ -16,6 +16,3 @@ translate = True [fields.join_title] type = string translate = True - -[children] -replaced_with = site.query('/projects') diff --git a/templates/index.html b/templates/index.html index 8513c6a..21e0ed6 100644 --- a/templates/index.html +++ b/templates/index.html @@ -5,16 +5,16 @@
- {% for project in this.children %} - {% set image = project.attachments.images.first() %} + {% for id, item in bag('featured').items() %} + {% set image = url(item.path+'main.jpg') %}
-
project image
-
+
project image
+
-

{{ project.title }}

- {{ _("Details") }} +

{{ item.title }}

+ {{ _("Details") }}