From 30c0ff72cf632ea6fa896f57786746eb955a36ee Mon Sep 17 00:00:00 2001 From: Are0h Date: Wed, 21 Apr 2021 12:47:15 -0700 Subject: [PATCH] converted tag template to twig --- index.php | 15 ++++++++++--- .../fipamo-default/tags.pug | 13 ------------ .../fipamo-default/tags.twig | 21 +++++++++++++++++++ 3 files changed, 33 insertions(+), 16 deletions(-) delete mode 100644 src/themes/theme-fipamo-default/fipamo-default/tags.pug create mode 100644 src/themes/theme-fipamo-default/fipamo-default/tags.twig diff --git a/index.php b/index.php index 7815ed9..f1d953a 100644 --- a/index.php +++ b/index.php @@ -33,9 +33,18 @@ class ThemeEngine ] ); break; - case "": - require __DIR__ . "/views/index.php"; - break; + case "/tags": + $tags = $this->data["tag_list"]; + echo $this->twig->render( + "theme-fipamo-default/fipamo-default/tags.twig", + [ + "debug" => true, + "title" => "Pages Tagged as Tag", + "background" => + "/src/themes/theme-fipamo-default/fipamo-default/assets/images/global/default-bg.jpg", + "tag_list" => $tags, + ] + ); case "/archive": $archive = $this->data["archives"]; echo $this->twig->render( diff --git a/src/themes/theme-fipamo-default/fipamo-default/tags.pug b/src/themes/theme-fipamo-default/fipamo-default/tags.pug deleted file mode 100644 index b842071..0000000 --- a/src/themes/theme-fipamo-default/fipamo-default/tags.pug +++ /dev/null @@ -1,13 +0,0 @@ -extends frame - -block main-content - section - .page-title - span= title - article - .page - br - - var index = 0; - - for ( index; index < tag_list.length; index++) - a(href='/'+tag_list[index].path+'/'+tag_list[index].slug) !{tag_list[index].title} - br diff --git a/src/themes/theme-fipamo-default/fipamo-default/tags.twig b/src/themes/theme-fipamo-default/fipamo-default/tags.twig new file mode 100644 index 0000000..46b0ffb --- /dev/null +++ b/src/themes/theme-fipamo-default/fipamo-default/tags.twig @@ -0,0 +1,21 @@ +{% extends "theme-fipamo-default/fipamo-default/frame.twig" %} + +{% block title %} + {{ title }} +{% endblock %} + + {% block mainContent %} +
+
+ {{title}} +
+
+
+
+ {% for tag in tag_list %} + {{tag.title}}
+ {% endfor %} + +
+
+ {% endblock %} \ No newline at end of file