diff --git a/composer.json b/composer.json index 0caf4ed..7831d67 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,8 @@ }, "require": { "php": ">=5.5.0", - "composer/installers": "~1.0" + "composer/installers": "~1.0", + "illuminate/view": "^5.3" }, "require-dev": { "squizlabs/php_codesniffer": "^2.5.1", diff --git a/composer.lock b/composer.lock index 6fae444..83fca22 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "5f4d419852a5551e2b54ef851cab83b4", - "content-hash": "1ee82adf8a4565a48214e5686e6b3293", + "hash": "255f61d85f71037ef5fc7872e31015f1", + "content-hash": "a1a2a4510be5494654cdd98e6308e48e", "packages": [ { "name": "composer/installers", @@ -104,6 +104,559 @@ "zikula" ], "time": "2016-01-27 12:54:22" + }, + { + "name": "doctrine/inflector", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/inflector.git", + "reference": "90b2128806bfde671b6952ab8bea493942c1fdae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae", + "reference": "90b2128806bfde671b6952ab8bea493942c1fdae", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "4.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Inflector\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Common String Manipulations with regard to casing and singular/plural rules.", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "inflection", + "pluralize", + "singularize", + "string" + ], + "time": "2015-11-06 14:35:42" + }, + { + "name": "illuminate/container", + "version": "v5.3.23", + "source": { + "type": "git", + "url": "https://github.com/illuminate/container.git", + "reference": "8047b47e1f731c975d9aa0fe0b269064d3f1346d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/container/zipball/8047b47e1f731c975d9aa0fe0b269064d3f1346d", + "reference": "8047b47e1f731c975d9aa0fe0b269064d3f1346d", + "shasum": "" + }, + "require": { + "illuminate/contracts": "5.3.*", + "php": ">=5.6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.3-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Container\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Container package.", + "homepage": "https://laravel.com", + "time": "2016-10-02 01:14:30" + }, + { + "name": "illuminate/contracts", + "version": "v5.3.23", + "source": { + "type": "git", + "url": "https://github.com/illuminate/contracts.git", + "reference": "ce5d73c6015b2054d32f3f8530767847b358ae4e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/ce5d73c6015b2054d32f3f8530767847b358ae4e", + "reference": "ce5d73c6015b2054d32f3f8530767847b358ae4e", + "shasum": "" + }, + "require": { + "php": ">=5.6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.3-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Contracts\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Contracts package.", + "homepage": "https://laravel.com", + "time": "2016-09-26 20:36:27" + }, + { + "name": "illuminate/events", + "version": "v5.3.23", + "source": { + "type": "git", + "url": "https://github.com/illuminate/events.git", + "reference": "cb29124d4eaba8a60bad40e95e3d8b199d040d77" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/events/zipball/cb29124d4eaba8a60bad40e95e3d8b199d040d77", + "reference": "cb29124d4eaba8a60bad40e95e3d8b199d040d77", + "shasum": "" + }, + "require": { + "illuminate/container": "5.3.*", + "illuminate/contracts": "5.3.*", + "illuminate/support": "5.3.*", + "php": ">=5.6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.3-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Events\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Events package.", + "homepage": "https://laravel.com", + "time": "2016-08-12 14:24:30" + }, + { + "name": "illuminate/filesystem", + "version": "v5.3.23", + "source": { + "type": "git", + "url": "https://github.com/illuminate/filesystem.git", + "reference": "82576e0a6193e76929c929c8a2d3e1552ab64e76" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/filesystem/zipball/82576e0a6193e76929c929c8a2d3e1552ab64e76", + "reference": "82576e0a6193e76929c929c8a2d3e1552ab64e76", + "shasum": "" + }, + "require": { + "illuminate/contracts": "5.3.*", + "illuminate/support": "5.3.*", + "php": ">=5.6.4", + "symfony/finder": "3.1.*" + }, + "suggest": { + "league/flysystem": "Required to use the Flysystem local and FTP drivers (~1.0).", + "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (~1.0).", + "league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (~1.0)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.3-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Filesystem\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Filesystem package.", + "homepage": "https://laravel.com", + "time": "2016-11-07 22:09:46" + }, + { + "name": "illuminate/support", + "version": "v5.3.23", + "source": { + "type": "git", + "url": "https://github.com/illuminate/support.git", + "reference": "050d0ed3e1c0e1d129d73b2eaa14044e46a66f77" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/support/zipball/050d0ed3e1c0e1d129d73b2eaa14044e46a66f77", + "reference": "050d0ed3e1c0e1d129d73b2eaa14044e46a66f77", + "shasum": "" + }, + "require": { + "doctrine/inflector": "~1.0", + "ext-mbstring": "*", + "illuminate/contracts": "5.3.*", + "paragonie/random_compat": "~1.4|~2.0", + "php": ">=5.6.4" + }, + "replace": { + "tightenco/collect": "self.version" + }, + "suggest": { + "illuminate/filesystem": "Required to use the composer class (5.2.*).", + "symfony/process": "Required to use the composer class (3.1.*).", + "symfony/var-dumper": "Required to use the dd function (3.1.*)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.3-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Support\\": "" + }, + "files": [ + "helpers.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Support package.", + "homepage": "https://laravel.com", + "time": "2016-11-03 15:25:28" + }, + { + "name": "illuminate/view", + "version": "v5.3.23", + "source": { + "type": "git", + "url": "https://github.com/illuminate/view.git", + "reference": "f840676c98e3cb1224267786f35eb420de55d41c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/view/zipball/f840676c98e3cb1224267786f35eb420de55d41c", + "reference": "f840676c98e3cb1224267786f35eb420de55d41c", + "shasum": "" + }, + "require": { + "illuminate/container": "5.3.*", + "illuminate/contracts": "5.3.*", + "illuminate/events": "5.3.*", + "illuminate/filesystem": "5.3.*", + "illuminate/support": "5.3.*", + "php": ">=5.6.4", + "symfony/debug": "3.1.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.3-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\View\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate View package.", + "homepage": "https://laravel.com", + "time": "2016-10-24 18:18:15" + }, + { + "name": "paragonie/random_compat", + "version": "v2.0.4", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "a9b97968bcde1c4de2a5ec6cbd06a0f6c919b46e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/a9b97968bcde1c4de2a5ec6cbd06a0f6c919b46e", + "reference": "a9b97968bcde1c4de2a5ec6cbd06a0f6c919b46e", + "shasum": "" + }, + "require": { + "php": ">=5.2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "autoload": { + "files": [ + "lib/random.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "pseudorandom", + "random" + ], + "time": "2016-11-07 23:38:38" + }, + { + "name": "psr/log", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2016-10-10 12:19:37" + }, + { + "name": "symfony/debug", + "version": "v3.1.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "c058661c32f5b462722e36d120905940089cbd9a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/c058661c32f5b462722e36d120905940089cbd9a", + "reference": "c058661c32f5b462722e36d120905940089cbd9a", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/class-loader": "~2.8|~3.0", + "symfony/http-kernel": "~2.8|~3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2016-11-15 12:55:20" + }, + { + "name": "symfony/finder", + "version": "v3.1.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "9925935bf7144f9e4d2b976905881b4face036fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/9925935bf7144f9e4d2b976905881b4face036fb", + "reference": "9925935bf7144f9e4d2b976905881b4face036fb", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2016-11-03 08:04:31" } ], "packages-dev": [ diff --git a/index.php b/index.php index 04501c1..1ae695e 100644 --- a/index.php +++ b/index.php @@ -1,3 +1,3 @@ classes @@ -32,11 +35,62 @@ add_filter('excerpt_more', function () { }); /** - * Use theme wrapper + * Use Blade template engine */ -add_filter('template_include', function ($main) { - if (!is_string($main) && !(is_object($main) && method_exists($main, '__toString'))) { - return $main; +foreach(['index', '404', 'archive', 'author', 'category', 'tag', 'taxonomy', 'date', 'home', 'front_page', 'page', 'paged', 'search', 'single', 'singular', 'attachment'] as $type) { + add_filter("{$type}_template_hierarchy", function($templates) { + foreach ($templates as $template) { + $templates[] = str_replace('.php', '.blade.php', $template); + } + return $templates; + }); +} +add_filter('template_include', function ($template) { + $blade_template = (!strpos($template, '.blade.php')) ? str_replace('.php', '.blade.php', $template) : $template; + $blade_template = locate_template(basename($blade_template)); + + if (!file_exists($blade_template)) { + return $template; } - return ((new Template(new Wrapper($main)))->layout()); -}, 109); + + $container = Container::getInstance(); + + $container->singleton('files', function () { + return new Filesystem; + }); + + $provider = new ViewServiceProvider($container); + $provider->register(); + + $template_engine = $container->make('view'); + + $template_name = basename(str_replace('.blade', '', $blade_template)); + $template_name = str_replace('.php', '', $template_name); + $html = $template_engine->make($template_name, apply_filters('laravel/blade/template_data', []))->render(); + + if (!$html) { + return $template; + } + + echo $html; + + return false; +}, 1000); + +add_filter('comments_template', function ($theme_template) { + $container = Container::getInstance(); + $template_engine = $container->make('view'); + + $template_name = basename(str_replace('.blade.php', '', $theme_template)); + $html = $template_engine->make('partials/'.$template_name, []); + var_dump($template_engine->exists('partials/'.$template_name)); + $engine = $html->getEngine(); + $compiler = $engine->getCompiler(); + $template = $compiler->getCompiledPath($compiler->getPath()); + + if ($compiler->isExpired($template)) { + $compiler->compile($theme_template); + } + + return $template; +}); diff --git a/src/lib/Sage/Template/ViewServiceProvider.php b/src/lib/Sage/Template/ViewServiceProvider.php new file mode 100644 index 0000000..50ecc6f --- /dev/null +++ b/src/lib/Sage/Template/ViewServiceProvider.php @@ -0,0 +1,132 @@ +registerEngineResolver(); + + $this->registerViewFinder(); + + $this->registerFactory(); + } + + /** + * Register the engine resolver instance. + * + * @return void + */ + public function registerEngineResolver() + { + $this->app->singleton('view.engine.resolver', function () { + $resolver = new EngineResolver; + + // Next we will register the various engines with the resolver so that the + // environment can resolve the engines it needs for various views based + // on the extension of view files. We call a method for each engines. + foreach (['php', 'blade'] as $engine) { + $this->{'register'.ucfirst($engine).'Engine'}($resolver); + } + + return $resolver; + }); + } + + /** + * Register the PHP engine implementation. + * + * @param \Illuminate\View\Engines\EngineResolver $resolver + * @return void + */ + public function registerPhpEngine($resolver) + { + $resolver->register('php', function () { + return new PhpEngine; + }); + } + + /** + * Register the Blade engine implementation. + * + * @param \Illuminate\View\Engines\EngineResolver $resolver + * @return void + */ + public function registerBladeEngine($resolver) + { + $app = $this->app; + + // The Compiler engine requires an instance of the CompilerInterface, which in + // this case will be the Blade compiler, so we'll first create the compiler + // instance to pass into the engine so it can compile the views properly. + $app->singleton('blade.compiler', function ($app) { + $cache = apply_filters('roots/views/blade/compiled_path', wp_upload_dir()['basedir'] . '/cache/compiled'); + if (!file_exists($cache)) { + wp_mkdir_p($cache); + } + + return new BladeCompiler($app->make('Illuminate\\Filesystem\\Filesystem'), $cache); + }); + + $resolver->register('blade', function () use ($app) { + return new CompilerEngine($app['blade.compiler']); + }); + } + + /** + * Register the view finder implementation. + * + * @return void + */ + public function registerViewFinder() + { + $this->app->bind('view.finder', function ($app) { + $paths = apply_filters('roots/views/blade/template_directories', [TEMPLATEPATH]); + + return new FileViewFinder($app['files'], $paths); + }); + } + + /** + * Register the view environment. + * + * @return void + */ + public function registerFactory() + { + $this->app->singleton('view', function ($app) { + // Next we need to grab the engine resolver instance that will be used by the + // environment. The resolver will be used by an environment to get each of + // the various engine implementations such as plain PHP or Blade engine. + $resolver = $app['view.engine.resolver']; + + $finder = $app['view.finder']; + + $env = new Factory($resolver, $finder, new Dispatcher($app)); + + // We will also set the container instance on this view environment since the + // view composers may be classes registered in the container, which allows + // for great testable, flexible composers for the application developer. + $env->setContainer($app); + + $env->share('app', $app); + + return $env; + }); + } +} diff --git a/templates/404.blade.php b/templates/404.blade.php new file mode 100644 index 0000000..a61aebd --- /dev/null +++ b/templates/404.blade.php @@ -0,0 +1,14 @@ +@extends('layouts.base') + +@section('content') + @include('partials.page-header') + + @if(!have_posts()) +
+ {{ __('Sorry, but the page you were trying to view does not exist.', 'sage') }} +
+ {!! get_search_form(false) !!} + @endif + + {!! get_the_posts_navigation() !!} +@endsection diff --git a/templates/404.php b/templates/404.php deleted file mode 100644 index 5ef0100..0000000 --- a/templates/404.php +++ /dev/null @@ -1,7 +0,0 @@ - - -
- -
- - diff --git a/templates/index.blade.php b/templates/index.blade.php new file mode 100644 index 0000000..98e220d --- /dev/null +++ b/templates/index.blade.php @@ -0,0 +1,19 @@ +@extends('layouts.base') + +@section('content') + @include('partials.page-header') + + @if(!have_posts()) +
+ {{ __('Sorry, no results were found.', 'sage') }} +
+ {{ get_search_form(false) }} + @endif + + @while(have_posts()) + {!! the_post() !!} + @include('partials.content') + @endwhile + + {{ get_the_posts_navigation() }} +@endsection diff --git a/templates/index.php b/templates/index.php deleted file mode 100644 index bb39ccc..0000000 --- a/templates/index.php +++ /dev/null @@ -1,14 +0,0 @@ - - - -
- -
- - - - - - - - diff --git a/templates/layouts/base.blade.php b/templates/layouts/base.blade.php new file mode 100644 index 0000000..b88d998 --- /dev/null +++ b/templates/layouts/base.blade.php @@ -0,0 +1,28 @@ + + + @include('partials.head') + + + {!! do_action('get_header') !!} + @include('partials.header') +
+
+
+ @yield('content') +
+ {{--@if(App\display_sidebar())--}} + {{----}} + {{--@endif--}} +
+
+ {!! do_action('get_footer') !!} + @include('partials.footer') + {!! wp_footer() !!} + + diff --git a/templates/layouts/base.php b/templates/layouts/base.php deleted file mode 100644 index 0e37279..0000000 --- a/templates/layouts/base.php +++ /dev/null @@ -1,32 +0,0 @@ - -> - - > - - -
-
-
- main(); ?> -
- - - -
-
- - - diff --git a/templates/page.blade.php b/templates/page.blade.php new file mode 100644 index 0000000..0599920 --- /dev/null +++ b/templates/page.blade.php @@ -0,0 +1,9 @@ +@extends('layouts.base') + +@section('content') + @while(have_posts()) + {!! the_post() !!} + @include('partials.page-header') + @include('partials.content-page') + @endwhile +@endsection diff --git a/templates/page.php b/templates/page.php deleted file mode 100644 index dc2adff..0000000 --- a/templates/page.php +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/templates/partials/comments.blade.php b/templates/partials/comments.blade.php new file mode 100644 index 0000000..cb5c832 --- /dev/null +++ b/templates/partials/comments.blade.php @@ -0,0 +1,38 @@ + + +
+ @if(have_comments()) +

+ {!! sprintf(_nx('One response to “%2$s”', '%1$s responses to “%2$s”', get_comments_number(), 'comments title', 'sage'), number_format_i18n(get_comments_number()), '' . get_the_title() . '') !!} +

+ +
    + {!! wp_list_comments(['style' => 'ol', 'short_ping' => true]) !!} +
+ + @if(get_comment_pages_count() > 1 && get_option('page_comments')) + + @endif + @endif + + @if(!comments_open() && get_comments_number() != '0' && post_type_supports(get_post_type(), 'comments')) +
+ {{ __('Comments are closed.', 'sage') }} +
+ @endif + + {!! comment_form() !!} +
diff --git a/templates/partials/comments.php b/templates/partials/comments.php deleted file mode 100644 index 167a4d1..0000000 --- a/templates/partials/comments.php +++ /dev/null @@ -1,36 +0,0 @@ - - -
- -

' . get_the_title() . ''); ?>

- -
    - 'ol', 'short_ping' => true]); ?> -
