Skip to content

Commit

Permalink
Improvements to theme setup
Browse files Browse the repository at this point in the history
  • Loading branch information
robbinjohansson committed Jan 8, 2018
1 parent 865143e commit 539e67e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
17 changes: 15 additions & 2 deletions haywire.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,23 @@ class Haywire extends Theme
public static function getSubscribedEvents()
{
return [
'onAssetsInitialized' => ['onAssetsInitialized', 0]
'onThemeInitialized' => ['onThemeInitialized', 0]
];
}
public function onAssetsInitialized()

public function onThemeInitialized()
{
if ($this->isAdmin()) {
$this->active = false;
return;
}

$this->enable([
'onTwigSiteVariables' => ['onTwigSiteVariables', 0]
]);
}

public function onTwigSiteVariables()
{
$path = $this->grav['base_url'] . $this->config['theme']['assetPath'];
$manifest = __DIR__ . '/dist/mix-manifest.json';
Expand Down
1 change: 0 additions & 1 deletion sass/partials/_navbar.sass
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

.navbar
border-bottom: solid 1px $grey-lighter

.navbar-burger
border: 0
2 changes: 1 addition & 1 deletion templates/partials/head.html.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<meta charset="utf-8" />
<title>{% if header.title %}{{ header.title|e('html') }} | {% endif %}{{ site.title|e('html') }}</title>
{% include 'partials/metadata.html.twig' %}
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
<link rel="icon" type="image/png" href="{{ url('theme://images/favicon.png') }}" />
<link rel="canonical" href="{{ page.url(true, true) }}" />
{{ assets.css() }}

0 comments on commit 539e67e

Please sign in to comment.