diff --git a/README.md b/README.md index b799738..dad8b78 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -cubexio +cubex.io ======= -Cubex Website +This is the office source for the cubex.io website diff --git a/assets/css/base.css b/assets/css/base.css new file mode 100644 index 0000000..7917148 --- /dev/null +++ b/assets/css/base.css @@ -0,0 +1,126 @@ +/* OVERRIDES */ +body { + padding: 0; + font-family: 'Open Sans', sans-serif; +} + +/** HELPERS */ +.text-center { + text-align: center; +} + +.strtoupper { + text-transform: uppercase; +} + +/** STICKY FOOTER */ +html, +body { + height: 100%; +} + +#sf-wrap { + min-height: 100%; + height: auto !important; + height: 100%; + margin: 0 auto -155px; +} + +#sf-push { + height: 155px; +} + +footer { + height: 155px; + line-height: 20px; +} + +/** GLOBAL STYLES */ +header { + background: #4099d4; + background: -moz-linear-gradient(left, #4099d4 0%, #84cbf0 50%, #4099d4 100%); + background: -webkit-gradient(linear, left top, right top, color-stop(0%, #4099d4), color-stop(50%, #84cbf0), color-stop(100%, #4099d4)); + background: -webkit-linear-gradient(left, #4099d4 0%, #84cbf0 50%, #4099d4 100%); + background: -o-linear-gradient(left, #4099d4 0%, #84cbf0 50%, #4099d4 100%); + background: -ms-linear-gradient(left, #4099d4 0%, #84cbf0 50%, #4099d4 100%); + background: linear-gradient(to right, #4099d4 0%, #84cbf0 50%, #4099d4 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#4099d4', endColorstr='#4099d4', GradientType=1); +} + +header#topbar { + padding-bottom: 16px; + border-bottom: 3px solid #DEDEDE; +} + +header#topbar .logo { + margin-top: 16px; + opacity: 0.8; +} + +header#topbar .logo:hover { + opacity: 1; +} + +nav.main { + margin-top: 29px; +} + +header nav > ul > li > a { + padding: 0 7px; + color: #30719c; + text-shadow: 0 1px 0 #67b5e4; +} + +header nav > ul > li > a:hover, +header nav > ul > li.active > a { + text-decoration: none; + color: #fff; + text-shadow: 0 1px 0 #3f8dc5; +} + +footer { + background: #E9E9E9; + font-size: 11px; + padding-top: 14px; + border-top: 1px solid #CCC; +} + +footer hr { + border: 0; + border-top: 1px solid #CCC; + margin: 5px 0; +} + +.container { + max-width: 960px; +} + +pre +{ + border:1px solid #55a8dd; +} + +pre code,code { + padding: 0; + color: #e9604a; + display: block; + overflow: hidden; + white-space: pre-wrap; + word-wrap: break-word; + font-family: monospace; + background: #eeeeee; + border-radius: 5px; + text-shadow: none; +} + +code +{ + background:transparent !important; +} + + + +.home-features .panel +{ + min-height:250px; +} diff --git a/assets/css/hero.css b/assets/css/hero.css new file mode 100644 index 0000000..1b195fe --- /dev/null +++ b/assets/css/hero.css @@ -0,0 +1,45 @@ +header#topbar { + border-bottom: none; +} + +header.hero { + font-size: 18px; + padding: 20px 0; + border-bottom: 3px solid #DEDEDE; + color: #ffffff; +} + +header.hero h1 { + text-align: center; + font-family: Calibri, 'Open Sans', sans-serif; + font-weight: 400; + font-size: 53px; + margin-top: 15px; + text-shadow: 0 2px 0 #3b8ec8; +} + +header.hero a:hover { + text-decoration: none; +} + +header.hero a { + color: #ffffff; +} + +header.hero aside { + display: block; + float: right; + width: 440px; + padding-top: 15px; + text-shadow: 0 1px 0 #3b8ec8; +} + +header.hero hgroup { + float: left; + width: 440px; +} + +.hero-links +{ + padding-top:10px; +} diff --git a/assets/img/cubex-logo.png b/assets/img/cubex-logo.png new file mode 100644 index 0000000..b8a819a Binary files /dev/null and b/assets/img/cubex-logo.png differ diff --git a/assets/img/highlight.png b/assets/img/highlight.png new file mode 100644 index 0000000..bcd174d Binary files /dev/null and b/assets/img/highlight.png differ diff --git a/assets/img/icons-cubes-sprite.png b/assets/img/icons-cubes-sprite.png new file mode 100644 index 0000000..bf89e71 Binary files /dev/null and b/assets/img/icons-cubes-sprite.png differ diff --git a/assets/img/watermark.png b/assets/img/watermark.png new file mode 100644 index 0000000..cf91fa8 Binary files /dev/null and b/assets/img/watermark.png differ diff --git a/assets/sprites/icons-cubes-sprite.psd b/assets/sprites/icons-cubes-sprite.psd new file mode 100644 index 0000000..1b17534 Binary files /dev/null and b/assets/sprites/icons-cubes-sprite.psd differ diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..4e5353e --- /dev/null +++ b/composer.json @@ -0,0 +1,25 @@ +{ + "name": "cubex/cubexio", + "description": "Cubex Website", + "homepage": "http://cubex.io", + "license": "BSD-3-Clause", + "authors": [ + { + "name": "Brooke Bryan", + "email": "brooke@bajb.net", + "homepage": "http://www.bajb.net" + } + ], + "require": { + "cubex/framework": "*", + "stack/builder": "*", + "packaged/dispatch": "*", + "dflydev/markdown": "*" + }, + "autoload": { + "psr-4": { + "CubexIo\\": "src/" + } + }, + "minimum-stability": "dev" +} diff --git a/conf/defaults.ini b/conf/defaults.ini new file mode 100644 index 0000000..1d05e04 --- /dev/null +++ b/conf/defaults.ini @@ -0,0 +1,10 @@ +[kernel] +default = \CubexIo\CubexIoApplication + +[dispatch] +run_on = path +run_match = assets +assets_dir = assets + +[documentation] +source_path = /Websites/cubex/documentation/ diff --git a/cubex b/cubex new file mode 100755 index 0000000..3c8636a --- /dev/null +++ b/cubex @@ -0,0 +1,30 @@ +#!/usr/bin/env php +boot(); + +//Create a request object +$request = \Cubex\Http\Request::createConsoleRequest(); +$app->instance('request', $request); + +//Create a new console application +$console = \Cubex\Console\Console::withCubex($app); + +//Execute the command and retrieve the exit code +$exit = $console->run(); + +$app->shutdown(); + +exit($exit); diff --git a/public/index.php b/public/index.php new file mode 100644 index 0000000..a63a530 --- /dev/null +++ b/public/index.php @@ -0,0 +1,32 @@ +boot(); + +$dispatcher = new \Packaged\Dispatch\Dispatch( + $app, $app->getConfiguration()->getSection('dispatch') +); +$dispatcher->setBaseDirectory(dirname(__DIR__)); + +//If you wish to use stackphp, uncomment the line below and require stackphp +$app = (new \Stack\Builder()) + ->push([$dispatcher, 'prepare']) + ->resolve($app); + +//Create a request object +$request = \Cubex\Http\Request::createFromGlobals(); + +//Tell Cubex to handle the request, and do its magic +$response = $app->handle($request); + +//Send the generated response to the user +$response->send(); + +//Shutdown Cubex +$app->terminate($request, $response); diff --git a/src/Controllers/CookbookController.php b/src/Controllers/CookbookController.php new file mode 100644 index 0000000..8d0b5e4 --- /dev/null +++ b/src/Controllers/CookbookController.php @@ -0,0 +1,12 @@ +_layout === null) + { + $this->_layout = new Layout($this); + $am = AssetManager::assetType(); + $am->requireCss('css/base'); + } + + return $this->_layout; + } + + public function __toString() + { + return $this->layout()->render(); + } + + public function handleResponse($response, $capturedOutput) + { + if($response instanceof ViewModel) + { + $this->layout()->insert($response, $this->_contentName); + return new Response($this->layout()); + } + + if($response === null) + { + $this->layout()->insert( + new Renderable($capturedOutput), + $this->_contentName + ); + return new Response($this->layout()); + } + + if(is_scalar($response)) + { + $this->layout()->insert( + new Renderable($response), + $this->_contentName + ); + return new Response($this->layout()); + } + + return parent::handleResponse($response, $capturedOutput); + } +} diff --git a/src/Controllers/DocumentationController.php b/src/Controllers/DocumentationController.php new file mode 100644 index 0000000..ee1ef98 --- /dev/null +++ b/src/Controllers/DocumentationController.php @@ -0,0 +1,42 @@ +getConfigItem('documentation', "source_path", 'docs'); + if(substr($docRoot, 0, 1) !== '/' && substr($docRoot, 1, 1) !== ':') + { + $docRoot = build_path($this->getCubex()->getDocRoot(), $docRoot); + } + + $sidebar = file_get_contents($docRoot . 'contents.md'); + if(file_exists($docRoot . $page . '.md')) + { + $content = file_get_contents($docRoot . $page . '.md'); + } + else + { + $errorString = 'File Not Found'; + } + + $docs = new Documentation($sidebar, $content); + $docs->setError($errorString); + return $docs; + } +} diff --git a/src/Controllers/GenericController.php b/src/Controllers/GenericController.php new file mode 100644 index 0000000..2b69661 --- /dev/null +++ b/src/Controllers/GenericController.php @@ -0,0 +1,18 @@ +layout()); + } +} diff --git a/src/Controllers/GettingStartedController.php b/src/Controllers/GettingStartedController.php new file mode 100644 index 0000000..ebc1a7a --- /dev/null +++ b/src/Controllers/GettingStartedController.php @@ -0,0 +1,12 @@ +configureMarkdownParser(self::CONFIG_TAB_WIDTH, 2); + } + + function _doCodeBlocks_callback($matches) + { + $codeblock = $matches[1]; + + $codeblock = $this->outdent($codeblock); + $codeblock = htmlspecialchars($codeblock, ENT_NOQUOTES); + + # trim leading newlines and trailing newlines + $codeblock = preg_replace('/\A\n+|\n+\z/', '', $codeblock); + return $this->wrapCodeBlock($codeblock); + } + + function _doFencedCodeBlocks_callback($matches) + { + $codeblock = $matches[2]; + $codeblock = htmlspecialchars($codeblock, ENT_NOQUOTES); + $codeblock = preg_replace_callback( + '/^\n+/', + array(&$this, '_doFencedCodeBlocks_newlines'), + $codeblock + ); + return $this->wrapCodeBlock($codeblock); + } + + public function wrapCodeBlock($code) + { + $code = "
$code\n
";
+ return "\n\n" . $this->hashBlock($code) . "\n\n";
+ }
+}
diff --git a/src/Layouts/Default.phtml b/src/Layouts/Default.phtml
new file mode 100644
index 0000000..472b965
--- /dev/null
+++ b/src/Layouts/Default.phtml
@@ -0,0 +1,124 @@
+
+