- - 1 && get_option('page_comments')) : ?> - - - - - -
- -
- - - -
diff --git a/templates/partials/content-page.blade.php b/templates/partials/content-page.blade.php new file mode 100644 index 0000000..5c590d0 --- /dev/null +++ b/templates/partials/content-page.blade.php @@ -0,0 +1,2 @@ +{!! the_content() !!} +{!! wp_link_pages(['before' => '']) !!} diff --git a/templates/partials/content-page.php b/templates/partials/content-page.php deleted file mode 100644 index 5f98362..0000000 --- a/templates/partials/content-page.php +++ /dev/null @@ -1,2 +0,0 @@ - - '']); ?> diff --git a/templates/partials/content-search.blade.php b/templates/partials/content-search.blade.php new file mode 100644 index 0000000..c7265ed --- /dev/null +++ b/templates/partials/content-search.blade.php @@ -0,0 +1,11 @@ +
+
+

{{ get_the_title() }}

+ @if(get_post_type() === 'post') + @include('partials/entry-meta') + @endif +
+
+ {!! the_excerpt() !!} +
+
diff --git a/templates/partials/content-search.php b/templates/partials/content-search.php deleted file mode 100644 index 2eac1e4..0000000 --- a/templates/partials/content-search.php +++ /dev/null @@ -1,9 +0,0 @@ -
> -
-

