init
This commit is contained in:
5
templates/default.html.twig
Executable file
5
templates/default.html.twig
Executable file
@@ -0,0 +1,5 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
{{ page.content }}
|
||||
{% endblock %}
|
||||
8
templates/error.html.twig
Executable file
8
templates/error.html.twig
Executable file
@@ -0,0 +1,8 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="lead text-center">
|
||||
<h1>Error!</h1>
|
||||
{{ page.content }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
74
templates/partials/base.html.twig
Executable file
74
templates/partials/base.html.twig
Executable file
@@ -0,0 +1,74 @@
|
||||
{% set theme_config = attribute(config.themes, config.system.pages.theme) %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ grav.language.getActive ?: grav.config.site.default_lang }}">
|
||||
<head>
|
||||
{% block head %}
|
||||
<meta charset="utf-8" />
|
||||
<title>{% if header.title %}{{ header.title|e('html') }} | {% endif %}{{ site.title|e('html') }}</title>
|
||||
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
{% include 'partials/metadata.html.twig' %}
|
||||
|
||||
<link rel="alternate" type="application/atom+xml" title="My Feed" href="{{ base_url }}.atom" />
|
||||
<link rel="alternate" type="application/rss+xml" title="My Feed" href="{{ base_url }}.rss" />
|
||||
|
||||
<link rel="icon" type="image/png" href="{{ url('theme://images/logo.png') }}" />
|
||||
<link rel="canonical" href="{{ page.url(true, true) }}" />
|
||||
{% endblock head %}
|
||||
|
||||
{% block stylesheets %}
|
||||
{% do assets.addCss('https://unpkg.com/purecss@1.0.0/build/pure-min.css', 100) %}
|
||||
{% do assets.addCss('https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css', 99) %}
|
||||
{% do assets.addCss('theme://css/custom.css', 98) %}
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{% do assets.addJs('jquery', 100) %}
|
||||
{% endblock %}
|
||||
|
||||
{% block assets deferred %}
|
||||
{{ assets.css()|raw }}
|
||||
{{ assets.js()|raw }}
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body id="top" class="{{ page.header.body_classes }}">
|
||||
|
||||
{% block header %}
|
||||
<div class="header">
|
||||
<div class="wrapper padding">
|
||||
<a class="logo left" href="{{ home_url }}">
|
||||
<i class="fa fa-rebel"></i>
|
||||
{{ config.site.title }}
|
||||
</a>
|
||||
{% block header_navigation %}
|
||||
<nav class="main-nav">
|
||||
{% include 'partials/navigation.html.twig' %}
|
||||
</nav>
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<section id="body">
|
||||
<div class="wrapper padding">
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}
|
||||
<div class="footer text-center">
|
||||
<div class="wrapper padding">
|
||||
<p><a href="http://getgrav.org">Grav</a> was <i class="fa fa-code"></i> with <i class="fa fa-heart"></i> by <a href="http://www.rockettheme.com">RocketTheme</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block bottom %}
|
||||
{{ assets.js('bottom')|raw }}
|
||||
{% endblock %}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
48
templates/partials/navigation.html.twig
Executable file
48
templates/partials/navigation.html.twig
Executable file
@@ -0,0 +1,48 @@
|
||||
{% macro loop(page) %}
|
||||
{% for p in page.children.visible %}
|
||||
{% set current_page = (p.active or p.activeChild) ? 'selected' : '' %}
|
||||
{% if p.children.visible.count > 0 %}
|
||||
<li class="has-children {{ current_page }}">
|
||||
<a href="{{ p.url }}">
|
||||
{% if p.header.icon %}<i class="fa fa-{{ p.header.icon }}"></i>{% endif %}
|
||||
{{ p.menu }}
|
||||
</a>
|
||||
<ul>
|
||||
{{ _self.loop(p) }}
|
||||
</ul>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="{{ current_page }}">
|
||||
<a href="{{ p.url }}">
|
||||
{% if p.header.icon %}<i class="fa fa-{{ p.header.icon }}"></i>{% endif %}
|
||||
{{ p.menu }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endmacro %}
|
||||
|
||||
<ul>
|
||||
{% if theme_config.dropdown.enabled %}
|
||||
{{ _self.loop(pages) }}
|
||||
{% else %}
|
||||
{% for page in pages.children.visible %}
|
||||
{% set current_page = (page.active or page.activeChild) ? 'selected' : '' %}
|
||||
<li class="{{ current_page }}">
|
||||
<a href="{{ page.url }}">
|
||||
{% if page.header.icon %}<i class="fa fa-{{ page.header.icon }}"></i>{% endif %}
|
||||
{{ page.menu }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% for mitem in site.menu %}
|
||||
<li>
|
||||
<a href="{{ mitem.url }}">
|
||||
{% if mitem.icon %}<i class="fa fa-{{ mitem.icon }}"></i>{% endif %}
|
||||
{{ mitem.text }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user