update: sample templates
This commit is contained in:
parent
eaff212b63
commit
cf24e968ca
3 changed files with 66 additions and 0 deletions
26
templates/base.html
Normal file
26
templates/base.html
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="pt-br">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>
|
||||
{% block title %}Meu Site{% endblock %}
|
||||
</title>
|
||||
<style>
|
||||
body { font-family: Arial, sans-serif; margin: 40px; }
|
||||
header { background: #333; color: white; padding: 20px; }
|
||||
nav ul { list-style: none; padding: 0; }
|
||||
nav li { display: inline; margin: 0 10px; }
|
||||
nav a { color: white; text-decoration: none; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
{% include "partials/header.html" %}
|
||||
<main>
|
||||
{% block content %}<p>Conteúdo padrão</p>{% endblock %}
|
||||
</main>
|
||||
<footer>
|
||||
<p>© 2025 - Feito com ❤️ e Zig</p>
|
||||
<span>{% now "d/m/Y H:i:s" %}</span>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
28
templates/home.html
Normal file
28
templates/home.html
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Home - Meu Site{% endblock %}
|
||||
|
||||
{% block menu %}
|
||||
{{ block.super }}
|
||||
<li><a href="/blog">Blog</a></li>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Bem-vindo, {{ user.name }}!</h2>
|
||||
<span>{% now "d/m/Y H:i:s" %}</span>
|
||||
<p>Você tem {{ user.notifications }} notificações pendentes.</p>
|
||||
|
||||
<h3>Últimos itens:</h3>
|
||||
<ul>
|
||||
{% for item in itens %}
|
||||
<li>{{ forloop.counter }}: {{ item }}</li>
|
||||
{% empty %}
|
||||
<li>Nenhum item encontrado.</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
{% with msg="Olá mundo!" %}
|
||||
<p>Mensagem temporária: {{ msg|upper }}</p>
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
12
templates/partials/header.html
Normal file
12
templates/partials/header.html
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<header>
|
||||
<h1>{{ site_title|upper }}</h1>
|
||||
<nav>
|
||||
<ul>
|
||||
{% block menu %}
|
||||
<li><a href="/">Home</a></li>
|
||||
<li><a href="/sobre">Sobre</a></li>
|
||||
{% endblock %}
|
||||
<li><a href="/contato">Contato</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
Loading…
Add table
Add a link
Reference in a new issue