Ref #525 - Move css/, img/, and js/ into assets/
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
### HEAD
|
||||
* Add MIT License
|
||||
* Implement scribu's [Theme Wrapper](http://scribu.net/wordpress/theme-wrappers.html) (see `base.php`)
|
||||
* Move `css/`, `img/`, and `js/` folders within a new `assets/` folder
|
||||
* Move templates, `comments.php`, and `searchform.php` to `templates/` folder
|
||||
* Rename `inc/` to `lib/`
|
||||
* Rename `loop-` files to `content-`
|
||||
* Remove all hooks
|
||||
* Use `templates/page-header.php` for page titles
|
||||
|
||||
@@ -18,7 +18,7 @@ Edit `lib/config.php` to enable support for major functionality and to define co
|
||||
* Theme wrapper
|
||||
* Root relative URLs
|
||||
* Clean URLs (no more `/wp-content/`)
|
||||
* All static theme assets are rewritten to the website root (`/css/`, `/img/`, and `/js/`)
|
||||
* All static theme assets are rewritten to the website root (`/assets/css/`, `/assets/img/`, and `/assets/js/`)
|
||||
* Cleaner HTML output of navigation menus
|
||||
* Cleaner output of `wp_head` and enqueued scripts/styles
|
||||
* Posts use the [hNews](http://microformats.org/wiki/hnews) microformat
|
||||
|
||||
0
img/.gitignore → assets/img/.gitignore
vendored
0
img/.gitignore → assets/img/.gitignore
vendored
|
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
@@ -33,10 +33,10 @@ if (stristr($_SERVER['SERVER_SOFTWARE'], 'apache') || stristr($_SERVER['SERVER_S
|
||||
function roots_add_rewrites($content) {
|
||||
global $wp_rewrite;
|
||||
$roots_new_non_wp_rules = array(
|
||||
'css/(.*)' => THEME_PATH . '/css/$1',
|
||||
'js/(.*)' => THEME_PATH . '/js/$1',
|
||||
'img/(.*)' => THEME_PATH . '/img/$1',
|
||||
'plugins/(.*)' => RELATIVE_PLUGIN_PATH . '/$1'
|
||||
'assets/css/(.*)' => THEME_PATH . '/assets/css/$1',
|
||||
'assets/js/(.*)' => THEME_PATH . '/assets/js/$1',
|
||||
'assets/img/(.*)' => THEME_PATH . '/assets/img/$1',
|
||||
'assets/plugins/(.*)' => RELATIVE_PLUGIN_PATH . '/$1'
|
||||
);
|
||||
$wp_rewrite->non_wp_rules = array_merge($wp_rewrite->non_wp_rules, $roots_new_non_wp_rules);
|
||||
return $content;
|
||||
|
||||
@@ -3,22 +3,22 @@
|
||||
* Scripts and stylesheets
|
||||
*
|
||||
* Enqueue stylesheets in the following order:
|
||||
* 1. /theme/css/bootstrap.css
|
||||
* 2. /theme/css/bootstrap-responsive.css
|
||||
* 3. /theme/css/app.css
|
||||
* 4. /child-theme/style.css (if a child theme is activated)
|
||||
* 1. /theme/assets/css/bootstrap.css
|
||||
* 2. /theme/assets/css/bootstrap-responsive.css
|
||||
* 3. /theme/assets/css/app.css
|
||||
* 4. /child-theme/style.css (if a child theme is activated)
|
||||
*
|
||||
* Enqueue scripts in the following order:
|
||||
* 1. /theme/js/vendor/modernizr-2.6.1.min.js (in head.php)
|
||||
* 2. jquery-1.8.0.min.js via Google CDN (in head.php)
|
||||
* 3. /theme/js/plugins.js
|
||||
* 4. /theme/js/main.js
|
||||
* 1. /theme/assets/js/vendor/modernizr-2.6.1.min.js (in head.php)
|
||||
* 2. jquery-1.8.0.min.js via Google CDN (in head.php)
|
||||
* 3. /theme/assets/js/plugins.js
|
||||
* 4. /theme/assets/js/main.js
|
||||
*/
|
||||
|
||||
function roots_scripts() {
|
||||
wp_enqueue_style('roots_bootstrap', get_template_directory_uri() . '/css/bootstrap.css', false, null);
|
||||
wp_enqueue_style('roots_bootstrap_responsive', get_template_directory_uri() . '/css/bootstrap-responsive.css', array('roots_bootstrap'), null);
|
||||
wp_enqueue_style('roots_app', get_template_directory_uri() . '/css/app.css', false, null);
|
||||
wp_enqueue_style('roots_bootstrap', get_template_directory_uri() . '/assets/css/bootstrap.css', false, null);
|
||||
wp_enqueue_style('roots_bootstrap_responsive', get_template_directory_uri() . '/assets/css/bootstrap-responsive.css', array('roots_bootstrap'), null);
|
||||
wp_enqueue_style('roots_app', get_template_directory_uri() . '/assets/css/app.css', false, null);
|
||||
|
||||
// Load style.css from child theme
|
||||
if (is_child_theme()) {
|
||||
@@ -37,8 +37,8 @@ function roots_scripts() {
|
||||
wp_enqueue_script('comment-reply');
|
||||
}
|
||||
|
||||
wp_register_script('roots_plugins', get_template_directory_uri() . '/js/plugins.js', false, null, false);
|
||||
wp_register_script('roots_main', get_template_directory_uri() . '/js/main.js', false, null, false);
|
||||
wp_register_script('roots_plugins', get_template_directory_uri() . '/assets/js/plugins.js', false, null, false);
|
||||
wp_register_script('roots_main', get_template_directory_uri() . '/assets/js/main.js', false, null, false);
|
||||
wp_enqueue_script('roots_plugins');
|
||||
wp_enqueue_script('roots_main');
|
||||
}
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
<title><?php wp_title('|', true, 'right'); bloginfo('name'); ?></title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<script src="<?php echo get_template_directory_uri(); ?>/js/vendor/modernizr-2.6.1.min.js"></script>
|
||||
<script src="<?php echo get_template_directory_uri(); ?>/assets/js/vendor/modernizr-2.6.1.min.js"></script>
|
||||
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
|
||||
<script>window.jQuery || document.write('<script src="<?php echo get_template_directory_uri(); ?>/js/vendor/jquery-1.8.0.min.js"><\/script>')</script>
|
||||
<script>window.jQuery || document.write('<script src="<?php echo get_template_directory_uri(); ?>/assets/js/vendor/jquery-1.8.0.min.js"><\/script>')</script>
|
||||
|
||||
<?php wp_head(); ?>
|
||||
</head>
|
||||
Reference in New Issue
Block a user