diff --git a/README.MD b/README.MD index dfe7709..5545ce2 100644 --- a/README.MD +++ b/README.MD @@ -22,20 +22,22 @@ Datei im Eventverzeichnis Anlegen: *YYYY-MM-DD.html* ``` -title: Event Titel -date: Event Datum -desc: Event Beschreibung +Blogpost Titel +Blogpost Beschreibung +Blogpost Datum +Blogpost Autor ------------------------ -#Content below here! +# Content below here! ``` Strukturierung: - Header ``` -title: Event Titel -date: Event Datum -desc: Event Beschreibung +Blogpost Titel +Blogpost Beschreibung +Blogpost Datum +Blogpost Autor ``` - Trenner zwischen Header und Content @@ -43,15 +45,13 @@ desc: Event Beschreibung ------------------------ ``` -- Kommentar +- Content ``` -#Content below here! +# Content below here! ``` -Unter dem Trenner kann HTML verwendet werden. +Unter dem Trenner kann Markdown verwendet werden. -Eigenes CSS kann in der Datei *events_custom.css* hinzugefügt werden. - -Neue Bilder kommen in das Verzeichnis */images/* +Bilder für Posts kommen in das Verzeichnis */images/posts/* [Event Dokumentation](https://git.ctdo.de/xoy/ctdo.de/src/branch/master/EVENT.MD) \ No newline at end of file diff --git a/css/event.css b/css/event.css new file mode 100644 index 0000000..27452e9 --- /dev/null +++ b/css/event.css @@ -0,0 +1,4 @@ +img { + display: block; + margin: auto; +} \ No newline at end of file diff --git a/css/events.css b/css/events.css index 78fe957..852d59f 100644 --- a/css/events.css +++ b/css/events.css @@ -16,7 +16,17 @@ div.eventblock a:hover { } div.eventblock h3 { - right: 10px; - top: 0; - position: absolute; + margin: 0; +} + +div.eventblock h3.a { + text-align: left; + width: 50%; + display: inline-block; +} + +div.eventblock h3.b { + text-align: right; + width: 50%; + display: inline-block; } \ No newline at end of file diff --git a/css/main.css b/css/main.css index 8751df7..b82cad1 100644 --- a/css/main.css +++ b/css/main.css @@ -183,7 +183,7 @@ a.green-text { nav ul li { display: block; font-size: 200%; - padding: 20px 20px 20px 0; + padding: 30px 100px 30px 0; text-align: right; } diff --git a/events/2023-12-24.md b/events/2023-12-24.md deleted file mode 100644 index 69034c7..0000000 --- a/events/2023-12-24.md +++ /dev/null @@ -1,6 +0,0 @@ -Weihnachten -Weihnachten halt. ------------------------- -# Weihnachten - -Ist halt Weihnachten. \ No newline at end of file diff --git a/images/posts/DORTBUNT.nebenan_Banner-fuer-Anmeldende-768x154.png b/images/posts/DORTBUNT.nebenan_Banner-fuer-Anmeldende-768x154.png new file mode 100644 index 0000000..cbeb604 Binary files /dev/null and b/images/posts/DORTBUNT.nebenan_Banner-fuer-Anmeldende-768x154.png differ diff --git a/index.php b/index.php index 2ffdca4..58f5d75 100644 --- a/index.php +++ b/index.php @@ -30,8 +30,8 @@ $nextevents = $twig_templates->render('nextevents.html.twig'); $raumstatus_b = $util->raumstatus(); $raumstatus = 'unbekannt'; -$pages = array('index', 'about', 'treff', 'events', 'kontakt', 'support', 'verein'); -$page_names = array('index', 'über uns', 'zeiten & location', 'events', 'kontakt', 'support', 'verein'); +$pages = array('index', 'about', 'treff', 'blog', 'events', 'kontakt', 'support', 'verein'); +$page_names = array('index', 'über uns', 'zeiten & location', 'blog', 'events', 'kontakt', 'support', 'verein'); $active_page = ''; @@ -42,13 +42,26 @@ if(gettype($raumstatus_b) == "boolean") { $raumstatus = $util->html_link('https://status.ctdo.de/', 'red-text', 'geschlossen', TRUE); } +$topic = $util->get_next_topic(); +switch ($topic->days) { + case 0: + $topic_output = '
Der nächste Topictreff findet heute statt!
'; + break; + case 1: + $topic_output = 'Der nächste Topictreff findet morgen statt!
'; + break; + default: + $topic_output = 'Der nächste Topictreff findet in '.$topic->days.' Tagen ['.$topic->date.'] statt.
'; + break; +} + if(isset($_GET['page'])) { $page = $_GET['page']; $active_page = $util->str_mass_replace(array('adresse', 'irc', 'mail'), array('kontakt', 'kontakt', 'kontakt'), $page); $title = $page_names[array_search($active_page, $pages)]; switch ($page) { case 'index': - $content = $twig_pages->render('index.html.twig'); + $content = $twig_pages->render('index.html.twig', [ 'topic' => $topic_output, 'posts' => $util->generate_post_list(4) ]); $head = $util->css_link('css/main.css').$util->css_link('css/home.css').$util->css_link('css/events.css'); break; case 'about': @@ -59,13 +72,22 @@ if(isset($_GET['page'])) { $content = $twig_pages->render('treff.html.twig'); $head = $util->css_link('css/main.css'); break; - case 'events': - if(!isset($_GET['e'])) { - $content = $twig_pages->render('events.html.twig', [ 'events' => $util->generate_event_list() ]); + case 'blog': + if(!isset($_GET['id'])) { + $content = $twig_pages->render('blog.html.twig', [ 'posts' => $util->generate_post_list() ]); $head = $util->css_link('css/main.css').$util->css_link('css/events.css'); } else { - $content = $converter->convert($util->get_event_content($_GET['e'])); - $head = $util->css_link('css/main.css'); + $content = $converter->convert($util->get_post_content($_GET['id'])); + $head = $util->css_link('css/main.css').$util->css_link('css/event.css'); + } + break; + case 'events': + if(!isset($_GET['e'])) { + $content = $twig_pages->render('events.html.twig', [ 'topic' => $topic_output, 'events' => $util->generate_post_list() ]); + $head = $util->css_link('css/main.css').$util->css_link('css/events.css'); + } else { + $content = $converter->convert($util->get_post_content($_GET['e'])); + $head = $util->css_link('css/main.css').$util->css_link('css/event.css'); } break; case 'kontakt': @@ -113,7 +135,7 @@ if(isset($_GET['page'])) { } else { $active_page = 'index'; $title = $active_page; - $content = $twig_pages->render('index.html.twig'); + $content = $twig_pages->render('index.html.twig', [ 'topic' => $topic_output, 'posts' => $util->generate_post_list(4) ]); $head = $util->css_link('css/main.css').$util->css_link('css/home.css').$util->css_link('css/events.css'); } diff --git a/pages/blog.html.twig b/pages/blog.html.twig new file mode 100644 index 0000000..72d5716 --- /dev/null +++ b/pages/blog.html.twig @@ -0,0 +1,2 @@ +'.$desc.'
'.$desc.'