Skip to content

Commit

Permalink
Merge branch 'release/1.4.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Dec 2, 2020
2 parents 210463c + 3e7a3d5 commit 20bc8cb
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 28 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# v1.4.2
## 12/02/2020

1. [](#improved)
* User return typehints in plugin.php
* Add proper twig escapes into a new theme

# v1.4.1
## 05/20/2020

Expand Down
2 changes: 1 addition & 1 deletion blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: DevTools
slug: devtools
type: plugin
version: 1.4.1
version: 1.4.2
description: Plugin and Theme scaffolding utilities
icon: cogs
author:
Expand Down
4 changes: 2 additions & 2 deletions components/plugin/blank/plugin.php.twig
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class {{ component.name|camelize }}Plugin extends Plugin
* callable (or function) as well as the priority. The
* higher the number the higher the priority.
*/
public static function getSubscribedEvents()
public static function getSubscribedEvents(): array
{
return [
'onPluginsInitialized' => [
Expand All @@ -43,7 +43,7 @@ class {{ component.name|camelize }}Plugin extends Plugin
/**
* Initialize the plugin
*/
public function onPluginsInitialized()
public function onPluginsInitialized(): void
{
// Don't proceed if we are in the admin plugin
if ($this->isAdmin()) {
Expand Down
2 changes: 1 addition & 1 deletion components/theme/pure-blank/templates/default.html.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends 'partials/base.html.twig' %}

{% block content %}
{{ page.content }}
{{ page.content|raw }}
{% endblock %}
2 changes: 1 addition & 1 deletion components/theme/pure-blank/templates/error.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
{% block content %}
<div class="lead text-center">
<h1>Error!</h1>
{{ page.content }}
{{ page.content|raw }}
</div>
{% endblock %}
14 changes: 7 additions & 7 deletions components/theme/pure-blank/templates/partials/base.html.twig
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{% set theme_config = attribute(config.themes, config.system.pages.theme) %}
<!DOCTYPE html>
<html lang="{{ grav.language.getActive ?: grav.config.site.default_lang }}">
<html lang="{{ (grav.language.getActive ?: grav.config.site.default_lang)|e }}">
<head>
{% block head %}
<meta charset="utf-8" />
<title>{% if header.title %}{{ header.title|e('html') }} | {% endif %}{{ site.title|e('html') }}</title>
<title>{% if header.title %}{{ header.title|e }} | {% endif %}{{ site.title|e }}</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="icon" type="image/png" href="{{ url('theme://images/logo.png') }}" />
<link rel="canonical" href="{{ page.url(true, true) }}" />
<link rel="icon" type="image/png" href="{{ url('theme://images/logo.png')|e }}" />
<link rel="canonical" href="{{ page.url(true, true)|e }}" />
{% endblock head %}

{% block stylesheets %}
Expand All @@ -29,14 +29,14 @@
{{ assets.js()|raw }}
{% endblock %}
</head>
<body id="top" class="{{ page.header.body_classes }}">
<body id="top" class="{{ page.header.body_classes|e }}">

{% block header %}
<div class="header">
<div class="wrapper padding">
<a class="logo left" href="{{ home_url }}">
<a class="logo left" href="{{ home_url|e }}">
<i class="fa fa-rebel"></i>
{{ config.site.title }}
{{ config.site.title|e }}
</a>
{% block header_navigation %}
<nav class="main-nav">
Expand Down
31 changes: 15 additions & 16 deletions components/theme/pure-blank/templates/partials/navigation.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
{% 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 }}
<li class="has-children {{ current_page|e }}">
<a href="{{ p.url|e }}">
{% if p.header.icon %}<i class="fa fa-{{ p.header.icon|e }}"></i>{% endif %}
{{ p.menu|e }}
</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 }}
<li class="{{ current_page|e }}">
<a href="{{ p.url|e }}">
{% if p.header.icon %}<i class="fa fa-{{ p.header.icon|e }}"></i>{% endif %}
{{ p.menu|e }}
</a>
</li>
{% endif %}
Expand All @@ -28,21 +28,20 @@
{% 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 }}
<li class="{{ current_page|e }}">
<a href="{{ page.url|e }}">
{% if page.header.icon %}<i class="fa fa-{{ page.header.icon|e }}"></i>{% endif %}
{{ page.menu|e }}
</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 href="{{ mitem.url|e }}">
{% if mitem.icon %}<i class="fa fa-{{ mitem.icon|e }}"></i>{% endif %}
{{ mitem.text|e }}
</a>
</li>
{% endfor %}
</ul>

0 comments on commit 20bc8cb

Please sign in to comment.