From fa3ee032c8f47694d9e5a84d3c850ba1a06dcf90 Mon Sep 17 00:00:00 2001 From: fuzoh Date: Fri, 2 Feb 2024 06:34:30 +0100 Subject: [PATCH] feat: Add default list --- public/index.php | 4 ++-- tailwind.config.js | 8 ++++++- templates/home.twig | 50 +++++++++++++++++++++++++++++++++++++++- templates/layout.twig | 53 +++++++++++++++++++++++++++++++++++++++---- 4 files changed, 107 insertions(+), 8 deletions(-) diff --git a/public/index.php b/public/index.php index de5e14a..aed3e60 100644 --- a/public/index.php +++ b/public/index.php @@ -10,7 +10,7 @@ $app = AppFactory::create(); -$twig = Twig::create(__DIR__ . '/../templates', ['cache' => __DIR__ . '/../cache']); +$twig = Twig::create(__DIR__ . '/../templates', ['cache' => false/*__DIR__ . '/../cache'*/]); $app->addRoutingMiddleware(); $app->add(TwigMiddleware::create($app, $twig)); @@ -22,7 +22,7 @@ */ $app->get('/', function (Request $request, Response $response, $args) { return Twig::fromRequest($request)->render($response, 'home.twig'); -}); +})->setName('home'); // Run app $app->run(); diff --git a/tailwind.config.js b/tailwind.config.js index d3c0db4..ed4ebd9 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,8 +1,14 @@ +const defaultTheme = require('tailwindcss/defaultTheme') + /** @type {import('tailwindcss').Config} */ module.exports = { content: ["./templates/**/*.{html,twig,js,ts}"], theme: { - extend: {}, + extend: { + fontFamily: { + sans: ['Inter var', ...defaultTheme.fontFamily.sans], + }, + }, }, plugins: [], } diff --git a/templates/home.twig b/templates/home.twig index 31d84ca..1ebf9b4 100644 --- a/templates/home.twig +++ b/templates/home.twig @@ -1,5 +1,53 @@ {% extends "layout.twig" %} +{% block title %} + Todos +{% endblock %} + {% block content %} -

Bonjour

+ {% endblock %} diff --git a/templates/layout.twig b/templates/layout.twig index 295f228..8edb774 100644 --- a/templates/layout.twig +++ b/templates/layout.twig @@ -1,16 +1,61 @@ - + Document + -
- {% block content %}{% endblock %} -
+
+ + +
+
+
+

{% block title %}{% endblock %}

+
+
+
+
+ {% block content %}{% endblock %} +
+
+
+