From 96bb3550cc3ff6df3dc88790b05820268a7e1183 Mon Sep 17 00:00:00 2001 From: Stephan Date: Wed, 23 Dec 2020 15:20:35 +0100 Subject: [PATCH] Startseite aus mehreren Sections zusammengebaut, statt als einzelne Page. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Kanns später aufgebohrt werden, um außer Textwüsten z.B. Kacheln o.ä. anzuzeigen. --- content/contents.lr | 45 ++------------------------- content/section-01/contents.lr | 49 ++++++++++++++++++++++++++++++ content/section-02/contents.lr | 25 +++++++++++++++ content/section-03/contents.lr | 25 +++++++++++++++ models/multisection.ini | 10 ++++++ models/section.ini | 15 +++++++++ templates/macros/multisection.html | 5 +++ templates/multisection.html | 11 +++++++ 8 files changed, 143 insertions(+), 42 deletions(-) create mode 100644 content/section-01/contents.lr create mode 100644 content/section-02/contents.lr create mode 100644 content/section-03/contents.lr create mode 100644 models/multisection.ini create mode 100644 models/section.ini create mode 100644 templates/macros/multisection.html create mode 100644 templates/multisection.html diff --git a/content/contents.lr b/content/contents.lr index d721ea6..77675a0 100644 --- a/content/contents.lr +++ b/content/contents.lr @@ -1,43 +1,4 @@ -title: Heading 2 +_model: multisection +--- +title: Multisection --- -body: - -- Listenelement 01 - - Unterlistenelemnt 01 - - Unterunterlistenelement 01 - - Unterunterlistenelement 02 - - Unterunterlistenelement 03 -- Listenelement 02 -- Listenelement 03 - -### Heading 3 - -Absatz mit [Link](http://example.com/ "Linktitel"), weil ohne Hyperlinks ist das Web so dröge. - -#### Heading 4 - -##### Heading 5 - -###### Heading 6 - -Und nochmal eine Liste, jetzt aber eine mit Zahlen. - -1. test -2. Blub -3. Baum - -Und noch ein [Link](http://example.com/2 "Linktitel 2"), hauptsächlich, weil ich auf den Ersten schon geklickt habe und der deshalb dunkelblau (visited) ist und gar nicht mehr auffällt, was verbessert gehört. - -Lorem ipsum dolor sit amet convallis ornare elit risus facilisi vitae. Convallis eu ultricies tellus quam netus tristique volutpat. Facilisi integer luctus tellus turpis sapien scelerisque do suspendisse ultrices eu tristique sagittis pharetra. Consectetur quam justo maecenas vestibulum et tellus do aliquam hendrerit dui blandit diam. Vitae praesent aliquam convallis duis volutpat congue et praesent. - -Senectus aliqua sed pharetra nulla massa congue hac sollicitudin vestibulum. Tempus dapibus ullamcorper est quis dictumst nunc risus urna cras vestibulum convallis pellentesque elit. Eiusmod scelerisque facilisi pulvinar scelerisque morbi feugiat sollicitudin sapien etiam urna odio. Venenatis vel donec gravida mattis arcu tincidunt scelerisque adipiscing pellentesque mauris proin faucibus in porta. Nibh euismod consectetur sodales at platea dapibus integer. - -### Heading 3 - -Lorem ipsum dolor sit amet sagittis urna lobortis donec. Mi platea est vel cras vitae fames rhoncus maecenas quis velit eros purus elit blandit. Facilisis at lacinia nulla auctor sed vivamus donec. Elit scelerisque senectus at nec neque lectus morbi. Mollis quis suspendisse purus in tellus dapibus lacinia proin bibendum ultricies mollis gravida enim aenean. - -Convallis egestas id proin aliquam velit tristique egestas. Nisl ornare gravida justo praesent fusce egestas vivamus augue aliqua id vestibulum vitae fermentum. Eiusmod suspendisse eget dictumst lacus in ac vel arcu imperdiet vulputate feugiat eu hac integer. Nec blandit pretium elementum erat eiusmod fringilla ornare eros lacus erat consequat convallis condimentum fusce. Dolore leo laoreet eget tristique maecenas suspendisse platea enim hac urna fusce tellus volutpat. - -#### Heading 4 - -Tincidunt netus porta nunc tellus tincidunt dui erat dui ultricies ullamcorper euismod. Quisque imperdiet sagittis fames sodales aliqua eros lacus viverra nibh senectus aliquam pharetra risus. Tempor pharetra nunc pretium suspendisse do auctor aenean imperdiet aliquet magna. Laoreet malesuada feugiat praesent mattis hendrerit proin imperdiet habitasse. Vestibulum donec rhoncus aenean a erat leo euismod sapien tellus imperdiet nec turpis. diff --git a/content/section-01/contents.lr b/content/section-01/contents.lr new file mode 100644 index 0000000..642d76f --- /dev/null +++ b/content/section-01/contents.lr @@ -0,0 +1,49 @@ +_model: section +--- +title: 1. Section +--- +sort_key: 1 +--- +body: + +## Heading 2 + +- Listenelement 01 + - Unterlistenelemnt 01 + - Unterunterlistenelement 01 + - Unterunterlistenelement 02 + - Unterunterlistenelement 03 +- Listenelement 02 +- Listenelement 03 + +### Heading 3 + +Absatz mit [Link](http://example.com/ "Linktitel"), weil ohne Hyperlinks ist das Web so dröge. + +#### Heading 4 + +##### Heading 5 + +###### Heading 6 + +Und nochmal eine Liste, jetzt aber eine mit Zahlen. + +1. test +2. Blub +3. Baum + +Und noch ein [Link](http://example.com/2 "Linktitel 2"), hauptsächlich, weil ich auf den Ersten schon geklickt habe und der deshalb dunkelblau (visited) ist und gar nicht mehr auffällt, was verbessert gehört. + +Lorem ipsum dolor sit amet convallis ornare elit risus facilisi vitae. Convallis eu ultricies tellus quam netus tristique volutpat. Facilisi integer luctus tellus turpis sapien scelerisque do suspendisse ultrices eu tristique sagittis pharetra. Consectetur quam justo maecenas vestibulum et tellus do aliquam hendrerit dui blandit diam. Vitae praesent aliquam convallis duis volutpat congue et praesent. + +Senectus aliqua sed pharetra nulla massa congue hac sollicitudin vestibulum. Tempus dapibus ullamcorper est quis dictumst nunc risus urna cras vestibulum convallis pellentesque elit. Eiusmod scelerisque facilisi pulvinar scelerisque morbi feugiat sollicitudin sapien etiam urna odio. Venenatis vel donec gravida mattis arcu tincidunt scelerisque adipiscing pellentesque mauris proin faucibus in porta. Nibh euismod consectetur sodales at platea dapibus integer. + +### Heading 3 + +Lorem ipsum dolor sit amet sagittis urna lobortis donec. Mi platea est vel cras vitae fames rhoncus maecenas quis velit eros purus elit blandit. Facilisis at lacinia nulla auctor sed vivamus donec. Elit scelerisque senectus at nec neque lectus morbi. Mollis quis suspendisse purus in tellus dapibus lacinia proin bibendum ultricies mollis gravida enim aenean. + +Convallis egestas id proin aliquam velit tristique egestas. Nisl ornare gravida justo praesent fusce egestas vivamus augue aliqua id vestibulum vitae fermentum. Eiusmod suspendisse eget dictumst lacus in ac vel arcu imperdiet vulputate feugiat eu hac integer. Nec blandit pretium elementum erat eiusmod fringilla ornare eros lacus erat consequat convallis condimentum fusce. Dolore leo laoreet eget tristique maecenas suspendisse platea enim hac urna fusce tellus volutpat. + +#### Heading 4 + +Tincidunt netus porta nunc tellus tincidunt dui erat dui ultricies ullamcorper euismod. Quisque imperdiet sagittis fames sodales aliqua eros lacus viverra nibh senectus aliquam pharetra risus. Tempor pharetra nunc pretium suspendisse do auctor aenean imperdiet aliquet magna. Laoreet malesuada feugiat praesent mattis hendrerit proin imperdiet habitasse. Vestibulum donec rhoncus aenean a erat leo euismod sapien tellus imperdiet nec turpis. diff --git a/content/section-02/contents.lr b/content/section-02/contents.lr new file mode 100644 index 0000000..2874196 --- /dev/null +++ b/content/section-02/contents.lr @@ -0,0 +1,25 @@ +_model: section +--- +title: 2. Section +--- +sort_key: 2 +--- +body: + +## Heading 2 mit viel Text, um den Umbrauch zu testen + +Lorem ipsum dolor sit amet convallis ornare elit risus facilisi vitae. Convallis eu ultricies tellus quam netus tristique volutpat. Facilisi integer luctus tellus turpis sapien scelerisque do suspendisse ultrices eu tristique sagittis pharetra. Consectetur quam justo maecenas vestibulum et tellus do aliquam hendrerit dui blandit diam. Vitae praesent aliquam convallis duis volutpat congue et praesent. + +Senectus aliqua sed pharetra nulla massa congue hac sollicitudin vestibulum. Tempus dapibus ullamcorper est quis dictumst nunc risus urna cras vestibulum convallis pellentesque elit. Eiusmod scelerisque facilisi pulvinar scelerisque morbi feugiat sollicitudin sapien etiam urna odio. Venenatis vel donec gravida mattis arcu tincidunt scelerisque adipiscing pellentesque mauris proin faucibus in porta. Nibh euismod consectetur sodales at platea dapibus integer. + +### Heading 3 + +Lorem ipsum dolor sit amet sagittis urna lobortis donec. Mi platea est vel cras vitae fames rhoncus maecenas quis velit eros purus elit blandit. Facilisis at lacinia nulla auctor sed vivamus donec. Elit scelerisque senectus at nec neque lectus morbi. Mollis quis suspendisse purus in tellus dapibus lacinia proin bibendum ultricies mollis gravida enim aenean. + +Convallis egestas id proin aliquam velit tristique egestas. Nisl ornare gravida justo praesent fusce egestas vivamus augue aliqua id vestibulum vitae fermentum. Eiusmod suspendisse eget dictumst lacus in ac vel arcu imperdiet vulputate feugiat eu hac integer. Nec blandit pretium elementum erat eiusmod fringilla ornare eros lacus erat consequat convallis condimentum fusce. Dolore leo laoreet eget tristique maecenas suspendisse platea enim hac urna fusce tellus volutpat. + +#### Heading 4 + +Tincidunt netus porta nunc tellus tincidunt dui erat dui ultricies ullamcorper euismod. Quisque imperdiet sagittis fames sodales aliqua eros lacus viverra nibh senectus aliquam pharetra risus. Tempor pharetra nunc pretium suspendisse do auctor aenean imperdiet aliquet magna. Laoreet malesuada feugiat praesent mattis hendrerit proin imperdiet habitasse. Vestibulum donec rhoncus aenean a erat leo euismod sapien tellus imperdiet nec turpis. + +In cursus malesuada feugiat porttitor tincidunt etiam tincidunt platea enim cras mauris laoreet at. Semper ac fames cras tincidunt proin fermentum nulla maecenas sodales pellentesque scelerisque platea fermentum a. Volutpat vel fames phasellus hac fames aliquet praesent iaculis congue dictum ullamcorper tempus morbi. Leo neque labore et molestie netus interdum condimentum vivamus augue lacinia tortor scelerisque pharetra. Netus lacus malesuada do duis urna vitae gravida feugiat. diff --git a/content/section-03/contents.lr b/content/section-03/contents.lr new file mode 100644 index 0000000..04268a9 --- /dev/null +++ b/content/section-03/contents.lr @@ -0,0 +1,25 @@ +_model: section +--- +title: 3. Section +--- +sort_key: 3 +--- +body: + +## Heading + +Lorem ipsum dolor sit amet convallis ornare elit risus facilisi vitae. Convallis eu ultricies tellus quam netus tristique volutpat. Facilisi integer luctus tellus turpis sapien scelerisque do suspendisse ultrices eu tristique sagittis pharetra. Consectetur quam justo maecenas vestibulum et tellus do aliquam hendrerit dui blandit diam. Vitae praesent aliquam convallis duis volutpat congue et praesent. + +Senectus aliqua sed pharetra nulla massa congue hac sollicitudin vestibulum. Tempus dapibus ullamcorper est quis dictumst nunc risus urna cras vestibulum convallis pellentesque elit. Eiusmod scelerisque facilisi pulvinar scelerisque morbi feugiat sollicitudin sapien etiam urna odio. Venenatis vel donec gravida mattis arcu tincidunt scelerisque adipiscing pellentesque mauris proin faucibus in porta. Nibh euismod consectetur sodales at platea dapibus integer. + +### Heading 3 + +Lorem ipsum dolor sit amet sagittis urna lobortis donec. Mi platea est vel cras vitae fames rhoncus maecenas quis velit eros purus elit blandit. Facilisis at lacinia nulla auctor sed vivamus donec. Elit scelerisque senectus at nec neque lectus morbi. Mollis quis suspendisse purus in tellus dapibus lacinia proin bibendum ultricies mollis gravida enim aenean. + +Convallis egestas id proin aliquam velit tristique egestas. Nisl ornare gravida justo praesent fusce egestas vivamus augue aliqua id vestibulum vitae fermentum. Eiusmod suspendisse eget dictumst lacus in ac vel arcu imperdiet vulputate feugiat eu hac integer. Nec blandit pretium elementum erat eiusmod fringilla ornare eros lacus erat consequat convallis condimentum fusce. Dolore leo laoreet eget tristique maecenas suspendisse platea enim hac urna fusce tellus volutpat. + +#### Heading 4 + +Tincidunt netus porta nunc tellus tincidunt dui erat dui ultricies ullamcorper euismod. Quisque imperdiet sagittis fames sodales aliqua eros lacus viverra nibh senectus aliquam pharetra risus. Tempor pharetra nunc pretium suspendisse do auctor aenean imperdiet aliquet magna. Laoreet malesuada feugiat praesent mattis hendrerit proin imperdiet habitasse. Vestibulum donec rhoncus aenean a erat leo euismod sapien tellus imperdiet nec turpis. + +In cursus malesuada feugiat porttitor tincidunt etiam tincidunt platea enim cras mauris laoreet at. Semper ac fames cras tincidunt proin fermentum nulla maecenas sodales pellentesque scelerisque platea fermentum a. Volutpat vel fames phasellus hac fames aliquet praesent iaculis congue dictum ullamcorper tempus morbi. Leo neque labore et molestie netus interdum condimentum vivamus augue lacinia tortor scelerisque pharetra. Netus lacus malesuada do duis urna vitae gravida feugiat. diff --git a/models/multisection.ini b/models/multisection.ini new file mode 100644 index 0000000..6fc4ef1 --- /dev/null +++ b/models/multisection.ini @@ -0,0 +1,10 @@ +[model] +name = Multisection +label = Multisection + +[fields.title] +label = Title +type = string + +[children] +order_by = sort_key diff --git a/models/section.ini b/models/section.ini new file mode 100644 index 0000000..6656936 --- /dev/null +++ b/models/section.ini @@ -0,0 +1,15 @@ +[model] +name = Section +label = {{ this.title }} + +[fields.title] +label = Title +type = string + +[fields.body] +label = Body +type = markdown + +[fields.sort_key] +label = Sort order +type = sort_key \ No newline at end of file diff --git a/templates/macros/multisection.html b/templates/macros/multisection.html new file mode 100644 index 0000000..1ecb8d7 --- /dev/null +++ b/templates/macros/multisection.html @@ -0,0 +1,5 @@ +{% macro render_section(section) %} +
+ {{ section.body }} +
+{% endmacro %} diff --git a/templates/multisection.html b/templates/multisection.html new file mode 100644 index 0000000..3b5617a --- /dev/null +++ b/templates/multisection.html @@ -0,0 +1,11 @@ +{% extends "layout.html" %} +{% from "macros/multisection.html" import render_section %} +{% block body %} + {% for child in this.children %} + {% if child._model == 'section' %} +
+ {{ render_section(child) }} +
+ {% endif %} + {% endfor %} +{% endblock %}