- -
-
- -
-
diff --git a/templates/partials/content-single.blade.php b/templates/partials/content-single.blade.php new file mode 100644 index 0000000..b247ff9 --- /dev/null +++ b/templates/partials/content-single.blade.php @@ -0,0 +1,13 @@ +
+
+

{{ get_the_title() }}

+ @include('partials/entry-meta') +
+
+ {!! the_content() !!} +
+ + {!! comments_template('/templates/partials/comments.blade.php') !!} +
diff --git a/templates/partials/content-single.php b/templates/partials/content-single.php deleted file mode 100644 index 0dda4e1..0000000 --- a/templates/partials/content-single.php +++ /dev/null @@ -1,13 +0,0 @@ -
> -
-

- -
-
- -
- - -
diff --git a/templates/partials/content.blade.php b/templates/partials/content.blade.php new file mode 100644 index 0000000..caad3cb --- /dev/null +++ b/templates/partials/content.blade.php @@ -0,0 +1,9 @@ +
+
+

{{ get_the_title() }}

+ @include('partials/entry-meta') +
+
+ {!! the_excerpt() !!} +
+
diff --git a/templates/partials/content.php b/templates/partials/content.php deleted file mode 100644 index 2246a63..0000000 --- a/templates/partials/content.php +++ /dev/null @@ -1,9 +0,0 @@ -
> -
-

