Remove WebsiteBundle

This commit is contained in:
Oliver Davies 2019-01-16 21:43:12 +00:00
parent 243d3e1859
commit a30d64e5c2
5 changed files with 0 additions and 84 deletions

View file

@ -20,7 +20,6 @@ class SculpinKernel extends AbstractKernel
SculpinTwigMarkdownBundle::class,
SculpinFormatTalksBundle::class,
SculpinWebsiteBundle::class,
];
}
}

View file

@ -1,58 +0,0 @@
<?php
namespace WebsiteBundle\Command;
use Sculpin\Core\Console\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* Generate a new talk from a stub.
*/
class NewTalkCommand extends ContainerAwareCommand
{
/**
* {@inheritdoc}
*/
protected function configure()
{
$this->setName('website:new:talk')
->setAliases(['new-talk'])
->setDescription('Create a new talk')
->addArgument('title', InputArgument::REQUIRED, 'The title of the post');
}
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$title = $input->getArgument('title');
$filename = string($title)->slugify() . '.php';
if (file_exists($file = __DIR__ . "/../../../source/_talks/{$filename}")) {
$output->writeln("<error>{$filename} already exists.</error>");
exit(1);
}
file_put_contents($file, $this->compileTemplate($title));
$output->writeln("<info>{$filename} was created.</info>");
}
/**
* Load and compile the template with the correct data.
*
* @param string $title The title of the talk
*
* @return bool|mixed|string
*/
private function compileTemplate($title)
{
$contents = file_get_contents(__DIR__ . '/../Resources/stubs/talk.md');
return str_replace('{{ title }}', $title, $contents);
}
}

View file

@ -1,11 +0,0 @@
---
title: "{{ title }}"
speakerdeck:
id: ~
ratio: ~
url: ~
youtube:
id: ~
tags: []
events: []
---

View file

@ -1,9 +0,0 @@
<?php
namespace WebsiteBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class SculpinWebsiteBundle extends Bundle
{
}

View file

@ -1,5 +0,0 @@
{
"require": {
"spatie/string": "^2.2"
}
}