diff --git a/.travis.yml b/.travis.yml index 4bc8d16..1688acf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ language: php php: - 7.0 - 5.6 - - 5.5 - nightly env: @@ -33,7 +32,7 @@ before_install: - composer self-update install: - - source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION && nvm use $TRAVIS_NODE_VERSION + - source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION && nvm use $TRAVIS_NODE_VERSION - travis_retry npm install -g npm@latest - travis_retry npm install -g eslint - node -v && npm -v diff --git a/CHANGELOG.md b/CHANGELOG.md index fe2fc51..845ca2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ ### HEAD +* Add Blade ([#1765](https://github.com/roots/sage/pull/1765)) * Remove sidebar defaults ([#1760](https://github.com/roots/sage/pull/1760)) * Remove post formats ([#1759](https://github.com/roots/sage/pull/1759)) diff --git a/README.md b/README.md index 3702de0..c5e32ce 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Sage is a WordPress starter theme with a modern development workflow. * [Webpack](https://webpack.github.io/) for compiling assets, optimizing images, and concatenating and minifying files * [BrowserSync](http://www.browsersync.io/) for synchronized browser testing * [Bootstrap 4](http://getbootstrap.com/) for a front-end framework (can be removed or replaced) -* Template inheritance with the [theme wrapper](https://roots.io/sage/docs/theme-wrapper/) +* [Laravel Blade](https://laravel.com/docs/5.3/blade) as a templating engine See a working example at [roots-example-project.com](https://roots-example-project.com/). @@ -22,16 +22,16 @@ See a working example at [roots-example-project.com](https://roots-example-proje Make sure all dependencies have been installed before moving on: -* [PHP](http://php.net/manual/en/install.php) >= 5.5.x +* [PHP](http://php.net/manual/en/install.php) >= 5.6.4 * [Composer](https://getcomposer.org/download/) -* [Node.js](http://nodejs.org/) >= 4.5 +* [Node.js](http://nodejs.org/) >= 6.9.x ## Theme installation Install Sage using Composer from your WordPress themes directory (replace `your-theme-name` below with the name of your theme): ```shell -# @ example.com/site/web/app/themes/ +# @ app/themes/ or wp-content/themes/ $ composer create-project roots/sage your-theme-name dev-master ``` @@ -55,7 +55,7 @@ themes/your-theme-name/ # → Root of your Sage based theme ├── package.json # → Node.js dependencies and scripts ├── screenshot.png # → Theme screenshot for WP admin ├── src/ # → Theme PHP -│   ├── lib/Sage/ # → Theme wrapper, asset manifest +│   ├── lib/Sage/ # → Blade implementation, asset manifest │   ├── admin.php # → Theme customizer setup │   ├── filters.php # → Theme filters │   ├── helpers.php # → Helper functions @@ -98,9 +98,9 @@ You now have all the necessary dependencies to run the build process. * `npm run lint` — Run eslint against your assets and build scripts * `composer test` — Check your PHP for code smells with `phpmd` and PSR-2 compliance with `phpcs` -### Using BrowserSync +### Using Browsersync -To use BrowserSync during `npm start` you need to update `devUrl` at the bottom of `assets/config.json` to reflect your local development hostname. +To use Browsersync during `npm start` you need to update `devUrl` at the bottom of `assets/config.json` to reflect your local development hostname. If your local development URL is `https://project-name.dev`, update the file to read: ```json @@ -117,9 +117,9 @@ If you are not using [Bedrock](https://roots.io/bedrock/), update `publicPath` t ... ``` -By default, BrowserSync will use webpack's [HMR](https://webpack.github.io/docs/hot-module-replacement.html), which won't trigger a page reload in your browser. +By default, Browsersync will use webpack's [HMR](https://webpack.github.io/docs/hot-module-replacement.html), which won't trigger a page reload in your browser. -If you would like to force BrowserSync to reload the page whenever certain file types are edited, then add them to `watch` in `assets/config.json`. +If you would like to force Browsersync to reload the page whenever certain file types are edited, then add them to `watch` in `assets/config.json`. ```json ... diff --git a/composer.json b/composer.json index 0caf4ed..7de0f37 100644 --- a/composer.json +++ b/composer.json @@ -29,8 +29,10 @@ } }, "require": { - "php": ">=5.5.0", - "composer/installers": "~1.0" + "php": ">=5.6.4", + "composer/installers": "~1.0", + "illuminate/view": "^5.3", + "jenssegers/blade": "dev-master#59ba2cc" }, "require-dev": { "squizlabs/php_codesniffer": "^2.5.1", diff --git a/composer.lock b/composer.lock index 6fae444..52b86a2 100644 --- a/composer.lock +++ b/composer.lock @@ -4,21 +4,21 @@ "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": "91797de2d3afdfa1a932e8c0dfe808fe", + "content-hash": "b772c090cb59fb89a2df691ecd1ffe98", "packages": [ { "name": "composer/installers", - "version": "v1.0.23", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/composer/installers.git", - "reference": "6213d900e92647831f7a406d5c530ea1f3d4360e" + "reference": "d78064c68299743e0161004f2de3a0204e33b804" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/installers/zipball/6213d900e92647831f7a406d5c530ea1f3d4360e", - "reference": "6213d900e92647831f7a406d5c530ea1f3d4360e", + "url": "https://api.github.com/repos/composer/installers/zipball/d78064c68299743e0161004f2de3a0204e33b804", + "reference": "d78064c68299743e0161004f2de3a0204e33b804", "shasum": "" }, "require": { @@ -40,8 +40,8 @@ } }, "autoload": { - "psr-0": { - "Composer\\Installers\\": "src/" + "psr-4": { + "Composer\\Installers\\": "src/Composer/Installers" } }, "notification-url": "https://packagist.org/downloads/", @@ -56,28 +56,35 @@ } ], "description": "A multi-framework Composer library installer", - "homepage": "http://composer.github.com/installers/", + "homepage": "https://composer.github.io/installers/", "keywords": [ "Craft", "Dolibarr", "Hurad", + "ImageCMS", "MODX Evo", + "Mautic", "OXID", + "Plentymarkets", + "RadPHP", "SMF", "Thelia", "WolfCMS", "agl", "aimeos", "annotatecms", + "attogram", "bitrix", "cakephp", "chef", + "cockpit", "codeigniter", "concrete5", "croogo", "dokuwiki", "drupal", "elgg", + "expressionengine", "fuelphp", "grav", "installer", @@ -94,31 +101,634 @@ "piwik", "ppi", "puppet", + "reindex", "roundcube", "shopware", "silverstripe", "symfony", "typo3", "wordpress", + "yawik", "zend", "zikula" ], - "time": "2016-01-27 12:54:22" + "time": "2016-08-13 20:53:52" + }, + { + "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": "jenssegers/blade", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/jenssegers/blade.git", + "reference": "59ba2cc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jenssegers/blade/zipball/59ba2cc", + "reference": "59ba2cc", + "shasum": "" + }, + "require": { + "illuminate/view": "^5.1" + }, + "require-dev": { + "mockery/mockery": "^0.9", + "phpunit/phpunit": "^4.0|^5.0", + "satooshi/php-coveralls": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Jenssegers\\Blade\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jens Segers", + "homepage": "https://jenssegers.com" + } + ], + "description": "The standalone version of Laravel's Blade templating engine for use outside of Laravel.", + "keywords": [ + "blade", + "laravel", + "render", + "template", + "view" + ], + "time": "2016-08-23 11:51:53" + }, + { + "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": [ { "name": "pdepend/pdepend", - "version": "2.2.4", + "version": "2.3.2", "source": { "type": "git", "url": "https://github.com/pdepend/pdepend.git", - "reference": "b086687f3a01dc6bb92d633aef071d2c5dd0db06" + "reference": "8d7ab8fe8c1f9de5056bb7ea2c0852f4ddd44f90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pdepend/pdepend/zipball/b086687f3a01dc6bb92d633aef071d2c5dd0db06", - "reference": "b086687f3a01dc6bb92d633aef071d2c5dd0db06", + "url": "https://api.github.com/repos/pdepend/pdepend/zipball/8d7ab8fe8c1f9de5056bb7ea2c0852f4ddd44f90", + "reference": "8d7ab8fe8c1f9de5056bb7ea2c0852f4ddd44f90", "shasum": "" }, "require": { @@ -145,25 +755,25 @@ "BSD-3-Clause" ], "description": "Official version of pdepend to be handled with Composer", - "time": "2016-03-10 15:15:04" + "time": "2016-11-23 20:25:02" }, { "name": "phpmd/phpmd", - "version": "2.4.2", + "version": "2.5.0", "source": { "type": "git", "url": "https://github.com/phpmd/phpmd.git", - "reference": "fccbdb6b222f6d7a6d35af1c396ba5435cec76a9" + "reference": "9298602a922cd8c46666df8d540a60bc5925ce55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpmd/phpmd/zipball/fccbdb6b222f6d7a6d35af1c396ba5435cec76a9", - "reference": "fccbdb6b222f6d7a6d35af1c396ba5435cec76a9", + "url": "https://api.github.com/repos/phpmd/phpmd/zipball/9298602a922cd8c46666df8d540a60bc5925ce55", + "reference": "9298602a922cd8c46666df8d540a60bc5925ce55", "shasum": "" }, "require": { - "pdepend/pdepend": "~2.0", - "php": ">=5.3.0" + "pdepend/pdepend": "^2.0.4", + "php": ">=5.3.9" }, "require-dev": { "phpunit/phpunit": "^4.0", @@ -210,23 +820,24 @@ "phpmd", "pmd" ], - "time": "2016-03-10 17:17:44" + "time": "2016-11-23 20:33:32" }, { "name": "squizlabs/php_codesniffer", - "version": "2.5.1", + "version": "2.7.1", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "6731851d6aaf1d0d6c58feff1065227b7fda3ba8" + "reference": "9b324f3a1132459a7274a0ace2e1b766ba80930f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/6731851d6aaf1d0d6c58feff1065227b7fda3ba8", - "reference": "6731851d6aaf1d0d6c58feff1065227b7fda3ba8", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/9b324f3a1132459a7274a0ace2e1b766ba80930f", + "reference": "9b324f3a1132459a7274a0ace2e1b766ba80930f", "shasum": "" }, "require": { + "ext-simplexml": "*", "ext-tokenizer": "*", "ext-xmlwriter": "*", "php": ">=5.1.2" @@ -287,33 +898,36 @@ "phpcs", "standards" ], - "time": "2016-01-19 23:39:10" + "time": "2016-11-30 04:02:31" }, { "name": "symfony/config", - "version": "v3.0.4", + "version": "v3.2.0", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "980ee40c28f00acff8906c11b778aab5f0db74c2" + "reference": "4a68f8953180bf77ea65f585020f4db0b18600b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/980ee40c28f00acff8906c11b778aab5f0db74c2", - "reference": "980ee40c28f00acff8906c11b778aab5f0db74c2", + "url": "https://api.github.com/repos/symfony/config/zipball/4a68f8953180bf77ea65f585020f4db0b18600b4", + "reference": "4a68f8953180bf77ea65f585020f4db0b18600b4", "shasum": "" }, "require": { "php": ">=5.5.9", "symfony/filesystem": "~2.8|~3.0" }, + "require-dev": { + "symfony/yaml": "~3.0" + }, "suggest": { "symfony/yaml": "To use the yaml reference dumper" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -340,39 +954,43 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2016-03-04 07:55:57" + "time": "2016-11-29 11:12:32" }, { "name": "symfony/dependency-injection", - "version": "v3.0.4", + "version": "v3.2.0", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "6a9058101b591edced21ca3c83c80a3978f5c6b0" + "reference": "f5419adad083c90e0dfd8588ef83683d7dbcc20d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/6a9058101b591edced21ca3c83c80a3978f5c6b0", - "reference": "6a9058101b591edced21ca3c83c80a3978f5c6b0", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/f5419adad083c90e0dfd8588ef83683d7dbcc20d", + "reference": "f5419adad083c90e0dfd8588ef83683d7dbcc20d", "shasum": "" }, "require": { "php": ">=5.5.9" }, + "conflict": { + "symfony/yaml": "<3.2" + }, "require-dev": { "symfony/config": "~2.8|~3.0", "symfony/expression-language": "~2.8|~3.0", - "symfony/yaml": "~2.8|~3.0" + "symfony/yaml": "~3.2" }, "suggest": { "symfony/config": "", + "symfony/expression-language": "For using expressions in service container configuration", "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", "symfony/yaml": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -399,20 +1017,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2016-03-30 10:41:14" + "time": "2016-11-25 12:32:42" }, { "name": "symfony/filesystem", - "version": "v3.0.4", + "version": "v3.2.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "f82499a459dcade2ea56df94cc58b19c8bde3d20" + "reference": "8d4cf7561a5b17e5eb7a02b80d0b8f014a3796d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/f82499a459dcade2ea56df94cc58b19c8bde3d20", - "reference": "f82499a459dcade2ea56df94cc58b19c8bde3d20", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/8d4cf7561a5b17e5eb7a02b80d0b8f014a3796d4", + "reference": "8d4cf7561a5b17e5eb7a02b80d0b8f014a3796d4", "shasum": "" }, "require": { @@ -421,7 +1039,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -448,16 +1066,18 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2016-03-27 10:24:39" + "time": "2016-11-24 00:46:43" } ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "jenssegers/blade": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=5.5.0" + "php": ">=5.6.4" }, "platform-dev": [] } diff --git a/index.php b/index.php index 04501c1..d8704e2 100644 --- a/index.php +++ b/index.php @@ -1,3 +1,3 @@ classes */ @@ -32,11 +29,28 @@ add_filter('excerpt_more', function () { }); /** - * Use theme wrapper + * Template Hierarchy should search for .blade.php files */ -add_filter('template_include', function ($main) { - if (!is_string($main) && !(is_object($main) && method_exists($main, '__toString'))) { - return $main; - } - return ((new Template(new Wrapper($main)))->layout()); -}, 109); +array_map(function ($tag) { + add_filter("{$tag}_template_hierarchy", function ($templates) { + return array_merge(str_replace('.php', '.blade.php', $templates), $templates); + }); +}, [ + 'index', '404', 'archive', 'author', 'category', 'tag', 'taxonomy', 'date', 'home', + 'front_page', 'page', 'paged', 'search', 'single', 'singular', 'attachment' +]); + +/** + * Render page using Blade + */ +add_filter('template_include', function ($template) { + echo template($template); + + // Return a blank file to make WordPress happy + return get_template_directory() . '/index.php'; +}, 1000); + +/** + * Tell WordPress how to find the compiled path of comments.blade.php + */ +add_filter('comments_template', 'App\\template_path'); diff --git a/src/helpers.php b/src/helpers.php index db3c2c3..304d786 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -2,30 +2,50 @@ namespace App; -use Roots\Sage\Asset; -use Roots\Sage\Assets\JsonManifest; -use Roots\Sage\Template; +use Roots\Sage\Container; -function template($layout = 'base') +/** + * @param string $name + * @return Container|mixed + */ +function sage($name = '') { - return Template::$instances[$layout]; -} - -function template_part($template, array $context = [], $layout = 'base') -{ - extract($context); - include template($layout)->partial($template); + static $container; + if (!$container) { + $container = new Container; + } + return $name ? (isset($container[$name]) ? $container[$name] : $container["sage.{$name}"]) : $container; } /** - * @param $filename + * + * @param string $file + * @param array $data * @return string */ -function asset_path($filename) +function template($file, $data = []) { - static $manifest; - isset($manifest) || $manifest = new JsonManifest(get_stylesheet_directory() . '/' . Asset::$dist . '/assets.json'); - return (string) new Asset($filename, $manifest); + return sage('blade')->render($file, $data); +} + +/** + * Retrieve path to a compiled blade view + * @param $file + * @param array $data + * @return string + */ +function template_path($file, $data = []) +{ + return sage('blade')->compiledPath($file, $data); +} + +/** + * @param $asset + * @return string + */ +function asset_path($asset) +{ + return sage('assets')->getUri($asset); } /** diff --git a/src/lib/Sage/Asset.php b/src/lib/Sage/Asset.php deleted file mode 100644 index aeee9cc..0000000 --- a/src/lib/Sage/Asset.php +++ /dev/null @@ -1,39 +0,0 @@ -manifest = $manifest; - $this->asset = $file; - } - - public function __toString() - { - return $this->getUri(); - } - - public function getUri() - { - $file = ($this->manifest ? $this->manifest->get($this->asset) : $this->asset); - return get_template_directory_uri() . self::$dist . "/$file"; - } -} diff --git a/src/lib/Sage/Assets/JsonManifest.php b/src/lib/Sage/Assets/JsonManifest.php index a7835fa..37e5839 100644 --- a/src/lib/Sage/Assets/JsonManifest.php +++ b/src/lib/Sage/Assets/JsonManifest.php @@ -10,26 +10,32 @@ namespace Roots\Sage\Assets; class JsonManifest implements ManifestInterface { /** @var array */ - protected $manifest = []; + public $manifest; + + /** @var string */ + public $dist; /** * JsonManifest constructor + * * @param string $manifestPath Local filesystem path to JSON-encoded manifest + * @param string $distUri Remote URI to assets root */ - public function __construct($manifestPath) + public function __construct($manifestPath, $distUri) { $this->manifest = file_exists($manifestPath) ? json_decode(file_get_contents($manifestPath), true) : []; + $this->dist = $distUri; } /** @inheritdoc */ - public function get($file) + public function get($asset) { - return isset($this->manifest[$file]) ? $this->manifest[$file] : $file; + return isset($this->manifest[$asset]) ? $this->manifest[$asset] : $asset; } /** @inheritdoc */ - public function getAll() + public function getUri($asset) { - return $this->manifest; + return "{$this->dist}/{$this->get($asset)}"; } } diff --git a/src/lib/Sage/Assets/ManifestInterface.php b/src/lib/Sage/Assets/ManifestInterface.php index e2583af..a1542ee 100644 --- a/src/lib/Sage/Assets/ManifestInterface.php +++ b/src/lib/Sage/Assets/ManifestInterface.php @@ -12,17 +12,20 @@ interface ManifestInterface /** * Get the cache-busted filename * - * If the manifest does not have an entry for $file, then return $file + * If the manifest does not have an entry for $asset, then return $asset * - * @param string $file The original name of the file before cache-busting + * @param string $asset The original name of the file before cache-busting * @return string */ - public function get($file); + public function get($asset); /** - * Get the asset manifest + * Get the cache-busted URI * - * @return array + * If the manifest does not have an entry for $asset, then return URI for $asset + * + * @param string $asset The original name of the file before cache-busting + * @return string */ - public function getAll(); + public function getUri($asset); } diff --git a/src/lib/Sage/Container.php b/src/lib/Sage/Container.php new file mode 100644 index 0000000..c015e24 --- /dev/null +++ b/src/lib/Sage/Container.php @@ -0,0 +1,10 @@ +wrapper = $wrapper; - self::$instances[$wrapper->slug()] = $this; - } - - /** - * @return string Layout (FQPN of, e.g., `base-page.php`, `base.php`) - */ - public function layout() - { - return $this->wrapper->wrap(); - } - - /** - * @return string Main template (FQPN of, e.g., `page.php`, `single.php`, `singular.php`) - */ - public function main() - { - return $this->wrapper->unwrap(); - } - - /** - * @param string $template Delimited template path - * @return string Partial template (FQPN of, e.g., `content.php`, `page-header.php` - */ - public function partial($template) - { - return (new Partial($template, $this->main()))->path(); - } -} diff --git a/src/lib/Sage/Template/BladeProvider.php b/src/lib/Sage/Template/BladeProvider.php new file mode 100644 index 0000000..0c7bd0d --- /dev/null +++ b/src/lib/Sage/Template/BladeProvider.php @@ -0,0 +1,80 @@ +container['view']->make($this->normalizeViewPath($view), $data, $mergeData); + } + + /** + * @param string $view + * @param array $data + * @param array $mergeData + * @return string + */ + public function render($view, $data = [], $mergeData = []) + { + return $this->make($view, $data, $mergeData)->render(); + } + + /** + * @param string $file + * @param array $data + * @param array $mergeData + * @return string + */ + public function compiledPath($file, $data = [], $mergeData = []) + { + $rendered = $this->make($file, $data, $mergeData); + $engine = $rendered->getEngine(); + + if (!($engine instanceof CompilerEngine)) { + // Using PhpEngine, so just return the file + return $file; + } + + $compiler = $engine->getCompiler(); + $compiledPath = $compiler->getCompiledPath($rendered->getPath()); + if ($compiler->isExpired($compiledPath)) { + $compiler->compile($file); + } + return $compiledPath; + } + + /** + * @param string $file + * @return string + */ + public function normalizeViewPath($file) + { + // Convert `\` to `/` + $view = str_replace('\\', '/', $file); + + // Remove unnecessary parts of the path + $view = str_replace(array_merge((array) $this->viewPaths, ['.blade.php', '.php']), '', $view); + + // Remove leading slashes + $view = ltrim($view, '/'); + + // Convert `/` to `.` + return str_replace('/', '.', $view); + } +} diff --git a/src/lib/Sage/Template/Partial.php b/src/lib/Sage/Template/Partial.php deleted file mode 100644 index daa8dc4..0000000 --- a/src/lib/Sage/Template/Partial.php +++ /dev/null @@ -1,72 +0,0 @@ -template = $template; - $this->main = $main; - } - - public function __toString() - { - return (string) $this->path(); - } - - /** - * Converts template into array of parts to be passed to locate_template() - * - * Here's an example of what happens: - * (new Template('partials/content-single-audio'))->parts(); - * // => ['partials/content-single-audio.php', 'partials/content-single.php', 'partials/content.php'] - * @return array Array of parts to pass to locate_template() - */ - public function parts() - { - if ($parts = $this->cache('parts')) { - return $parts; - } - $parts = explode($this->delimiter, str_replace('.php', '', $this->template)); - $templates[] = array_shift($parts); - foreach ($parts as $i => $part) { - $templates[] = $templates[$i] . $this->delimiter . $part; - } - if ($this->main) { - $templates = array_merge($templates, array_map(function ($template) { - return $template . $this->delimiter . basename($this->main, '.php'); - }, $templates)); - } - $templates = array_map(function ($template) { - return $template . '.php'; - }, $templates); - return $this->cache('parts', array_reverse($templates)); - } - - /** - * Passes $this->parts() to locate_template() to retrieve template location - * @return string Location of template - */ - public function path() - { - if (!$path = $this->cache('path')) { - $path = $this->cache('path', locate_template($this->parts())); - } - return apply_filters('sage/partial_' . basename($path, '.php'), $path, $this->parts()) ?: $path; - } - - protected function cache($key, $value = null) - { - if ($value !== null) { - self::$cache[$this->template][$key] = $value; - } - return isset(self::$cache[$this->template][$key]) ? self::$cache[$this->template][$key] : null; - } -} diff --git a/src/lib/Sage/Template/Wrapper.php b/src/lib/Sage/Template/Wrapper.php deleted file mode 100644 index b751d65..0000000 --- a/src/lib/Sage/Template/Wrapper.php +++ /dev/null @@ -1,64 +0,0 @@ -slug = sanitize_title(basename($base, '.php')); - $this->wrapper = [$base]; - $this->template = $template; - $str = substr($base, 0, -4); - array_unshift($this->wrapper, sprintf($str . '-%s.php', basename($template, '.php'))); - } - - /** - * @return string - * @see getTemplate - */ - public function __toString() - { - return $this->unwrap(); - } - - /** {@inheritdoc} */ - public function wrap() - { - $wrappers = apply_filters('sage/wrap_' . $this->slug, $this->wrapper) ?: $this->wrapper; - return locate_template($wrappers); - } - - /** {@inheritdoc} */ - public function slug() - { - return $this->slug; - } - - /** {@inheritdoc} */ - public function unwrap() - { - $template = apply_filters('sage/unwrap_' . $this->slug, $this->template) ?: $this->template; - return locate_template($template) ?: $template; - } -} diff --git a/src/lib/Sage/Template/WrapperInterface.php b/src/lib/Sage/Template/WrapperInterface.php deleted file mode 100644 index dcb9eb3..0000000 --- a/src/lib/Sage/Template/WrapperInterface.php +++ /dev/null @@ -1,29 +0,0 @@ -singleton('sage.assets', function () { + return new JsonManifest( + get_stylesheet_directory().'/dist/assets.json', + get_stylesheet_directory_uri().'/dist' + ); +}); + +/** + * Add Blade to Sage container + */ +sage()->singleton('sage.blade', function () { + $cachePath = wp_upload_dir()['basedir'].'/cache/compiled'; + if (!file_exists($cachePath)) { + wp_mkdir_p($cachePath); + } + return new BladeProvider(TEMPLATEPATH, $cachePath, sage()); +}); + +/** + * Create @asset() Blade directive + */ +sage('blade')->compiler()->directive('asset', function ($asset) { + return ''; +}); /** * Theme assets diff --git a/templates/404.blade.php b/templates/404.blade.php new file mode 100644 index 0000000..384c394 --- /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..cc334fb --- /dev/null +++ b/templates/index.blade.php @@ -0,0 +1,18 @@ +@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()) @php the_post() @endphp + @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..dbde60f --- /dev/null +++ b/templates/layouts/base.blade.php @@ -0,0 +1,28 @@ + + + @include('partials.head') + + + @php do_action('get_header') @endphp + @include('partials.header') +
+
+
+ @yield('content') +
+ @if (App\display_sidebar()) + + @endif +
+
+ @php do_action('get_footer') @endphp + @include('partials.footer') + @php wp_footer() @endphp + + 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..8ab09bc --- /dev/null +++ b/templates/page.blade.php @@ -0,0 +1,8 @@ +@extends('layouts.base') + +@section('content') + @while(have_posts()) @php the_post() @endphp + @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..a8c4d2e --- /dev/null +++ b/templates/partials/comments.blade.php @@ -0,0 +1,38 @@ +@php +if (post_password_required()) { + return; +} +@endphp + +
+ @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 + + @php comment_form() @endphp +
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..14fb20c --- /dev/null +++ b/templates/partials/content-page.blade.php @@ -0,0 +1,2 @@ +@php the_content() @endphp +{!! 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..d1a0dd3 --- /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 +
+
+ @php the_excerpt() @endphp +
+
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..f251483 --- /dev/null +++ b/templates/partials/content-single.blade.php @@ -0,0 +1,13 @@ +
+
+

{{ get_the_title() }}

+ @include('partials/entry-meta') +
+
+ @php the_content() @endphp +
+ + @php comments_template('/templates/partials/comments.blade.php') @endphp +
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..5035e81 --- /dev/null +++ b/templates/partials/content.blade.php @@ -0,0 +1,9 @@ +
+
+

{{ get_the_title() }}

+ @include('partials/entry-meta') +
+
+ @php the_excerpt() @endphp +
+
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 59% rename from templates/partials/footer.php rename to templates/partials/footer.blade.php index 050d688..da9feba 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 88% rename from templates/partials/head.php rename to templates/partials/head.blade.php index 9028b7d..4f0e833 100644 --- a/templates/partials/head.php +++ b/templates/partials/head.blade.php @@ -2,5 +2,5 @@ - + @php wp_head() @endphp diff --git a/templates/partials/header.blade.php b/templates/partials/header.blade.php new file mode 100644 index 0000000..4af67fc --- /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..e60521f 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..a740998 --- /dev/null +++ b/templates/partials/sidebar.blade.php @@ -0,0 +1 @@ +@php dynamic_sidebar('sidebar-primary') @endphp 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..bb311ed --- /dev/null +++ b/templates/search.blade.php @@ -0,0 +1,18 @@ +@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()) @php the_post() @endphp + @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..bfe1890 --- /dev/null +++ b/templates/single.blade.php @@ -0,0 +1,8 @@ +@extends('layouts.base') + +@section('content') + @while(have_posts()) @php the_post() @endphp + @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..228e2b7 --- /dev/null +++ b/templates/template-custom.blade.php @@ -0,0 +1,14 @@ +@php +/** + * Template Name: Custom Template + */ +@endphp + +@extends('layouts.base') + +@section('content') + @while(have_posts()) @php the_post() @endphp + @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 @@ - - - - - -