From 6039f3f856d526b70005da272059664f456bf5b2 Mon Sep 17 00:00:00 2001 From: Yannik Schmidt Date: Fri, 28 Aug 2020 12:08:54 +0200 Subject: [PATCH] Update readme and examples --- README.md | 17 +++++++++-------- content.example/subpages.json | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 55722e2..cf0f7f2 100644 --- a/README.md +++ b/README.md @@ -38,18 +38,18 @@ Finally it MAY contain a text to display on the button leading to the article (o Obviously the markdown file referenced in the configuration must also be created. ### Other Sections -All following sections are read and created from the *vereinSection* directory. Json configuration for these sections much contain these information. The pictures for all the sections should have a similar aspect ratio. +All following sections are read and created from the *sections* directory. Json configuration for these sections must contain the following information. The pictures for all the sections should have a similar aspect ratios. { "picture" : "path to a picture for this section", "title" : "A title for this card", - "text" : "A potentially very long text of multiple lines that will be displayed next to the picture...", + "text" : "A potentially long text with multiple lines that will be displayed next to the picture...", } The configuration may contain the following information, which add a button-like link to the section. "moreInfoButtonText" : "less than 25 charaters", - "moreInfoButtonHref" : "href to go to" + "moreInfoButtonHref" : "/href/to/go/to" The alpha-numeric order of the filenames specifies the order in which the sections will be displayed on the website, so the files should be prefixed with a number, for example *10_section_hello.json* and *90_section_ending.json*. @@ -66,10 +66,11 @@ To display a person on the people-subpage create a JSON-file in the *people/*-di The order is again specified by the alpha-numeric order of the files. # Adding new Subpages -New subpages must be added as a new location in the *server.py* like this: +You can add new subpages in the *content*-location via a *subpages.json* file denoting an identifier as key and a HTML-template as value, like this: - @app.route("/subpage") - def subpage(): - return flask.render_template("subpage.html", conf=mainConfig) + { + "identifiert-1" : "html-template-1.html", + "identifiert-2" : "html-template-2.html" + } -See the example *subpage\_example.html* in *templates/*. +The templates referenced here must be located in a *subpages/* directory and will be made availiable at */content?id=identifier*. diff --git a/content.example/subpages.json b/content.example/subpages.json index 339d6a9..9fe1e4a 100644 --- a/content.example/subpages.json +++ b/content.example/subpages.json @@ -1,3 +1,3 @@ { - "example" : "example_subpage_content.html" + "identifiert-1" : "example_subpage_content.html" }