From 275ac1d8cc4b7071bc78d992df07af6205e62b66 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 20 May 2020 17:39:42 +0200 Subject: [PATCH] [TASK] Layout-Anpassungen --- .../partials/blogroll.twig | 38 +++++++++++++----- .../chrosey_materialize/partials/images.twig | 27 ++++++------- .../chrosey_materialize/partials/macros.twig | 15 +++---- .../chrosey_materialize/templates/blog.twig | 40 ++++++------------- .../templates/blogitem.twig | 24 ++++++----- .../chrosey_materialize/templates/home.twig | 17 +++----- .../templates/layout/base.twig | 12 ++++++ config/config.yml | 6 ++- 8 files changed, 96 insertions(+), 83 deletions(-) diff --git a/Packages/chrosey_materialize/partials/blogroll.twig b/Packages/chrosey_materialize/partials/blogroll.twig index 7dad05b..d1b51f8 100644 --- a/Packages/chrosey_materialize/partials/blogroll.twig +++ b/Packages/chrosey_materialize/partials/blogroll.twig @@ -1,11 +1,31 @@ +{% import "partials/macros.twig" as macros %} + +{% set amount = amount ? amount : 20 %} + {% block blogroll %} - +
+ {% for page in pages("blog", depth=2) | sort_by( 'time' ) | reverse | slice(0,amount) %} +
+
+
+ {{ macros.variants( theme_url ~ "/img/categories/" ~ page.meta.categories.0 ~ ".jpg") }} + + chevron_right + +
+
+

{{ page.date }}

+
+ {{ page.title }}
+

+ {{ page.description }}

+
+ + +
+
+ {% endfor %} +
{% endblock %} diff --git a/Packages/chrosey_materialize/partials/images.twig b/Packages/chrosey_materialize/partials/images.twig index 17350d8..5affa39 100644 --- a/Packages/chrosey_materialize/partials/images.twig +++ b/Packages/chrosey_materialize/partials/images.twig @@ -1,19 +1,18 @@ {% import "partials/macros.twig" as macros %} {% block images %} -
- {% if images | length > 1 %} - - {% else %} - {{ macros.variants(images.0.url, images.0.preview, images.0.alt, 200, 50, "materialboxed" ) }} - {% endif %} -
+
+ {% if images | length > 1 %} + + {% else %} + {{ macros.variants(images.0.url, images.0.preview, images.0.alt, 300, 400, "materialboxed " ) }} + {% endif %} +
{% endblock %} diff --git a/Packages/chrosey_materialize/partials/macros.twig b/Packages/chrosey_materialize/partials/macros.twig index d45aad0..f26bdd9 100644 --- a/Packages/chrosey_materialize/partials/macros.twig +++ b/Packages/chrosey_materialize/partials/macros.twig @@ -1,12 +1,7 @@ -{% macro variants(fullImage,preview,alt="",height,width,class="") %} +{% macro variants(fullImage,preview=null,alt="",height=300,width=400,class="") %} -{% set preview = preview!="" ? preview : fullImage %} -
- {{ alt}} -
+ {% set preview = preview!="" ? preview : fullImage %} +
+ {{ alt}} +
{% endmacro %} diff --git a/Packages/chrosey_materialize/templates/blog.twig b/Packages/chrosey_materialize/templates/blog.twig index 41d6a19..83d03aa 100644 --- a/Packages/chrosey_materialize/templates/blog.twig +++ b/Packages/chrosey_materialize/templates/blog.twig @@ -1,33 +1,19 @@ {% extends "templates/layout/base.twig" %} -{% import "partials/macros.twig" as macros %} {% block content %} -{{parent()}} + {{parent()}} -{% block blogroll %} -
- {% for page in pages("blog", depth=2) | sort_by( 'time' ) | reverse %} -
-
-
- {{ macros.variants(images.0.url, images.0.url, images.0.alt, 200, 50 ) }} - chevron_right -
-
-

{{ page.date }}

-
{{ page.title }}
-

{{ page.description }}

-
- +
+
+
+ {% include "partials/blogroll.twig" %} +
+
+
-
-
- {% endfor %} -
-{% endblock %} +
+
+
+
+
{% endblock %} diff --git a/Packages/chrosey_materialize/templates/blogitem.twig b/Packages/chrosey_materialize/templates/blogitem.twig index c6ccde9..1e1b1d0 100644 --- a/Packages/chrosey_materialize/templates/blogitem.twig +++ b/Packages/chrosey_materialize/templates/blogitem.twig @@ -1,14 +1,18 @@ {% extends "templates/blog.twig" %} {% block content %} -
- {{content}} -
-
- {% include "partials/images.twig" %} -
-
- Zurück -
+
+
+
+ {{content}} +
+
+ {% include "partials/images.twig" %} +
+
+ Zurück +
+
+
+ {% endblock %} diff --git a/Packages/chrosey_materialize/templates/home.twig b/Packages/chrosey_materialize/templates/home.twig index e0b47f7..6887ffe 100644 --- a/Packages/chrosey_materialize/templates/home.twig +++ b/Packages/chrosey_materialize/templates/home.twig @@ -1,18 +1,13 @@ {% extends "templates/layout/base.twig" %} {% block content %} -
+
- {{parent()}} - {% for section in meta.sections %} -
-
-
-
-

{{section.title}}

- {{ section.text }} -
- {% endfor %} + +
+ {% include "partials/blogroll.twig" with { amount: 4 } %} +
+ {% endblock %} diff --git a/Packages/chrosey_materialize/templates/layout/base.twig b/Packages/chrosey_materialize/templates/layout/base.twig index c54e5b7..256b0b6 100644 --- a/Packages/chrosey_materialize/templates/layout/base.twig +++ b/Packages/chrosey_materialize/templates/layout/base.twig @@ -42,6 +42,18 @@
{% endblock %} + {% block sections %} + {% for section in meta.sections %} +
+
+
+
+

{{section.title}}

+ {{ section.text }} +
+ {% endfor %} + + {% endblock %} {% include "templates/layout/footer.twig" %} {% block js %} diff --git a/config/config.yml b/config/config.yml index 944f126..e05dcdb 100644 --- a/config/config.yml +++ b/config/config.yml @@ -18,13 +18,15 @@ themes_url: # If this fails, override it here. Example: https://example.com/pico/themes/ theme_config: # Additional theme-specific config widescreen: false # Default theme: Use more horizontal space (i.e. make the site container wider) - color: white + color: white # Color for Navbar and Footer + primary_color: orange # Color for Buttons and links if not defined + secondary_color: indigocategories # Color for Buttons and links if not defined twig_config: # Twig template engine config autoescape: html # Let Twig escape variables by default strict_variables: false # If set to true, Twig will bail out when unset variables are being used charset: utf-8 # The charset used by Twig templates debug: ~ # Enable Twig's debug mode - cache: cache # Enable Twig template caching by specifying a path to a writable directory + cache: false # Enable Twig template caching by specifying a path to a writable directory auto_reload: true # Recompile Twig templates whenever the source code changes ##