Default theme: Move elements into Twig blocks

Allows plugins to extend the default template
This commit is contained in:
Daniel Rudolf 2016-03-02 21:44:38 +01:00
parent 86614a3ab4
commit a3fa373119

View File

@ -1,25 +1,33 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en" class="no-js"> <html class="no-js">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>{% if meta.title %}{{ meta.title }} | {% endif %}{{ site_title }}</title> {% block documentHeader %}
<title>{% block title %}{% if meta.title %}{{ meta.title }} | {% endif %}{{ site_title }}{% endblock %}</title>
{% if meta.description %} {% if meta.description %}
<meta name="description" content="{{ meta.description|striptags }}"> <meta name="description" content="{{ meta.description|striptags }}">
{% endif %}{% if meta.robots %} {% endif %}{% if meta.robots %}
<meta name="robots" content="{{ meta.robots }}"> <meta name="robots" content="{{ meta.robots }}">
{% endif %} {% endif %}
{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:400,700" type="text/css" /> <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:400,700" type="text/css" />
<link rel="stylesheet" href="{{ theme_url }}/style.css" type="text/css" /> <link rel="stylesheet" href="{{ theme_url }}/style.css" type="text/css" />
{% endblock %}
{% block javascript %}
<script src="{{ theme_url }}/scripts/modernizr-2.6.1.min.js"></script> <script src="{{ theme_url }}/scripts/modernizr-2.6.1.min.js"></script>
{% endblock %}
</head> </head>
<body> <body>
{% block pageHeader %}
<header id="header"> <header id="header">
<div class="inner clearfix"> <div class="inner clearfix">
<h1><a href="{{ "index"|link }}" id="logo">{{ site_title }}</a></h1> <h1><a href="{{ "index"|link }}" id="logo">{{ site_title }}</a></h1>
{% block header %}
<nav> <nav>
<a href="#" class="menu-icon"></a> <a href="#" class="menu-icon"></a>
<ul> <ul>
@ -30,22 +38,30 @@
{% endfor %} {% endfor %}
</ul> </ul>
</nav> </nav>
{% endblock %}
</div> </div>
</header> </header>
{% endblock %}
{% block pageContent %}
<section id="content"> <section id="content">
<div class="inner"> <div class="inner">
{{ content }} {% block content content %}
</div> </div>
</section> </section>
{% endblock %}
{% block pageFooter %}
<footer id="footer"> <footer id="footer">
<div class="inner"> <div class="inner">
{% block footer %}
<a href="http://picocms.org/">Pico</a> was made by <a href="http://gilbert.pellegrom.me">Gilbert Pellegrom</a> <a href="http://picocms.org/">Pico</a> was made by <a href="http://gilbert.pellegrom.me">Gilbert Pellegrom</a>
and is maintained by <a href="https://github.com/picocms/Pico/graphs/contributors">The Pico Community</a>. and is maintained by <a href="https://github.com/picocms/Pico/graphs/contributors">The Pico Community</a>.
Released under the <a href="https://github.com/picocms/Pico/blob/master/LICENSE.md">MIT license</a>. Released under the <a href="https://github.com/picocms/Pico/blob/master/LICENSE.md">MIT license</a>.
{% endblock %}
</div> </div>
</footer> </footer>
{% endblock %}
</body> </body>
</html> </html>