Use roots/sage-lib (incl. new config system)

This commit is contained in:
2017-07-09 07:05:07 -07:00
parent 7a9d4f6be8
commit 1a8dce9b09
16 changed files with 626 additions and 806 deletions

31
config/assets.php Normal file
View File

@@ -0,0 +1,31 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Assets Manifest
|--------------------------------------------------------------------------
|
| Your asset manifest is used by Sage to assist WordPress and your views
| with rendering the correct URLs for your assets. This is especially
| useful for statically referencing assets with dynamically changing names
| as in the case of cache-busting.
|
*/
'manifest' => get_theme_file_path().'/dist/assets.json',
/*
|--------------------------------------------------------------------------
| Assets Path URI
|--------------------------------------------------------------------------
|
| The asset manifest contains relative paths to your assets. This URI will
| be prepended when using Sage's asset management system. Change this if
| you are using a CDN.
|
*/
'uri' => get_theme_file_uri().'/dist',
];

32
config/theme.php Normal file
View File

@@ -0,0 +1,32 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Theme Directory
|--------------------------------------------------------------------------
|
| This is the absolute path to your theme directory.
|
| Example:
| /srv/www/example.com/current/web/app/themes/sage
|
*/
'dir' => get_theme_file_path(),
/*
|--------------------------------------------------------------------------
| Theme Directory URI
|--------------------------------------------------------------------------
|
| This is the web server URI to your theme directory.
|
| Example:
| https://example.com/app/themes/sage
|
*/
'uri' => get_theme_file_uri(),
];

51
config/view.php Normal file
View File

@@ -0,0 +1,51 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| View Storage Paths
|--------------------------------------------------------------------------
|
| Most template systems load templates from disk. Here you may specify
| an array of paths that should be checked for your views.
|
*/
'paths' => [
get_theme_file_path().'/resources/views',
get_parent_theme_file_path().'/resources/views',
],
/*
|--------------------------------------------------------------------------
| Compiled View Path
|--------------------------------------------------------------------------
|
| This option determines where all the compiled Blade templates will be
| stored for your application. Typically, this is within the uploads
| directory. However, as usual, you are free to change this value.
|
*/
'compiled' => wp_upload_dir()['basedir'].'/cache',
/*
|--------------------------------------------------------------------------
| View Namespaces
|--------------------------------------------------------------------------
|
| Blade has an underutilized feature that allows developers to add
| supplemental view paths that may contain conflictingly named views.
| These paths are prefixed with a namespace to get around the conflicts.
| A use case might be including views from within a plugin folder.
|
*/
'namespaces' => [
// In your views use something like: @include(WC::some.view.or.partial.here)
'WC' => WP_PLUGIN_DIR.'/woocommerce/templates/',
],
];