Add layout template

This commit is contained in:
Andros Fenollosa 2023-07-21 10:32:25 +02:00
parent 516483c865
commit 9248f94f28
3 changed files with 140 additions and 1 deletions

View File

@ -2,4 +2,4 @@ from django.shortcuts import render
# Create your views here. # Create your views here.
def home(request): def home(request):
return render(request, "home.html") return render(request, "pages/home.html")

124
templates/layouts/base.html Normal file
View File

@ -0,0 +1,124 @@
{% load static i18n %}
{% get_current_language as LANGUAGE_CODE %}
<!DOCTYPE html>
<html lang="{{ LANGUAGE_CODE }}">
<head>
<meta charset="utf-8">
<title>{% block title %}{% endblock %}</title>
<link
rel="icon"
type="image/png"
href="favicon.png"
>
<link
rel="apple-touch-icon"
href="touch-icon-iphone.png"
>
<link
rel="apple-touch-icon"
sizes="152x152"
href="/static/img/apple-touch-icon/touch-icon-ipad.png"
>
<link
rel="apple-touch-icon"
sizes="180x180"
href="/static/img/apple-touch-icon/touch-icon-iphone-retina.png"
>
<link
rel="apple-touch-icon"
sizes="167x167"
href="/static/img/apple-touch-icon/touch-icon-ipad-retina.png"
>
<meta
name="theme-color"
content="#3c790a"
>
<meta
name="theme-color"
content="#ecd96f"
media="(prefers-color-scheme: light)"
>
<meta
name="theme-color"
content="#0b3e05"
media="(prefers-color-scheme: dark)"
>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, shrink-to-fit=no"
>
<meta
name="author"
content="Tu nombre"
>
<meta
name="generator"
content="Django"
>
<meta
name="keywords"
content="html, css, javascript"
>
<meta
name="description"
content="{% block description %}{% endblock %}"
>
<meta
property="og:image"
content="{% block og-image %}{% endblock %}"
>
<meta
property="og:title"
content="{% block og-title %}{% endblock %}"
>
<meta
property="og:type"
content="website"
>
<meta
property="og:url"
content=""
>
<meta
name="twitter:card"
content="summary"
>
<meta
name="twitter:site"
content="@cuenta"
>
<meta
name="twitter:creator"
content="@cuenta"
>
<meta
property="og:image:secure_url"
content="https://..."
>
<meta
property="og:image:type"
content="image/jpeg"
>
<meta
property="og:image:width"
content="400"
>
<meta
property="og:image:height"
content="300"
>
<meta
property="og:image:alt"
content=""
>
<link
rel="stylesheet"
type="text/css"
href="{% static 'css/main.css' %}"
>
</head>
<body>
{% block content %}{% endblock %}
</body>
</html>

15
templates/pages/home.html Normal file
View File

@ -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 %}
<h1>Hi</h1>
{% endblock %}