Skip to content

Commit

Permalink
Move rewrites to a plugin, Roots 6.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
retlehs committed Nov 5, 2013
1 parent 8575130 commit f8bc0ca
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 84 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
### HEAD
### 6.5.1: November 5th, 2013
* Move clean URLs to a [plugin](https://github.com/roots/roots-rewrites)
* Update to Bootstrap 3.0.1

### 6.5.0: August 23rd, 2013
Expand Down
13 changes: 1 addition & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,6 @@ Clone the git repo - `git clone git://github.com/roots/roots.git` - or [download
npm install
```

If you're using Nginx you'll need to add the Roots rewrites to your server config before the PHP block (`location ~ \.php$`) to use the clean URLs feature:

```nginx
location ~ ^/assets/(img|js|css|fonts)/(.*)$ {
try_files $uri $uri/ /wp-content/themes/roots/assets/$1/$2;
}
location ~ ^/plugins/(.*)$ {
try_files $uri $uri/ /wp-content/plugins/$1;
}
```

Reference the [theme activation](http://roots.io/roots-101/#theme-activation) documentation to understand everything that happens once you activate Roots.

## Theme Development
Expand Down Expand Up @@ -57,7 +46,7 @@ Edit `lib/init.php` to setup custom navigation menus and post thumbnail sizes.
* [Theme activation](http://roots.io/roots-101/#theme-activation)
* [Theme wrapper](http://roots.io/an-introduction-to-the-roots-theme-wrapper/)
* Root relative URLs
* Clean URLs (no more `/wp-content/`)
* [Clean URLs with a plugin](https://github.com/roots/roots-rewrites) (no more `/wp-content/`)
* All static theme assets are rewritten to the website root (`/assets/*`)
* Cleaner HTML output of navigation menus
* Cleaner output of `wp_head` and enqueued scripts/styles
Expand Down
2 changes: 1 addition & 1 deletion assets/css/main.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/scripts.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/less/app.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Roots 6.5.0
* Roots 6.5.1
*/

@import "bootstrap/bootstrap.less";
Expand Down
1 change: 0 additions & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
require_once locate_template('/lib/nav.php'); // Custom nav modifications
require_once locate_template('/lib/gallery.php'); // Custom [gallery] modifications
require_once locate_template('/lib/comments.php'); // Custom comments modifications
require_once locate_template('/lib/rewrites.php'); // URL rewriting for assets
require_once locate_template('/lib/relative-urls.php'); // Root relative URLs
require_once locate_template('/lib/widgets.php'); // Sidebars and widgets
require_once locate_template('/lib/scripts.php'); // Scripts and stylesheets
Expand Down
11 changes: 0 additions & 11 deletions lib/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* Enable theme features
*/
add_theme_support('root-relative-urls'); // Enable relative URLs
add_theme_support('rewrites'); // Enable URL rewrites
add_theme_support('bootstrap-top-navbar'); // Enable Bootstrap's top navbar
add_theme_support('bootstrap-gallery'); // Enable Bootstrap's thumbnails component on [gallery]
add_theme_support('nice-search'); // Enable /?s= to /search/ redirect
Expand Down Expand Up @@ -78,13 +77,3 @@ function roots_display_sidebar() {
* Default: 1140px is the default Bootstrap container width.
*/
if (!isset($content_width)) { $content_width = 1140; }

/**
* Define helper constants
*/
$get_theme_name = explode('/themes/', get_template_directory());

define('RELATIVE_PLUGIN_PATH', str_replace(home_url() . '/', '', plugins_url()));
define('RELATIVE_CONTENT_PATH', str_replace(home_url() . '/', '', content_url()));
define('THEME_NAME', next($get_theme_name));
define('THEME_PATH', RELATIVE_CONTENT_PATH . '/themes/' . THEME_NAME);
52 changes: 0 additions & 52 deletions lib/rewrites.php

This file was deleted.

4 changes: 2 additions & 2 deletions lib/scripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* 3. /theme/assets/js/main.min.js (in footer)
*/
function roots_scripts() {
wp_enqueue_style('roots_main', get_template_directory_uri() . '/assets/css/main.min.css', false, '9a2dd99b82ca338b034e8730b94139d2');
wp_enqueue_style('roots_main', get_template_directory_uri() . '/assets/css/main.min.css', false, 'eb6334a114ec5f4f5c96dff76170aade');

// jQuery is loaded using the same method from HTML5 Boilerplate:
// Grab Google CDN's latest jQuery with a protocol relative URL; fallback to local if offline
Expand All @@ -27,7 +27,7 @@ function roots_scripts() {
}

wp_register_script('modernizr', get_template_directory_uri() . '/assets/js/vendor/modernizr-2.6.2.min.js', false, null, false);
wp_register_script('roots_scripts', get_template_directory_uri() . '/assets/js/scripts.min.js', false, '2a3e700c4c6e3d70a95b00241a845695', true);
wp_register_script('roots_scripts', get_template_directory_uri() . '/assets/js/scripts.min.js', false, 'e976bc66a7d279f3d265efbe1e0e14fb', true);
wp_enqueue_script('modernizr');
wp_enqueue_script('jquery');
wp_enqueue_script('roots_scripts');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "roots",
"version": "6.5.0",
"version": "6.5.1",
"author": "Ben Word <[email protected]>",
"homepage": "http://roots.io",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Theme Name: Roots
Theme URI: http://roots.io/
Description: Roots is a starting WordPress theme made for developers that's based on HTML5 Boilerplate and Bootstrap. <a href="https://github.com/retlehs/roots/contributors">Contribute on GitHub</a>
Version: 6.5.0
Version: 6.5.1
Author: Ben Word
Author URI: http://benword.com/
Expand Down

0 comments on commit f8bc0ca

Please sign in to comment.