Remove local checks; Delete twigtemplates; update inheritence theme

All components could use some ❤️
This commit is contained in:
Tyler Cosgrove
2016-03-10 21:22:55 -05:00
parent fbac9a6dcd
commit f3043926e1
7 changed files with 28 additions and 24 deletions

View File

@@ -103,6 +103,10 @@ class DevToolsCommand extends ConsoleCommand
$file = File::instance($componentFolder . DS . str_replace('.twig', '', $templateFile));
$file->content($content);
$file->save();
//Delete twig template
$file = File::instance($componentFolder . DS . $templateFile);
$file->delete();
}
}
}
@@ -130,10 +134,10 @@ class DevToolsCommand extends ConsoleCommand
case 'name':
//Check If name
if ($value == null || trim($value) == '') {
throw new \RuntimeException('Plugin Name cannot be empty');
throw new \RuntimeException('Name cannot be empty');
}
if (false != $this->gpm->findPackage($value) || false != $this->gpm->isPluginInstalled($value) || false != $this->gpm->isThemeInstalled($value)) {
throw new \RuntimeException('Package exists (either as theme or plugin)');
if (false != $this->gpm->findPackage($value)) {
throw new \RuntimeException('Package name exists in GPM');
}
break;

View File

@@ -1,5 +0,0 @@
# @@NAME@@
The **@@NAME@@** Theme is for [Grav](http://github.com/getgrav/grav)
@@DESCRIPTION@@

View File

@@ -0,0 +1,5 @@
# {{ component.name|titleize }}
The **{{ component.name|titleize }}** Plugin is for [Grav](http://github.com/getgrav/grav)
{{ component.description }}

View File

@@ -1,8 +0,0 @@
<?php
namespace Grav\Theme;
class Mytheme extends Antimatter
{
// Some new methods, properties etc.
}
?>

View File

@@ -0,0 +1,8 @@
<?php
namespace Grav\Theme;
class {{ component.name|variableize }} extends {{ component.extends|variableize }}
{
// Some new methods, properties etc.
}
?>

View File

@@ -1,8 +0,0 @@
streams:
schemes:
theme:
type: ReadOnlyStream
prefixes:
'':
- user/themes/mytheme
- user/themes/antimatter

View File

@@ -0,0 +1,8 @@
streams:
schemes:
theme:
type: ReadOnlyStream
prefixes:
'':
- user/themes/{{ component.name|hyphenize }}
- user/themes/{{ component.extends }}