Merge branch 'master' of github.com:roots/sage
This commit is contained in:
@@ -13,5 +13,5 @@ insert_final_newline = true
|
|||||||
[*.php]
|
[*.php]
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
|
|
||||||
[templates/**.php]
|
[resources/views/**.php]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|||||||
3
.stylelintrc
Normal file
3
.stylelintrc
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"extends": "stylelint-config-standard"
|
||||||
|
}
|
||||||
@@ -1,9 +1,12 @@
|
|||||||
### HEAD
|
### 9.0.0-beta.3: April 21st, 2017
|
||||||
|
* Move required theme files to `sage/resources` ([#1877](https://github.com/roots/sage/pull/1877))
|
||||||
|
* Move `src/` to `app/` ([#1868](https://github.com/roots/sage/pull/1868))
|
||||||
|
* Move `templates/` to `resources/views/`, move `assets/` to `resources/assets/`, rename `base.blade.php` to `app.blade.php` ([#1864](https://github.com/roots/sage/pull/1864))
|
||||||
* Add option to configure build settings ([#1822](https://github.com/roots/sage/pull/1822))
|
* Add option to configure build settings ([#1822](https://github.com/roots/sage/pull/1822))
|
||||||
* Add support for HTML injection ([#1817](https://github.com/roots/sage/pull/1817))
|
* Add support for HTML injection ([#1817](https://github.com/roots/sage/pull/1817))
|
||||||
* Add Tachyons as a CSS framework option ([#1867](https://github.com/roots/sage/pull/1867))
|
* Add Tachyons as a CSS framework option ([#1867](https://github.com/roots/sage/pull/1867))
|
||||||
|
|
||||||
### 9.0.0-beta.2: January 19th, 2016
|
### 9.0.0-beta.2: January 19th, 2017
|
||||||
* Fix Browersync ([#1815](https://github.com/roots/sage/pull/1815))
|
* Fix Browersync ([#1815](https://github.com/roots/sage/pull/1815))
|
||||||
* Add option to select CSS framework, add Foundation as an option ([#1813](https://github.com/roots/sage/pull/1813))
|
* Add option to select CSS framework, add Foundation as an option ([#1813](https://github.com/roots/sage/pull/1813))
|
||||||
* Add option to add Font Awesome ([#1812](https://github.com/roots/sage/pull/1812))
|
* Add option to add Font Awesome ([#1812](https://github.com/roots/sage/pull/1812))
|
||||||
@@ -16,7 +19,7 @@
|
|||||||
* Allow browser versions to be configured in `config.json` ([#1798](https://github.com/roots/sage/pull/1798))
|
* Allow browser versions to be configured in `config.json` ([#1798](https://github.com/roots/sage/pull/1798))
|
||||||
* Use stock ESLint ([#1796](https://github.com/roots/sage/pull/1796))
|
* Use stock ESLint ([#1796](https://github.com/roots/sage/pull/1796))
|
||||||
|
|
||||||
### 9.0.0-beta.1: January 10th, 2016
|
### 9.0.0-beta.1: January 10th, 2017
|
||||||
* Update to Bootstrap 4 Alpha 6 ([#1792](https://github.com/roots/sage/pull/1792))
|
* Update to Bootstrap 4 Alpha 6 ([#1792](https://github.com/roots/sage/pull/1792))
|
||||||
* Add Blade ([#1765](https://github.com/roots/sage/pull/1765) and [#1777](https://github.com/roots/sage/pull/1777))
|
* Add Blade ([#1765](https://github.com/roots/sage/pull/1765) and [#1777](https://github.com/roots/sage/pull/1777))
|
||||||
* Remove sidebar defaults ([#1760](https://github.com/roots/sage/pull/1760))
|
* Remove sidebar defaults ([#1760](https://github.com/roots/sage/pull/1760))
|
||||||
|
|||||||
105
README.md
105
README.md
@@ -2,7 +2,6 @@
|
|||||||
[](https://packagist.org/packages/roots/sage)
|
[](https://packagist.org/packages/roots/sage)
|
||||||
[](https://david-dm.org/roots/sage#info=devDependencies)
|
[](https://david-dm.org/roots/sage#info=devDependencies)
|
||||||
[](https://travis-ci.org/roots/sage)
|
[](https://travis-ci.org/roots/sage)
|
||||||
[](https://roots.io/r/es6)
|
|
||||||
|
|
||||||
Sage is a WordPress starter theme with a modern development workflow.
|
Sage is a WordPress starter theme with a modern development workflow.
|
||||||
|
|
||||||
@@ -24,6 +23,10 @@ Sage is a WordPress starter theme with a modern development workflow.
|
|||||||
|
|
||||||
See a working example at [roots-example-project.com](https://roots-example-project.com/).
|
See a working example at [roots-example-project.com](https://roots-example-project.com/).
|
||||||
|
|
||||||
|
### Recommended extensions
|
||||||
|
|
||||||
|
* [Controller](https://github.com/soberwp/controller) — WordPress plugin to enable a basic controller when using Blade with Sage 9
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
Make sure all dependencies have been installed before moving on:
|
Make sure all dependencies have been installed before moving on:
|
||||||
@@ -54,52 +57,45 @@ During theme installation you will have the options to:
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
themes/your-theme-name/ # → Root of your Sage based theme
|
themes/your-theme-name/ # → Root of your Sage based theme
|
||||||
├── assets # → Front-end assets
|
├── app/ # → Theme PHP
|
||||||
│ ├── config.json # → Settings for compiled assets
|
│ ├── lib/Sage/ # → Blade implementation, asset manifest
|
||||||
│ ├── build/ # → Webpack and ESLint config
|
│ ├── admin.php # → Theme customizer setup
|
||||||
│ ├── fonts/ # → Theme fonts
|
│ ├── filters.php # → Theme filters
|
||||||
│ ├── images/ # → Theme images
|
│ ├── helpers.php # → Helper functions
|
||||||
│ ├── scripts/ # → Theme JS
|
│ └── setup.php # → Theme setup
|
||||||
│ └── styles/ # → Theme stylesheets
|
├── composer.json # → Autoloading for `app/` files
|
||||||
├── composer.json # → Autoloading for `src/` files
|
|
||||||
├── composer.lock # → Composer lock file (never edit)
|
├── composer.lock # → Composer lock file (never edit)
|
||||||
├── dist/ # → Built theme assets (never edit)
|
├── dist/ # → Built theme assets (never edit)
|
||||||
├── functions.php # → Composer autoloader, theme includes
|
|
||||||
├── index.php # → Never manually edit
|
|
||||||
├── node_modules/ # → Node.js packages (never edit)
|
├── node_modules/ # → Node.js packages (never edit)
|
||||||
├── package.json # → Node.js dependencies and scripts
|
├── package.json # → Node.js dependencies and scripts
|
||||||
├── screenshot.png # → Theme screenshot for WP admin
|
├── resources/ # → Theme assets and templates
|
||||||
├── src/ # → Theme PHP
|
│ ├── assets/ # → Front-end assets
|
||||||
│ ├── lib/Sage/ # → Blade implementation, asset manifest
|
│ │ ├── config.json # → Settings for compiled assets
|
||||||
│ ├── admin.php # → Theme customizer setup
|
│ │ ├── build/ # → Webpack and ESLint config
|
||||||
│ ├── filters.php # → Theme filters
|
│ │ ├── fonts/ # → Theme fonts
|
||||||
│ ├── helpers.php # → Helper functions
|
│ │ ├── images/ # → Theme images
|
||||||
│ └── setup.php # → Theme setup
|
│ │ ├── scripts/ # → Theme JS
|
||||||
├── style.css # → Theme meta information
|
│ │ └── styles/ # → Theme stylesheets
|
||||||
├── templates/ # → Theme templates
|
│ ├── functions.php # → Composer autoloader, theme includes
|
||||||
│ ├── layouts/ # → Base templates
|
│ ├── index.php # → Never manually edit
|
||||||
│ └── partials/ # → Partial templates
|
│ ├── screenshot.png # → Theme screenshot for WP admin
|
||||||
|
│ ├── style.css # → Theme meta information
|
||||||
|
│ └── views/ # → Theme templates
|
||||||
|
│ ├── layouts/ # → Base templates
|
||||||
|
│ └── partials/ # → Partial templates
|
||||||
└── vendor/ # → Composer packages (never edit)
|
└── vendor/ # → Composer packages (never edit)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Theme setup
|
## Theme setup
|
||||||
|
|
||||||
Edit `src/setup.php` to enable or disable theme features, setup navigation menus, post thumbnail sizes, and sidebars.
|
Edit `app/setup.php` to enable or disable theme features, setup navigation menus, post thumbnail sizes, and sidebars.
|
||||||
|
|
||||||
## Theme development
|
## Theme development
|
||||||
|
|
||||||
Sage uses [Webpack](https://webpack.github.io/) as a build tool and [npm](https://www.npmjs.com/) to manage front-end packages.
|
* Run `yarn` from the theme directory to install dependencies
|
||||||
|
* Update `resources/assets/config.json` settings:
|
||||||
### Install dependencies
|
* `devUrl` should reflect your local development hostname
|
||||||
|
* `publicPath` should reflect your WordPress folder structure (`/wp-content/themes/sage` for non-[Bedrock](https://roots.io/bedrock/) installs)
|
||||||
From the command line on your host machine (not on your Vagrant development box), navigate to the theme directory then run `yarn`:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
# @ themes/your-theme-name/
|
|
||||||
$ yarn
|
|
||||||
```
|
|
||||||
|
|
||||||
You now have all the necessary dependencies to run the build process.
|
|
||||||
|
|
||||||
### Build commands
|
### Build commands
|
||||||
|
|
||||||
@@ -107,45 +103,6 @@ You now have all the necessary dependencies to run the build process.
|
|||||||
* `yarn run build` — Compile and optimize the files in your assets directory
|
* `yarn run build` — Compile and optimize the files in your assets directory
|
||||||
* `yarn run build:production` — Compile assets for production
|
* `yarn run build:production` — Compile assets for production
|
||||||
|
|
||||||
#### Additional commands
|
|
||||||
|
|
||||||
* `yarn run rmdist` — Remove your `dist/` folder
|
|
||||||
* `yarn run lint` — Run ESLint against your assets and build scripts
|
|
||||||
* `composer test` — Check your PHP for PSR-2 compliance with `phpcs`
|
|
||||||
|
|
||||||
### Using Browsersync
|
|
||||||
|
|
||||||
To use Browsersync 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
|
|
||||||
...
|
|
||||||
"devUrl": "https://project-name.dev",
|
|
||||||
...
|
|
||||||
```
|
|
||||||
|
|
||||||
If you are not using [Bedrock](https://roots.io/bedrock/), update `publicPath` to reflect your folder structure:
|
|
||||||
|
|
||||||
```json
|
|
||||||
...
|
|
||||||
"publicPath": "/wp-content/themes/sage"
|
|
||||||
...
|
|
||||||
```
|
|
||||||
|
|
||||||
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`.
|
|
||||||
|
|
||||||
```json
|
|
||||||
...
|
|
||||||
"watch": [
|
|
||||||
"assets/scripts/**/*.js",
|
|
||||||
"templates/**/*.php",
|
|
||||||
"src/**/*.php"
|
|
||||||
],
|
|
||||||
...
|
|
||||||
```
|
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
Sage 8 documentation is available at [https://roots.io/sage/docs/](https://roots.io/sage/docs/).
|
Sage 8 documentation is available at [https://roots.io/sage/docs/](https://roots.io/sage/docs/).
|
||||||
|
|||||||
@@ -6,19 +6,24 @@ namespace App;
|
|||||||
* Add <body> classes
|
* Add <body> classes
|
||||||
*/
|
*/
|
||||||
add_filter('body_class', function (array $classes) {
|
add_filter('body_class', function (array $classes) {
|
||||||
// Add page slug if it doesn't exist
|
/** Add page slug if it doesn't exist */
|
||||||
if (is_single() || is_page() && !is_front_page()) {
|
if (is_single() || is_page() && !is_front_page()) {
|
||||||
if (!in_array(basename(get_permalink()), $classes)) {
|
if (!in_array(basename(get_permalink()), $classes)) {
|
||||||
$classes[] = basename(get_permalink());
|
$classes[] = basename(get_permalink());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add class if sidebar is active
|
/** Add class if sidebar is active */
|
||||||
if (display_sidebar()) {
|
if (display_sidebar()) {
|
||||||
$classes[] = 'sidebar-primary';
|
$classes[] = 'sidebar-primary';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $classes;
|
/** Clean up class names for custom templates */
|
||||||
|
$classes = array_map(function ($class) {
|
||||||
|
return preg_replace(['/-blade(-php)?$/', '/^page-template-views/'], '', $class);
|
||||||
|
}, $classes);
|
||||||
|
|
||||||
|
return array_filter($classes);
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -31,31 +36,30 @@ add_filter('excerpt_more', function () {
|
|||||||
/**
|
/**
|
||||||
* Template Hierarchy should search for .blade.php files
|
* Template Hierarchy should search for .blade.php files
|
||||||
*/
|
*/
|
||||||
array_map(function ($type) {
|
collect([
|
||||||
|
'index', '404', 'archive', 'author', 'category', 'tag', 'taxonomy', 'date', 'home',
|
||||||
|
'frontpage', 'page', 'paged', 'search', 'single', 'singular', 'attachment'
|
||||||
|
])->map(function ($type) {
|
||||||
add_filter("{$type}_template_hierarchy", function ($templates) {
|
add_filter("{$type}_template_hierarchy", function ($templates) {
|
||||||
return call_user_func_array('array_merge', array_map(function ($template) {
|
return collect($templates)->flatMap(function ($template) {
|
||||||
$transforms = [
|
$transforms = [
|
||||||
'%^/?(templates)?/?%' => config('sage.disable_option_hack') ? 'templates/' : '',
|
'%^/?(resources[\\/]views)?[\\/]?%' => '',
|
||||||
'%(\.blade)?(\.php)?$%' => ''
|
'%(\.blade)?(\.php)?$%' => ''
|
||||||
];
|
];
|
||||||
$normalizedTemplate = preg_replace(array_keys($transforms), array_values($transforms), $template);
|
$normalizedTemplate = preg_replace(array_keys($transforms), array_values($transforms), $template);
|
||||||
return ["{$normalizedTemplate}.blade.php", "{$normalizedTemplate}.php"];
|
return ["{$normalizedTemplate}.blade.php", "{$normalizedTemplate}.php"];
|
||||||
}, $templates));
|
})->toArray();
|
||||||
});
|
});
|
||||||
}, [
|
});
|
||||||
'index', '404', 'archive', 'author', 'category', 'tag', 'taxonomy', 'date', 'home',
|
|
||||||
'frontpage', 'page', 'paged', 'search', 'single', 'singular', 'attachment'
|
|
||||||
]);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render page using Blade
|
* Render page using Blade
|
||||||
*/
|
*/
|
||||||
add_filter('template_include', function ($template) {
|
add_filter('template_include', function ($template) {
|
||||||
$data = array_reduce(get_body_class(), function ($data, $class) use ($template) {
|
$data = collect(get_body_class())->reduce(function ($data, $class) use ($template) {
|
||||||
return apply_filters("sage/template/{$class}/data", $data, $template);
|
return apply_filters("sage/template/{$class}/data", $data, $template);
|
||||||
}, []);
|
}, []);
|
||||||
echo template($template, $data);
|
echo template($template, $data);
|
||||||
|
|
||||||
// Return a blank file to make WordPress happy
|
// Return a blank file to make WordPress happy
|
||||||
return get_theme_file_path('index.php');
|
return get_theme_file_path('index.php');
|
||||||
}, PHP_INT_MAX);
|
}, PHP_INT_MAX);
|
||||||
@@ -21,8 +21,8 @@ function sage($abstract = null, $parameters = [], ContainerContract $container =
|
|||||||
return $container;
|
return $container;
|
||||||
}
|
}
|
||||||
return $container->bound($abstract)
|
return $container->bound($abstract)
|
||||||
? $container->make($abstract, $parameters)
|
? $container->makeWith($abstract, $parameters)
|
||||||
: $container->make("sage.{$abstract}", $parameters);
|
: $container->makeWith("sage.{$abstract}", $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -18,7 +18,7 @@ class PostCreateProject
|
|||||||
'name' => 'Sage Starter Theme',
|
'name' => 'Sage Starter Theme',
|
||||||
'uri' => 'https://roots.io/sage/',
|
'uri' => 'https://roots.io/sage/',
|
||||||
'description' => 'Sage is a WordPress starter theme.',
|
'description' => 'Sage is a WordPress starter theme.',
|
||||||
'version' => '9.0.0-beta.2',
|
'version' => '9.0.0-beta.3',
|
||||||
'author' => 'Roots',
|
'author' => 'Roots',
|
||||||
'author_uri' => 'https://roots.io/'
|
'author_uri' => 'https://roots.io/'
|
||||||
];
|
];
|
||||||
@@ -31,7 +31,7 @@ class PostCreateProject
|
|||||||
'author_uri' => $io->ask('<info>Theme Author URI [<comment>'.$theme_headers_default['author_uri'].'</comment>]:</info> ', $theme_headers_default['author_uri'])
|
'author_uri' => $io->ask('<info>Theme Author URI [<comment>'.$theme_headers_default['author_uri'].'</comment>]:</info> ', $theme_headers_default['author_uri'])
|
||||||
];
|
];
|
||||||
|
|
||||||
file_put_contents('style.css', str_replace($theme_headers_default, $theme_headers, file_get_contents('style.css')));
|
file_put_contents('resources/style.css', str_replace($theme_headers_default, $theme_headers, file_get_contents('resources/style.css')));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,10 +41,10 @@ class PostCreateProject
|
|||||||
$default_framework_pattern = '"bootstrap": ".*"';
|
$default_framework_pattern = '"bootstrap": ".*"';
|
||||||
|
|
||||||
$files_to_clear = [
|
$files_to_clear = [
|
||||||
'assets/styles/components/_comments.scss',
|
'resources/assets/styles/components/_comments.scss',
|
||||||
'assets/styles/components/_forms.scss',
|
'resources/assets/styles/components/_forms.scss',
|
||||||
'assets/styles/components/_wp-classes.scss',
|
'resources/assets/styles/components/_wp-classes.scss',
|
||||||
'assets/styles/layouts/_header.scss',
|
'resources/assets/styles/layouts/_header.scss',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
@@ -62,8 +62,8 @@ class PostCreateProject
|
|||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
file_put_contents('package.json', preg_replace("/{$default_framework_pattern}/", '"foundation-sites": "6.3.0"', file_get_contents('package.json')));
|
file_put_contents('package.json', preg_replace("/{$default_framework_pattern}/", '"foundation-sites": "6.3.0"', file_get_contents('package.json')));
|
||||||
file_put_contents('assets/styles/main.scss', str_replace('@import "~bootstrap/scss/bootstrap";' . "\n", '@import "~foundation-sites/scss/foundation";' . "\n" . '@include foundation-everything;' . "\n", file_get_contents('assets/styles/main.scss')));
|
file_put_contents('resources/assets/styles/main.scss', str_replace('@import "~bootstrap/scss/bootstrap";' . "\n", '@import "~foundation-sites/scss/foundation";' . "\n" . '@include foundation-everything;' . "\n", file_get_contents('resources/assets/styles/main.scss')));
|
||||||
file_put_contents('assets/scripts/main.js', str_replace("import 'bootstrap';\n", "import 'foundation-sites/dist/js/foundation';\n", file_get_contents('assets/scripts/main.js')));
|
file_put_contents('resources/assets/scripts/main.js', str_replace("import 'bootstrap';\n", "import 'foundation-sites/dist/js/foundation';\n", file_get_contents('resources/assets/scripts/main.js')));
|
||||||
foreach($files_to_clear as $file) {
|
foreach($files_to_clear as $file) {
|
||||||
file_put_contents($file, '');
|
file_put_contents($file, '');
|
||||||
}
|
}
|
||||||
@@ -78,8 +78,8 @@ class PostCreateProject
|
|||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
file_put_contents('package.json', preg_replace("/\s+{$default_framework_pattern},/", '', file_get_contents('package.json')));
|
file_put_contents('package.json', preg_replace("/\s+{$default_framework_pattern},/", '', file_get_contents('package.json')));
|
||||||
file_put_contents('assets/styles/main.scss', str_replace('@import "~bootstrap/scss/bootstrap";' . "\n", '', file_get_contents('assets/styles/main.scss')));
|
file_put_contents('resources/assets/styles/main.scss', str_replace('@import "~bootstrap/scss/bootstrap";' . "\n", '', file_get_contents('resources/assets/styles/main.scss')));
|
||||||
file_put_contents('assets/scripts/main.js', str_replace("import 'bootstrap';\n", '', file_get_contents('assets/scripts/main.js')));
|
file_put_contents('resources/assets/scripts/main.js', str_replace("import 'bootstrap';\n", '', file_get_contents('resources/assets/scripts/main.js')));
|
||||||
foreach($files_to_clear as $file) {
|
foreach($files_to_clear as $file) {
|
||||||
file_put_contents($file, '');
|
file_put_contents($file, '');
|
||||||
}
|
}
|
||||||
@@ -102,8 +102,8 @@ class PostCreateProject
|
|||||||
file_put_contents('package.json', $package);
|
file_put_contents('package.json', $package);
|
||||||
|
|
||||||
$import_dep_str = '// Import npm dependencies' . "\n";
|
$import_dep_str = '// Import npm dependencies' . "\n";
|
||||||
file_put_contents('assets/styles/main.scss', str_replace($import_dep_str, $import_dep_str . '@import "~font-awesome/scss/font-awesome";' . "\n", file_get_contents('assets/styles/main.scss')));
|
file_put_contents('resources/assets/styles/main.scss', str_replace($import_dep_str, $import_dep_str . '@import "~font-awesome/scss/font-awesome";' . "\n", file_get_contents('resources/assets/styles/main.scss')));
|
||||||
file_put_contents('assets/styles/common/_variables.scss', "\n" . '$fa-font-path: \'~font-awesome/fonts\';' . "\n", FILE_APPEND);
|
file_put_contents('resources/assets/styles/common/_variables.scss', "\n" . '$fa-font-path: \'~font-awesome/fonts\';' . "\n", FILE_APPEND);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -125,8 +125,8 @@ class PostCreateProject
|
|||||||
'devUrl' => $io->ask('<info>Local development URL of WP site [<comment>'.$browsersync_settings_default['devUrl'].'</comment>]:</info> ', $browsersync_settings_default['devUrl'])
|
'devUrl' => $io->ask('<info>Local development URL of WP site [<comment>'.$browsersync_settings_default['devUrl'].'</comment>]:</info> ', $browsersync_settings_default['devUrl'])
|
||||||
];
|
];
|
||||||
|
|
||||||
file_put_contents('assets/config.json', str_replace('/app/themes/sage', $browsersync_settings['publicPath'], file_get_contents('assets/config.json')));
|
file_put_contents('resources/assets/config.json', str_replace('/app/themes/sage', $browsersync_settings['publicPath'], file_get_contents('resources/assets/config.json')));
|
||||||
file_put_contents('assets/config.json', str_replace($browsersync_settings_default['devUrl'], $browsersync_settings['devUrl'], file_get_contents('assets/config.json')));
|
file_put_contents('resources/assets/config.json', str_replace($browsersync_settings_default['devUrl'], $browsersync_settings['devUrl'], file_get_contents('resources/assets/config.json')));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// @codingStandardsIgnoreEnd
|
// @codingStandardsIgnoreEnd
|
||||||
@@ -64,7 +64,7 @@ add_action('after_setup_theme', function () {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Use main stylesheet for visual editor
|
* Use main stylesheet for visual editor
|
||||||
* @see assets/styles/layouts/_tinymce.scss
|
* @see resources/assets/styles/layouts/_tinymce.scss
|
||||||
*/
|
*/
|
||||||
add_editor_style(asset_path('styles/main.css'));
|
add_editor_style(asset_path('styles/main.css'));
|
||||||
}, 20);
|
}, 20);
|
||||||
@@ -111,12 +111,13 @@ add_action('after_setup_theme', function () {
|
|||||||
'uri.stylesheet' => get_stylesheet_directory_uri(),
|
'uri.stylesheet' => get_stylesheet_directory_uri(),
|
||||||
'uri.template' => get_template_directory_uri(),
|
'uri.template' => get_template_directory_uri(),
|
||||||
];
|
];
|
||||||
$viewPaths = collect(preg_replace('%[\/]?(templates)?[\/.]*?$%', '', [STYLESHEETPATH, TEMPLATEPATH]))
|
$viewPaths = collect(preg_replace('%[\/]?(resources/views)?[\/.]*?$%', '', [STYLESHEETPATH, TEMPLATEPATH]))
|
||||||
->flatMap(function ($path) {
|
->flatMap(function ($path) {
|
||||||
return ["{$path}/templates", $path];
|
return ["{$path}/resources/views", $path];
|
||||||
})->unique()->toArray();
|
})->unique()->toArray();
|
||||||
|
|
||||||
config([
|
config([
|
||||||
'assets.manifest' => "{$paths['dir.stylesheet']}/dist/assets.json",
|
'assets.manifest' => "{$paths['dir.stylesheet']}/../dist/assets.json",
|
||||||
'assets.uri' => "{$paths['uri.stylesheet']}/dist",
|
'assets.uri' => "{$paths['uri.stylesheet']}/dist",
|
||||||
'view.compiled' => "{$paths['dir.upload']}/cache/compiled",
|
'view.compiled' => "{$paths['dir.upload']}/cache/compiled",
|
||||||
'view.namespaces' => ['App' => WP_CONTENT_DIR],
|
'view.namespaces' => ['App' => WP_CONTENT_DIR],
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Roots\\Sage\\": "src/lib/Sage/"
|
"Roots\\Sage\\": "app/lib/Sage/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
"illuminate/config": "~5.4.0"
|
"illuminate/config": "~5.4.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"squizlabs/php_codesniffer": "^2.5.1"
|
"squizlabs/php_codesniffer": "^2.8.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": [
|
"test": [
|
||||||
|
|||||||
113
composer.lock
generated
113
composer.lock
generated
@@ -4,8 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"hash": "9fa5c6956d3ed29ca107f717891465c6",
|
"content-hash": "ea9fa1afa3655447aadf2168ebe1d9b4",
|
||||||
"content-hash": "f00026ba7588607051943fd388bead9b",
|
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "composer/installers",
|
"name": "composer/installers",
|
||||||
@@ -112,7 +111,7 @@
|
|||||||
"zend",
|
"zend",
|
||||||
"zikula"
|
"zikula"
|
||||||
],
|
],
|
||||||
"time": "2016-08-13 20:53:52"
|
"time": "2016-08-13T20:53:52+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "doctrine/inflector",
|
"name": "doctrine/inflector",
|
||||||
@@ -179,11 +178,11 @@
|
|||||||
"singularize",
|
"singularize",
|
||||||
"string"
|
"string"
|
||||||
],
|
],
|
||||||
"time": "2015-11-06 14:35:42"
|
"time": "2015-11-06T14:35:42+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "illuminate/config",
|
"name": "illuminate/config",
|
||||||
"version": "v5.4.13",
|
"version": "v5.4.17",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/illuminate/config.git",
|
"url": "https://github.com/illuminate/config.git",
|
||||||
@@ -223,20 +222,20 @@
|
|||||||
],
|
],
|
||||||
"description": "The Illuminate Config package.",
|
"description": "The Illuminate Config package.",
|
||||||
"homepage": "https://laravel.com",
|
"homepage": "https://laravel.com",
|
||||||
"time": "2017-02-04 20:27:32"
|
"time": "2017-02-04T20:27:32+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "illuminate/container",
|
"name": "illuminate/container",
|
||||||
"version": "v5.4.13",
|
"version": "v5.4.17",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/illuminate/container.git",
|
"url": "https://github.com/illuminate/container.git",
|
||||||
"reference": "ccbfa2c69369a11b419d071ad11147b59eb9f052"
|
"reference": "1fc0d2451e23d2ea73c10462d74add4767e2b74c"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/illuminate/container/zipball/ccbfa2c69369a11b419d071ad11147b59eb9f052",
|
"url": "https://api.github.com/repos/illuminate/container/zipball/1fc0d2451e23d2ea73c10462d74add4767e2b74c",
|
||||||
"reference": "ccbfa2c69369a11b419d071ad11147b59eb9f052",
|
"reference": "1fc0d2451e23d2ea73c10462d74add4767e2b74c",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -266,20 +265,20 @@
|
|||||||
],
|
],
|
||||||
"description": "The Illuminate Container package.",
|
"description": "The Illuminate Container package.",
|
||||||
"homepage": "https://laravel.com",
|
"homepage": "https://laravel.com",
|
||||||
"time": "2017-01-28 17:55:54"
|
"time": "2017-03-13T14:14:19+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "illuminate/contracts",
|
"name": "illuminate/contracts",
|
||||||
"version": "v5.4.13",
|
"version": "v5.4.17",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/illuminate/contracts.git",
|
"url": "https://github.com/illuminate/contracts.git",
|
||||||
"reference": "dd256891c80fd94a58ab83d7989d6da2f50e30ea"
|
"reference": "ab2825726bee46a67c8cc66789852189dbef74a9"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/illuminate/contracts/zipball/dd256891c80fd94a58ab83d7989d6da2f50e30ea",
|
"url": "https://api.github.com/repos/illuminate/contracts/zipball/ab2825726bee46a67c8cc66789852189dbef74a9",
|
||||||
"reference": "dd256891c80fd94a58ab83d7989d6da2f50e30ea",
|
"reference": "ab2825726bee46a67c8cc66789852189dbef74a9",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -308,20 +307,20 @@
|
|||||||
],
|
],
|
||||||
"description": "The Illuminate Contracts package.",
|
"description": "The Illuminate Contracts package.",
|
||||||
"homepage": "https://laravel.com",
|
"homepage": "https://laravel.com",
|
||||||
"time": "2017-02-21 14:21:59"
|
"time": "2017-03-29T13:17:47+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "illuminate/events",
|
"name": "illuminate/events",
|
||||||
"version": "v5.4.13",
|
"version": "v5.4.17",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/illuminate/events.git",
|
"url": "https://github.com/illuminate/events.git",
|
||||||
"reference": "e31e5be1d704a3a001b6cf7ebf457a208e9a8a60"
|
"reference": "e8337bde9cc65409d5fa7548ff11d360a4b4ae2b"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/illuminate/events/zipball/e31e5be1d704a3a001b6cf7ebf457a208e9a8a60",
|
"url": "https://api.github.com/repos/illuminate/events/zipball/e8337bde9cc65409d5fa7548ff11d360a4b4ae2b",
|
||||||
"reference": "e31e5be1d704a3a001b6cf7ebf457a208e9a8a60",
|
"reference": "e8337bde9cc65409d5fa7548ff11d360a4b4ae2b",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -353,20 +352,20 @@
|
|||||||
],
|
],
|
||||||
"description": "The Illuminate Events package.",
|
"description": "The Illuminate Events package.",
|
||||||
"homepage": "https://laravel.com",
|
"homepage": "https://laravel.com",
|
||||||
"time": "2017-02-10 21:05:38"
|
"time": "2017-03-16T14:12:50+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "illuminate/filesystem",
|
"name": "illuminate/filesystem",
|
||||||
"version": "v5.4.13",
|
"version": "v5.4.17",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/illuminate/filesystem.git",
|
"url": "https://github.com/illuminate/filesystem.git",
|
||||||
"reference": "9e74fd5bef124640852da3ec71ec6365408de417"
|
"reference": "3ed8b9a35880a9619141e2965fd5cbbe2e1c0da1"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/illuminate/filesystem/zipball/9e74fd5bef124640852da3ec71ec6365408de417",
|
"url": "https://api.github.com/repos/illuminate/filesystem/zipball/3ed8b9a35880a9619141e2965fd5cbbe2e1c0da1",
|
||||||
"reference": "9e74fd5bef124640852da3ec71ec6365408de417",
|
"reference": "3ed8b9a35880a9619141e2965fd5cbbe2e1c0da1",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -403,20 +402,20 @@
|
|||||||
],
|
],
|
||||||
"description": "The Illuminate Filesystem package.",
|
"description": "The Illuminate Filesystem package.",
|
||||||
"homepage": "https://laravel.com",
|
"homepage": "https://laravel.com",
|
||||||
"time": "2017-01-03 14:19:43"
|
"time": "2017-03-01T21:44:04+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "illuminate/support",
|
"name": "illuminate/support",
|
||||||
"version": "v5.4.13",
|
"version": "v5.4.17",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/illuminate/support.git",
|
"url": "https://github.com/illuminate/support.git",
|
||||||
"reference": "904f63003fd67ede2ec3be018b322d1c29415465"
|
"reference": "c7e7c9daf5044e76b46085b8351f8235a3e979c6"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/illuminate/support/zipball/904f63003fd67ede2ec3be018b322d1c29415465",
|
"url": "https://api.github.com/repos/illuminate/support/zipball/c7e7c9daf5044e76b46085b8351f8235a3e979c6",
|
||||||
"reference": "904f63003fd67ede2ec3be018b322d1c29415465",
|
"reference": "c7e7c9daf5044e76b46085b8351f8235a3e979c6",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -460,20 +459,20 @@
|
|||||||
],
|
],
|
||||||
"description": "The Illuminate Support package.",
|
"description": "The Illuminate Support package.",
|
||||||
"homepage": "https://laravel.com",
|
"homepage": "https://laravel.com",
|
||||||
"time": "2017-02-15 19:29:24"
|
"time": "2017-03-28T12:49:45+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "illuminate/view",
|
"name": "illuminate/view",
|
||||||
"version": "v5.4.13",
|
"version": "v5.4.17",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/illuminate/view.git",
|
"url": "https://github.com/illuminate/view.git",
|
||||||
"reference": "0152506ccc2815e12e2daf8a01946b627db1efe0"
|
"reference": "45932749b21aeee7a5f60601a2ceafb36d032a94"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/illuminate/view/zipball/0152506ccc2815e12e2daf8a01946b627db1efe0",
|
"url": "https://api.github.com/repos/illuminate/view/zipball/45932749b21aeee7a5f60601a2ceafb36d032a94",
|
||||||
"reference": "0152506ccc2815e12e2daf8a01946b627db1efe0",
|
"reference": "45932749b21aeee7a5f60601a2ceafb36d032a94",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -508,20 +507,20 @@
|
|||||||
],
|
],
|
||||||
"description": "The Illuminate View package.",
|
"description": "The Illuminate View package.",
|
||||||
"homepage": "https://laravel.com",
|
"homepage": "https://laravel.com",
|
||||||
"time": "2017-02-22 15:30:41"
|
"time": "2017-03-30T14:26:45+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "paragonie/random_compat",
|
"name": "paragonie/random_compat",
|
||||||
"version": "v2.0.7",
|
"version": "v2.0.10",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/paragonie/random_compat.git",
|
"url": "https://github.com/paragonie/random_compat.git",
|
||||||
"reference": "b5ea1ef3d8ff10c307ba8c5945c2f134e503278f"
|
"reference": "634bae8e911eefa89c1abfbf1b66da679ac8f54d"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/b5ea1ef3d8ff10c307ba8c5945c2f134e503278f",
|
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/634bae8e911eefa89c1abfbf1b66da679ac8f54d",
|
||||||
"reference": "b5ea1ef3d8ff10c307ba8c5945c2f134e503278f",
|
"reference": "634bae8e911eefa89c1abfbf1b66da679ac8f54d",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -556,7 +555,7 @@
|
|||||||
"pseudorandom",
|
"pseudorandom",
|
||||||
"random"
|
"random"
|
||||||
],
|
],
|
||||||
"time": "2017-02-27 17:11:23"
|
"time": "2017-03-13T16:27:32+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr/log",
|
"name": "psr/log",
|
||||||
@@ -603,20 +602,20 @@
|
|||||||
"psr",
|
"psr",
|
||||||
"psr-3"
|
"psr-3"
|
||||||
],
|
],
|
||||||
"time": "2016-10-10 12:19:37"
|
"time": "2016-10-10T12:19:37+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/debug",
|
"name": "symfony/debug",
|
||||||
"version": "v3.2.4",
|
"version": "v3.2.7",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/debug.git",
|
"url": "https://github.com/symfony/debug.git",
|
||||||
"reference": "9b98854cb45bc59d100b7d4cc4cf9e05f21026b9"
|
"reference": "56f613406446a4a0a031475cfd0a01751de22659"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/debug/zipball/9b98854cb45bc59d100b7d4cc4cf9e05f21026b9",
|
"url": "https://api.github.com/repos/symfony/debug/zipball/56f613406446a4a0a031475cfd0a01751de22659",
|
||||||
"reference": "9b98854cb45bc59d100b7d4cc4cf9e05f21026b9",
|
"reference": "56f613406446a4a0a031475cfd0a01751de22659",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -660,20 +659,20 @@
|
|||||||
],
|
],
|
||||||
"description": "Symfony Debug Component",
|
"description": "Symfony Debug Component",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"time": "2017-02-16 16:34:18"
|
"time": "2017-03-28T21:38:24+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/finder",
|
"name": "symfony/finder",
|
||||||
"version": "v3.2.4",
|
"version": "v3.2.7",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/finder.git",
|
"url": "https://github.com/symfony/finder.git",
|
||||||
"reference": "8c71141cae8e2957946b403cc71a67213c0380d6"
|
"reference": "b20900ce5ea164cd9314af52725b0bb5a758217a"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/finder/zipball/8c71141cae8e2957946b403cc71a67213c0380d6",
|
"url": "https://api.github.com/repos/symfony/finder/zipball/b20900ce5ea164cd9314af52725b0bb5a758217a",
|
||||||
"reference": "8c71141cae8e2957946b403cc71a67213c0380d6",
|
"reference": "b20900ce5ea164cd9314af52725b0bb5a758217a",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -709,22 +708,22 @@
|
|||||||
],
|
],
|
||||||
"description": "Symfony Finder Component",
|
"description": "Symfony Finder Component",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"time": "2017-01-02 20:32:22"
|
"time": "2017-03-20T09:32:19+00:00"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"packages-dev": [
|
"packages-dev": [
|
||||||
{
|
{
|
||||||
"name": "squizlabs/php_codesniffer",
|
"name": "squizlabs/php_codesniffer",
|
||||||
"version": "2.8.0",
|
"version": "2.8.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
|
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
|
||||||
"reference": "86dd55a522238211f9f3631e3361703578941d9a"
|
"reference": "d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/86dd55a522238211f9f3631e3361703578941d9a",
|
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d",
|
||||||
"reference": "86dd55a522238211f9f3631e3361703578941d9a",
|
"reference": "d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -789,7 +788,7 @@
|
|||||||
"phpcs",
|
"phpcs",
|
||||||
"standards"
|
"standards"
|
||||||
],
|
],
|
||||||
"time": "2017-02-02 03:30:00"
|
"time": "2017-03-01T22:17:45+00:00"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"aliases": [],
|
"aliases": [],
|
||||||
|
|||||||
38
package.json
38
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sage",
|
"name": "sage",
|
||||||
"version": "9.0.0-beta.2",
|
"version": "9.0.0-beta.3",
|
||||||
"author": "Roots <team@roots.io>",
|
"author": "Roots <team@roots.io>",
|
||||||
"homepage": "https://roots.io/sage/",
|
"homepage": "https://roots.io/sage/",
|
||||||
"private": true,
|
"private": true,
|
||||||
@@ -17,49 +17,57 @@
|
|||||||
"url": "http://opensource.org/licenses/MIT"
|
"url": "http://opensource.org/licenses/MIT"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"browserslist": [
|
||||||
|
"last 2 versions",
|
||||||
|
"android 4",
|
||||||
|
"opera 12"
|
||||||
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack --progress --config assets/build/webpack.config.js",
|
"build": "webpack --progress --config resources/assets/build/webpack.config.js",
|
||||||
"build:production": "webpack --progress -p --config assets/build/webpack.config.js",
|
"build:production": "webpack --progress -p --config resources/assets/build/webpack.config.js",
|
||||||
"build:profile": "webpack --progress --profile --json --config assets/build/webpack.config.js",
|
"build:profile": "webpack --progress --profile --json --config resources/assets/build/webpack.config.js",
|
||||||
"start": "webpack --hide-modules --watch --config assets/build/webpack.config.js",
|
"start": "webpack --hide-modules --watch --config resources/assets/build/webpack.config.js",
|
||||||
"rmdist": "rimraf dist",
|
"rmdist": "rimraf dist",
|
||||||
"lint": "eslint assets/scripts assets/build",
|
"lint": "eslint resources/assets/scripts resources/assets/build",
|
||||||
"test": "yarn run lint"
|
"test": "yarn run lint"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 6.9.4"
|
"node": ">= 6.9.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"autoprefixer": "^6.7.7",
|
"autoprefixer": "^7.1.1",
|
||||||
"browser-sync": "^2.18.8",
|
"browser-sync": "^2.18.8",
|
||||||
"browsersync-webpack-plugin": "^0.5.3",
|
"browsersync-webpack-plugin": "^0.5.3",
|
||||||
"bs-html-injector": "^3.0.3",
|
"bs-html-injector": "^3.0.3",
|
||||||
"buble-loader": "^0.4.1",
|
"buble-loader": "^0.4.1",
|
||||||
"clean-webpack-plugin": "^0.1.16",
|
"clean-webpack-plugin": "^0.1.16",
|
||||||
"copy-globs-webpack-plugin": "^0.2.0",
|
"copy-globs-webpack-plugin": "^0.2.0",
|
||||||
"css-loader": "^0.27.3",
|
"css-loader": "^0.28.0",
|
||||||
"cssnano": "^3.10.0",
|
"cssnano": "^3.10.0",
|
||||||
"eslint": "^3.18.0",
|
"eslint": "^3.19.0",
|
||||||
"eslint-loader": "^1.7.0",
|
"eslint-loader": "^1.7.1",
|
||||||
"eslint-plugin-import": "^2.2.0",
|
"eslint-plugin-import": "^2.2.0",
|
||||||
"extract-text-webpack-plugin": "^2.1.0",
|
"extract-text-webpack-plugin": "^2.1.0",
|
||||||
"file-loader": "^0.10.1",
|
"file-loader": "^0.11.1",
|
||||||
"imagemin-mozjpeg": "^6.0.0",
|
"imagemin-mozjpeg": "^6.0.0",
|
||||||
"imagemin-webpack-plugin": "^1.4.4",
|
"imagemin-webpack-plugin": "^1.4.4",
|
||||||
"node-sass": "^4.5.1",
|
"node-sass": "^4.5.1",
|
||||||
"optimize-css-assets-webpack-plugin": "^1.3.0",
|
"optimize-css-assets-webpack-plugin": "^1.3.1",
|
||||||
"postcss-loader": "^1.3.3",
|
"postcss-loader": "^1.3.3",
|
||||||
"resolve-url-loader": "^2.0.2",
|
"resolve-url-loader": "^2.0.2",
|
||||||
"rimraf": "^2.6.1",
|
"rimraf": "^2.6.1",
|
||||||
"sass-loader": "^6.0.3",
|
"sass-loader": "^6.0.3",
|
||||||
"style-loader": "^0.16.0",
|
"style-loader": "^0.16.0",
|
||||||
|
"stylelint": "^7.10.1",
|
||||||
|
"stylelint-config-standard": "^16.0.0",
|
||||||
|
"stylelint-webpack-plugin": "^0.5.1",
|
||||||
"url-loader": "^0.5.8",
|
"url-loader": "^0.5.8",
|
||||||
"webpack": "^2.3.1",
|
"webpack": "^2.4.1",
|
||||||
"webpack-assets-manifest": "^0.6.2",
|
"webpack-assets-manifest": "^0.6.2",
|
||||||
"webpack-dev-middleware": "^1.10.1",
|
"webpack-dev-middleware": "^1.10.1",
|
||||||
"webpack-hot-middleware": "^2.17.1",
|
"webpack-hot-middleware": "^2.18.0",
|
||||||
"webpack-merge": "^4.1.0",
|
"webpack-merge": "^4.1.0",
|
||||||
"yargs": "^7.0.2"
|
"yargs": "^7.1.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bootstrap": "^4.0.0-alpha.6",
|
"bootstrap": "^4.0.0-alpha.6",
|
||||||
|
|||||||
36
phpcs.xml
36
phpcs.xml
@@ -3,10 +3,10 @@
|
|||||||
<description>Roots Coding Standards</description>
|
<description>Roots Coding Standards</description>
|
||||||
|
|
||||||
<!-- Scan these files -->
|
<!-- Scan these files -->
|
||||||
<file>functions.php</file>
|
<file>resources/functions.php</file>
|
||||||
<file>index.php</file>
|
<file>resources/index.php</file>
|
||||||
<file>src</file>
|
<file>app</file>
|
||||||
<file>templates</file>
|
<file>resources/views</file>
|
||||||
|
|
||||||
<!-- Show colors in console -->
|
<!-- Show colors in console -->
|
||||||
<arg value="-colors"/>
|
<arg value="-colors"/>
|
||||||
@@ -17,55 +17,55 @@
|
|||||||
<!-- Use PSR-2 as a base -->
|
<!-- Use PSR-2 as a base -->
|
||||||
<rule ref="PSR2"/>
|
<rule ref="PSR2"/>
|
||||||
|
|
||||||
<!-- Exclusions below are for templates/ folder -->
|
<!-- Exclusions below are for resources/views/ folder -->
|
||||||
|
|
||||||
<!-- Allow php files without any PHP in them -->
|
<!-- Allow php files without any PHP in them -->
|
||||||
<rule ref="Internal.NoCodeFound">
|
<rule ref="Internal.NoCodeFound">
|
||||||
<exclude-pattern>templates</exclude-pattern>
|
<exclude-pattern>resources/views</exclude-pattern>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<!-- Allow braces on same line for named functions -->
|
<!-- Allow braces on same line for named functions -->
|
||||||
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine">
|
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine">
|
||||||
<exclude-pattern>templates</exclude-pattern>
|
<exclude-pattern>resources/views</exclude-pattern>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<!-- Allow closing braces to be on the same line -->
|
<!-- Allow closing braces to be on the same line -->
|
||||||
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace">
|
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace">
|
||||||
<exclude-pattern>templates</exclude-pattern>
|
<exclude-pattern>resources/views</exclude-pattern>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<!-- Disable newline after opening brace -->
|
<!-- Disable newline after opening brace -->
|
||||||
<rule ref="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace">
|
<rule ref="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace">
|
||||||
<exclude-pattern>templates</exclude-pattern>
|
<exclude-pattern>resources/views</exclude-pattern>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<!-- Allow multiple PHP statements in the same line -->
|
<!-- Allow multiple PHP statements in the same line -->
|
||||||
<rule ref="Generic.Formatting.DisallowMultipleStatements.SameLine">
|
<rule ref="Generic.Formatting.DisallowMultipleStatements.SameLine">
|
||||||
<exclude-pattern>templates</exclude-pattern>
|
<exclude-pattern>resources/views</exclude-pattern>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<!-- Disable PSR-2 indentation rules that are buggy with 2 spaces -->
|
<!-- Disable PSR-2 indentation rules that are buggy with 2 spaces -->
|
||||||
<rule ref="PSR2.ControlStructures.SwitchDeclaration.BreakIndent">
|
<rule ref="PSR2.ControlStructures.SwitchDeclaration.BreakIndent">
|
||||||
<exclude-pattern>templates</exclude-pattern>
|
<exclude-pattern>resources/views</exclude-pattern>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<!-- Don't require a blank line after the last `use` -->
|
<!-- Don't require a blank line after the last `use` -->
|
||||||
<rule ref="PSR2.Namespaces.UseDeclaration.SpaceAfterLastUse">
|
<rule ref="PSR2.Namespaces.UseDeclaration.SpaceAfterLastUse">
|
||||||
<exclude-pattern>templates</exclude-pattern>
|
<exclude-pattern>resources/views</exclude-pattern>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<!-- Allow long lines -->
|
<!-- Allow long lines -->
|
||||||
<rule ref="Generic.Files.LineLength.TooLong">
|
<rule ref="Generic.Files.LineLength.TooLong">
|
||||||
<exclude-pattern>templates</exclude-pattern>
|
<exclude-pattern>resources/views</exclude-pattern>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<!-- Ignore indentation rules -->
|
<!-- Ignore indentation rules -->
|
||||||
<rule ref="Generic.WhiteSpace.ScopeIndent">
|
<rule ref="Generic.WhiteSpace.ScopeIndent">
|
||||||
<exclude-pattern>templates</exclude-pattern>
|
<exclude-pattern>resources/views</exclude-pattern>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<!-- Allow PHP closing tags -->
|
<!-- Allow PHP closing tags -->
|
||||||
<rule ref="PSR2.Files.ClosingTag.NotAllowed">
|
<rule ref="PSR2.Files.ClosingTag.NotAllowed">
|
||||||
<exclude-pattern>templates</exclude-pattern>
|
<exclude-pattern>resources/views</exclude-pattern>
|
||||||
</rule>
|
</rule>
|
||||||
</ruleset>
|
</ruleset>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const config = merge({
|
|||||||
cacheBusting: '[name]_[hash]',
|
cacheBusting: '[name]_[hash]',
|
||||||
paths: {
|
paths: {
|
||||||
root: rootPath,
|
root: rootPath,
|
||||||
assets: path.join(rootPath, 'assets'),
|
assets: path.join(rootPath, 'resources/assets'),
|
||||||
dist: path.join(rootPath, 'dist'),
|
dist: path.join(rootPath, 'dist'),
|
||||||
},
|
},
|
||||||
enabled: {
|
enabled: {
|
||||||
@@ -25,7 +25,6 @@ const config = merge({
|
|||||||
watcher: !!argv.watch,
|
watcher: !!argv.watch,
|
||||||
},
|
},
|
||||||
watch: [],
|
watch: [],
|
||||||
browsers: [],
|
|
||||||
}, userConfig);
|
}, userConfig);
|
||||||
|
|
||||||
module.exports = merge(config, {
|
module.exports = merge(config, {
|
||||||
@@ -5,6 +5,7 @@ const merge = require('webpack-merge');
|
|||||||
const autoprefixer = require('autoprefixer');
|
const autoprefixer = require('autoprefixer');
|
||||||
const CleanPlugin = require('clean-webpack-plugin');
|
const CleanPlugin = require('clean-webpack-plugin');
|
||||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||||
|
const StyleLintPlugin = require('stylelint-webpack-plugin');
|
||||||
|
|
||||||
const CopyGlobsPlugin = require('copy-globs-webpack-plugin');
|
const CopyGlobsPlugin = require('copy-globs-webpack-plugin');
|
||||||
const config = require('./config');
|
const config = require('./config');
|
||||||
@@ -141,7 +142,7 @@ let webpackConfig = {
|
|||||||
output: { path: config.paths.dist },
|
output: { path: config.paths.dist },
|
||||||
context: config.paths.assets,
|
context: config.paths.assets,
|
||||||
postcss: [
|
postcss: [
|
||||||
autoprefixer({ browsers: config.browsers }),
|
autoprefixer(),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
@@ -151,6 +152,10 @@ let webpackConfig = {
|
|||||||
eslint: { failOnWarning: false, failOnError: true },
|
eslint: { failOnWarning: false, failOnError: true },
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
new StyleLintPlugin({
|
||||||
|
failOnError: ! config.enabled.watcher,
|
||||||
|
syntax: 'scss',
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -13,7 +13,8 @@ module.exports = {
|
|||||||
cssProcessor: cssnano,
|
cssProcessor: cssnano,
|
||||||
cssProcessorOptions: {
|
cssProcessorOptions: {
|
||||||
discardComments: { removeAll: true },
|
discardComments: { removeAll: true },
|
||||||
autoprefixer: { browsers: config.browsers },
|
autoprefixer: {},
|
||||||
|
safe: true,
|
||||||
},
|
},
|
||||||
canPrint: true,
|
canPrint: true,
|
||||||
}),
|
}),
|
||||||
@@ -13,11 +13,6 @@
|
|||||||
"proxyUrl": "http://localhost:3000",
|
"proxyUrl": "http://localhost:3000",
|
||||||
"cacheBusting": "[name]_[hash:8]",
|
"cacheBusting": "[name]_[hash:8]",
|
||||||
"watch": [
|
"watch": [
|
||||||
"{src,templates}/**/*.php"
|
"{app,resources/views}/**/*.php"
|
||||||
],
|
|
||||||
"browsers": [
|
|
||||||
"last 2 versions",
|
|
||||||
"android 4",
|
|
||||||
"opera 12"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
1
resources/assets/styles/common/_global.scss
Normal file
1
resources/assets/styles/common/_global.scss
Normal file
@@ -0,0 +1 @@
|
|||||||
|
// Base styles
|
||||||
@@ -1,2 +1,4 @@
|
|||||||
|
// Variables
|
||||||
|
|
||||||
// Colors
|
// Colors
|
||||||
$brand-primary: #27ae60;
|
$brand-primary: #27ae60;
|
||||||
1
resources/assets/styles/components/_buttons.scss
Normal file
1
resources/assets/styles/components/_buttons.scss
Normal file
@@ -0,0 +1 @@
|
|||||||
|
// Buttons
|
||||||
@@ -1,18 +1,23 @@
|
|||||||
|
// Comments
|
||||||
.comment-list {
|
.comment-list {
|
||||||
@extend .list-unstyled;
|
@extend .list-unstyled;
|
||||||
}
|
}
|
||||||
|
|
||||||
.comment-list ol {
|
.comment-list ol {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.comment-form p {
|
.comment-form p {
|
||||||
@extend .form-group;
|
@extend .form-group;
|
||||||
}
|
}
|
||||||
|
|
||||||
.comment-form input[type="text"],
|
.comment-form input[type="text"],
|
||||||
.comment-form input[type="email"],
|
.comment-form input[type="email"],
|
||||||
.comment-form input[type="url"],
|
.comment-form input[type="url"],
|
||||||
.comment-form textarea {
|
.comment-form textarea {
|
||||||
@extend .form-control;
|
@extend .form-control;
|
||||||
}
|
}
|
||||||
|
|
||||||
.comment-form input[type="submit"] {
|
.comment-form input[type="submit"] {
|
||||||
@extend .btn;
|
@extend .btn;
|
||||||
@extend .btn-secondary;
|
@extend .btn-secondary;
|
||||||
@@ -2,13 +2,17 @@
|
|||||||
.search-form {
|
.search-form {
|
||||||
@extend .form-inline;
|
@extend .form-inline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-form label {
|
.search-form label {
|
||||||
font-weight: normal;
|
|
||||||
@extend .form-group;
|
@extend .form-group;
|
||||||
|
|
||||||
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-form .search-field {
|
.search-form .search-field {
|
||||||
@extend .form-control;
|
@extend .form-control;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-form .search-submit {
|
.search-form .search-submit {
|
||||||
@extend .btn;
|
@extend .btn;
|
||||||
@extend .btn-secondary;
|
@extend .btn-secondary;
|
||||||
@@ -8,22 +8,26 @@
|
|||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.aligncenter {
|
.aligncenter {
|
||||||
display: block;
|
display: block;
|
||||||
margin: ($spacer / 2) auto;
|
margin: ($spacer / 2) auto;
|
||||||
height: auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.alignleft,
|
.alignleft,
|
||||||
.alignright {
|
.alignright {
|
||||||
margin-bottom: ($spacer / 2);
|
margin-bottom: ($spacer / 2);
|
||||||
height: auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
@include media-breakpoint-up(sm) {
|
@include media-breakpoint-up(sm) {
|
||||||
// Only float if not on an extra small device
|
// Only float if not on an extra small device
|
||||||
.alignleft {
|
.alignleft {
|
||||||
float: left;
|
float: left;
|
||||||
margin-right: ($spacer / 2);
|
margin-right: ($spacer / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.alignright {
|
.alignright {
|
||||||
float: right;
|
float: right;
|
||||||
margin-left: ($spacer / 2);
|
margin-left: ($spacer / 2);
|
||||||
@@ -34,10 +38,12 @@
|
|||||||
.wp-caption {
|
.wp-caption {
|
||||||
@extend .figure;
|
@extend .figure;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wp-caption img {
|
.wp-caption img {
|
||||||
@extend .figure-img;
|
@extend .figure-img;
|
||||||
@extend .img-fluid;
|
@extend .img-fluid;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wp-caption-text {
|
.wp-caption-text {
|
||||||
@extend .figure-caption;
|
@extend .figure-caption;
|
||||||
}
|
}
|
||||||
1
resources/assets/styles/layouts/_footer.scss
Normal file
1
resources/assets/styles/layouts/_footer.scss
Normal file
@@ -0,0 +1 @@
|
|||||||
|
// Footer
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
|
// Header
|
||||||
.banner .nav li {
|
.banner .nav li {
|
||||||
@extend .nav-item;
|
@extend .nav-item;
|
||||||
}
|
}
|
||||||
|
|
||||||
.banner .nav a {
|
.banner .nav a {
|
||||||
@extend .nav-link;
|
@extend .nav-link;
|
||||||
}
|
}
|
||||||
1
resources/assets/styles/layouts/_pages.scss
Normal file
1
resources/assets/styles/layouts/_pages.scss
Normal file
@@ -0,0 +1 @@
|
|||||||
|
// Pages
|
||||||
1
resources/assets/styles/layouts/_posts.scss
Normal file
1
resources/assets/styles/layouts/_posts.scss
Normal file
@@ -0,0 +1 @@
|
|||||||
|
// Posts
|
||||||
1
resources/assets/styles/layouts/_sidebar.scss
Normal file
1
resources/assets/styles/layouts/_sidebar.scss
Normal file
@@ -0,0 +1 @@
|
|||||||
|
// Sidebar
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// TinyMCE Editor styles
|
||||||
|
|
||||||
body#tinymce {
|
body#tinymce {
|
||||||
margin: 12px !important;
|
margin: 12px !important;
|
||||||
}
|
}
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
// Import npm dependencies
|
// Import npm dependencies
|
||||||
@import "~bootstrap/scss/bootstrap";
|
@import "~bootstrap/scss/bootstrap";
|
||||||
|
|
||||||
|
// Import theme styles
|
||||||
@import "common/global";
|
@import "common/global";
|
||||||
@import "components/buttons";
|
@import "components/buttons";
|
||||||
@import "components/comments";
|
@import "components/comments";
|
||||||
@@ -35,7 +35,7 @@ if (version_compare('4.7.0', get_bloginfo('version'), '>=')) {
|
|||||||
* Ensure dependencies are loaded
|
* Ensure dependencies are loaded
|
||||||
*/
|
*/
|
||||||
if (!class_exists('Roots\\Sage\\Container')) {
|
if (!class_exists('Roots\\Sage\\Container')) {
|
||||||
if (!file_exists($composer = __DIR__.'/vendor/autoload.php')) {
|
if (!file_exists($composer = __DIR__.'/../vendor/autoload.php')) {
|
||||||
$sage_error(
|
$sage_error(
|
||||||
__('You must run <code>composer install</code> from the Sage directory.', 'sage'),
|
__('You must run <code>composer install</code> from the Sage directory.', 'sage'),
|
||||||
__('Autoloader not found.', 'sage')
|
__('Autoloader not found.', 'sage')
|
||||||
@@ -51,7 +51,7 @@ if (!class_exists('Roots\\Sage\\Container')) {
|
|||||||
* Add or remove files to the array as needed. Supports child theme overrides.
|
* Add or remove files to the array as needed. Supports child theme overrides.
|
||||||
*/
|
*/
|
||||||
array_map(function ($file) use ($sage_error) {
|
array_map(function ($file) use ($sage_error) {
|
||||||
$file = "src/{$file}.php";
|
$file = "../app/{$file}.php";
|
||||||
if (!locate_template($file, true, true)) {
|
if (!locate_template($file, true, true)) {
|
||||||
$sage_error(sprintf(__('Error locating <code>%s</code> for inclusion.', 'sage'), $file), 'File not found');
|
$sage_error(sprintf(__('Error locating <code>%s</code> for inclusion.', 'sage'), $file), 'File not found');
|
||||||
}
|
}
|
||||||
@@ -59,29 +59,36 @@ array_map(function ($file) use ($sage_error) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Here's what's happening with these hooks:
|
* Here's what's happening with these hooks:
|
||||||
* 1. WordPress initially detects theme in themes/sage
|
* 1. WordPress initially detects theme in themes/sage/resources
|
||||||
* 2. Upon activation, we tell WordPress that the theme is actually in themes/sage/templates
|
* 2. Upon activation, we tell WordPress that the theme is actually in themes/sage/resources/views
|
||||||
* 3. When we call get_template_directory() or get_template_directory_uri(), we point it back to themes/sage
|
* 3. When we call get_template_directory() or get_template_directory_uri(), we point it back to themes/sage/resources
|
||||||
*
|
*
|
||||||
* We do this so that the Template Hierarchy will look in themes/sage/templates for core WordPress themes
|
* We do this so that the Template Hierarchy will look in themes/sage/resources/views for core WordPress themes
|
||||||
* But functions.php, style.css, and index.php are all still located in themes/sage
|
* But functions.php, style.css, and index.php are all still located in themes/sage/resources
|
||||||
*
|
*
|
||||||
* This is not compatible with the WordPress Customizer theme preview prior to theme activation
|
* This is not compatible with the WordPress Customizer theme preview prior to theme activation
|
||||||
*
|
*
|
||||||
* get_template_directory() -> /srv/www/example.com/current/web/app/themes/sage
|
* get_template_directory() -> /srv/www/example.com/current/web/app/themes/sage/resources
|
||||||
* get_stylesheet_directory() -> /srv/www/example.com/current/web/app/themes/sage
|
* get_stylesheet_directory() -> /srv/www/example.com/current/web/app/themes/sage/resources
|
||||||
* locate_template()
|
* locate_template()
|
||||||
* ├── STYLESHEETPATH -> /srv/www/example.com/current/web/app/themes/sage
|
* ├── STYLESHEETPATH -> /srv/www/example.com/current/web/app/themes/sage/resources/views
|
||||||
* └── TEMPLATEPATH -> /srv/www/example.com/current/web/app/themes/sage/templates
|
* └── TEMPLATEPATH -> /srv/www/example.com/current/web/app/themes/sage/resources
|
||||||
*/
|
*/
|
||||||
if (is_customize_preview() && isset($_GET['theme'])) {
|
if (is_customize_preview() && isset($_GET['theme'])) {
|
||||||
$sage_error(__('Theme must be activated prior to using the customizer.', 'sage'));
|
$sage_error(__('Theme must be activated prior to using the customizer.', 'sage'));
|
||||||
}
|
}
|
||||||
add_filter('template', function ($stylesheet) {
|
$sage_views = basename(dirname(__DIR__)).'/'.basename(__DIR__).'/views';
|
||||||
return dirname($stylesheet);
|
add_filter('stylesheet', function () use ($sage_views) {
|
||||||
|
return dirname($sage_views);
|
||||||
});
|
});
|
||||||
if (basename($stylesheet = get_option('template')) !== 'templates') {
|
add_filter('stylesheet_directory_uri', function ($uri) {
|
||||||
update_option('template', "{$stylesheet}/templates");
|
return dirname($uri);
|
||||||
|
});
|
||||||
|
if ($sage_views !== get_option('stylesheet')) {
|
||||||
|
update_option('stylesheet', $sage_views);
|
||||||
|
if (php_sapi_name() === 'cli') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
wp_redirect($_SERVER['REQUEST_URI']);
|
wp_redirect($_SERVER['REQUEST_URI']);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 225 B After Width: | Height: | Size: 225 B |
@@ -2,7 +2,7 @@
|
|||||||
Theme Name: Sage Starter Theme
|
Theme Name: Sage Starter Theme
|
||||||
Theme URI: https://roots.io/sage/
|
Theme URI: https://roots.io/sage/
|
||||||
Description: Sage is a WordPress starter theme.
|
Description: Sage is a WordPress starter theme.
|
||||||
Version: 9.0.0-beta.2
|
Version: 9.0.0-beta.3
|
||||||
Author: Roots
|
Author: Roots
|
||||||
Author URI: https://roots.io/
|
Author URI: https://roots.io/
|
||||||
Text Domain: sage
|
Text Domain: sage
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
@extends('layouts.base')
|
@extends('layouts.app')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
@include('partials.page-header')
|
@include('partials.page-header')
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
@extends('layouts.base')
|
@extends('layouts.app')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
@include('partials.page-header')
|
@include('partials.page-header')
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
@endif
|
@endif
|
||||||
|
|
||||||
@while (have_posts()) @php(the_post())
|
@while (have_posts()) @php(the_post())
|
||||||
@include ('partials.content-'.(get_post_type() !== 'post' ? get_post_type() : get_post_format()))
|
@include ('partials.content-'.(get_post_type() === 'post' ?: get_post_type()))
|
||||||
@endwhile
|
@endwhile
|
||||||
|
|
||||||
{!! get_the_posts_navigation() !!}
|
{!! get_the_posts_navigation() !!}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
@extends('layouts.base')
|
@extends('layouts.app')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
@while(have_posts()) @php(the_post())
|
@while(have_posts()) @php(the_post())
|
||||||
@@ -9,5 +9,5 @@
|
|||||||
<footer>
|
<footer>
|
||||||
{!! wp_link_pages(['echo' => 0, 'before' => '<nav class="page-nav"><p>' . __('Pages:', 'sage'), 'after' => '</p></nav>']) !!}
|
{!! wp_link_pages(['echo' => 0, 'before' => '<nav class="page-nav"><p>' . __('Pages:', 'sage'), 'after' => '</p></nav>']) !!}
|
||||||
</footer>
|
</footer>
|
||||||
@php(comments_template('/templates/partials/comments.blade.php'))
|
@php(comments_template('/partials/comments.blade.php'))
|
||||||
</article>
|
</article>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
@extends('layouts.base')
|
@extends('layouts.app')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
@include('partials.page-header')
|
@include('partials.page-header')
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
@extends('layouts.base')
|
@extends('layouts.app')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
@while(have_posts()) @php(the_post())
|
@while(have_posts()) @php(the_post())
|
||||||
@include('partials/content-single-'.get_post_type())
|
@include('partials/content-single-'.get_post_type())
|
||||||
@endwhile
|
@endwhile
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
Template Name: Custom Template
|
Template Name: Custom Template
|
||||||
--}}
|
--}}
|
||||||
|
|
||||||
@extends('layouts.base')
|
@extends('layouts.app')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
@while(have_posts()) @php(the_post())
|
@while(have_posts()) @php(the_post())
|
||||||
Reference in New Issue
Block a user