- -
-
- -
-
diff --git a/templates/partials/entry-meta.blade.php b/templates/partials/entry-meta.blade.php new file mode 100644 index 0000000..301e9b7 --- /dev/null +++ b/templates/partials/entry-meta.blade.php @@ -0,0 +1,6 @@ + +

+ {{ __('By', 'sage') }} +

diff --git a/templates/partials/entry-meta.php b/templates/partials/entry-meta.php deleted file mode 100644 index 95bd3b1..0000000 --- a/templates/partials/entry-meta.php +++ /dev/null @@ -1,2 +0,0 @@ - -

diff --git a/templates/partials/footer.php b/templates/partials/footer.blade.php similarity index 60% rename from templates/partials/footer.php rename to templates/partials/footer.blade.php index 050d688..72c31f7 100644 --- a/templates/partials/footer.php +++ b/templates/partials/footer.blade.php @@ -1,5 +1,5 @@ diff --git a/templates/partials/head.php b/templates/partials/head.blade.php similarity index 89% rename from templates/partials/head.php rename to templates/partials/head.blade.php index 9028b7d..8303e90 100644 --- a/templates/partials/head.php +++ b/templates/partials/head.blade.php @@ -2,5 +2,5 @@ - + {!! wp_head() !!} diff --git a/templates/partials/header.blade.php b/templates/partials/header.blade.php new file mode 100644 index 0000000..5f5b2c2 --- /dev/null +++ b/templates/partials/header.blade.php @@ -0,0 +1,10 @@ + diff --git a/templates/partials/header.php b/templates/partials/header.php deleted file mode 100644 index a971013..0000000 --- a/templates/partials/header.php +++ /dev/null @@ -1,12 +0,0 @@ - diff --git a/templates/partials/page-header.php b/templates/partials/page-header.blade.php similarity index 51% rename from templates/partials/page-header.php rename to templates/partials/page-header.blade.php index b488560..9e1a4c5 100644 --- a/templates/partials/page-header.php +++ b/templates/partials/page-header.blade.php @@ -1,3 +1,3 @@ diff --git a/templates/partials/sidebar.blade.php b/templates/partials/sidebar.blade.php new file mode 100644 index 0000000..471740f --- /dev/null +++ b/templates/partials/sidebar.blade.php @@ -0,0 +1 @@ +{!! dynamic_sidebar('sidebar-primary') !!} diff --git a/templates/partials/sidebar.php b/templates/partials/sidebar.php deleted file mode 100644 index 244f9b7..0000000 --- a/templates/partials/sidebar.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/templates/search.blade.php b/templates/search.blade.php new file mode 100644 index 0000000..9e1bf08 --- /dev/null +++ b/templates/search.blade.php @@ -0,0 +1,20 @@ +@extends('layouts.base') + +@section('content') + @include('partials.page-header') + + @if(!have_posts()) +
+ {{ __('Sorry, no results were found.', 'sage') }} +
+ {!! get_search_form(false) !!} + @endif + + @while(have_posts()) + {!! the_post() !!} + @include('partials.content-search') + @endwhile + + {{ get_the_posts_navigation() }} + +@endsection diff --git a/templates/search.php b/templates/search.php deleted file mode 100644 index 8786fa1..0000000 --- a/templates/search.php +++ /dev/null @@ -1,14 +0,0 @@ - - - -
- -
- - - - - - - - diff --git a/templates/single.blade.php b/templates/single.blade.php new file mode 100644 index 0000000..b818a77 --- /dev/null +++ b/templates/single.blade.php @@ -0,0 +1,9 @@ +@extends('layouts.base') + +@section('content') + @while(have_posts()) + {!! the_post() !!} + @include('partials/content-single') + @endwhile +@endsection + diff --git a/templates/single.php b/templates/single.php deleted file mode 100644 index 5e65d2e..0000000 --- a/templates/single.php +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/templates/template-custom.blade.php b/templates/template-custom.blade.php new file mode 100644 index 0000000..bc5f8da --- /dev/null +++ b/templates/template-custom.blade.php @@ -0,0 +1,15 @@ + + +@extends('layouts.base') + +@section('content') + @while(have_posts()) + {!! the_post() !!} + @include('partials.page-header') + @include('partials.content-page') + @endwhile +@endsection diff --git a/templates/template-custom.php b/templates/template-custom.php deleted file mode 100644 index d0bcd12..0000000 --- a/templates/template-custom.php +++ /dev/null @@ -1,10 +0,0 @@ - - - - - -