From 9248f94f28e0eee3c4107365dd9e79221913baf0 Mon Sep 17 00:00:00 2001 From: Andros Fenollosa Date: Fri, 21 Jul 2023 10:32:25 +0200 Subject: [PATCH] Add layout template --- app/public/views.py | 2 +- templates/layouts/base.html | 124 ++++++++++++++++++++++++++++++++++++ templates/pages/home.html | 15 +++++ 3 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 templates/layouts/base.html create mode 100644 templates/pages/home.html diff --git a/app/public/views.py b/app/public/views.py index 7061bb6..a82b077 100644 --- a/app/public/views.py +++ b/app/public/views.py @@ -2,4 +2,4 @@ from django.shortcuts import render # Create your views here. def home(request): - return render(request, "home.html") + return render(request, "pages/home.html") diff --git a/templates/layouts/base.html b/templates/layouts/base.html new file mode 100644 index 0000000..a28c20a --- /dev/null +++ b/templates/layouts/base.html @@ -0,0 +1,124 @@ +{% load static i18n %} +{% get_current_language as LANGUAGE_CODE %} + + + + + + {% block title %}{% endblock %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {% block content %}{% endblock %} + + diff --git a/templates/pages/home.html b/templates/pages/home.html new file mode 100644 index 0000000..e621ddb --- /dev/null +++ b/templates/pages/home.html @@ -0,0 +1,15 @@ +{% extends "layouts/base.html" %} + +{% load static %} + +{% block title %}Titulo{% endblock %} + +{% block description %}Titulo{% endblock %} + +{% block og-title %}Title{% endblock %} + +{% block og-image %}{% static 'images/hi.jpg' %}{% endblock %} + +{% block content %} +

Hi

+{% endblock %}