Merge pull request #1247 from roots/sage

Rename theme from Roots to Sage
This commit is contained in:
Ben Word
2015-01-09 21:00:13 -06:00
29 changed files with 198 additions and 201 deletions

View File

@@ -1,13 +1,13 @@
<?php get_template_part('templates/page', 'header'); ?>
<div class="alert alert-warning">
<?php _e('Sorry, but the page you were trying to view does not exist.', 'roots'); ?>
<?php _e('Sorry, but the page you were trying to view does not exist.', 'sage'); ?>
</div>
<p><?php _e('It looks like this was the result of either:', 'roots'); ?></p>
<p><?php _e('It looks like this was the result of either:', 'sage'); ?></p>
<ul>
<li><?php _e('a mistyped address', 'roots'); ?></li>
<li><?php _e('an out-of-date link', 'roots'); ?></li>
<li><?php _e('a mistyped address', 'sage'); ?></li>
<li><?php _e('an out-of-date link', 'sage'); ?></li>
</ul>
<?php get_search_form(); ?>

View File

@@ -1,4 +1,4 @@
# Contributing to Roots Theme
# Contributing to Sage
Please take a moment to review this document in order to make the contribution
process easy and effective for everyone involved.
@@ -36,7 +36,7 @@ Guidelines for bug reports:
2. **Check if the issue has been fixed** &mdash; try to reproduce it using the
latest `master` or development branch in the repository.
3. **Isolate the problem to Roots** &mdash; make sure that the code in the Roots
3. **Isolate the problem to Sage** &mdash; make sure that the code in the Sage
repository is _definitely_ responsible for the issue. Switch to a core WordPress
theme (such as Twenty Thirteen) to confirm problems before reporting an issue.
Make sure you have reproduced the bug with all plugins disabled. Any issues
@@ -51,7 +51,7 @@ information. Please try to be as detailed as possible in your report.
## Feature requests
Feature requests are welcome. But take a moment to find out whether your idea
fits with the scope and aims of Roots. It's up to *you* to make a strong
fits with the scope and aims of Sage. It's up to *you* to make a strong
case to convince the Roots developers of the merits of this feature. Please
provide as much detail and context as possible.
@@ -65,15 +65,15 @@ commits.
**Please ask first** before embarking on any significant pull request (e.g.
implementing features, refactoring code), otherwise you risk spending a lot of
time working on something that the developers might not want to merge into Roots.
time working on something that the developers might not want to merge into Sage.
Please adhere to the coding conventions used throughout the project (indentation,
comments, etc.).
Adhering to the following this process is the best way to get your work
included in Roots:
included in Sage:
1. [Fork](http://help.github.com/fork-a-repo/) Roots, clone your fork,
1. [Fork](http://help.github.com/fork-a-repo/) Sage, clone your fork,
and configure the remotes:
```bash

View File

@@ -1,12 +1,12 @@
# [Roots Starter Theme](http://roots.io/)
# [Sage Starter Theme](http://roots.io/sage/)
[![Build Status](https://travis-ci.org/roots/roots.svg)](https://travis-ci.org/roots/roots)
[![devDependency Status](https://david-dm.org/roots/roots/dev-status.svg)](https://david-dm.org/roots/roots#info=devDependencies)
Roots is a WordPress starter theme based on [HTML5 Boilerplate](http://html5boilerplate.com/) that will help you make better themes.
Sage is a WordPress starter theme based on [HTML5 Boilerplate](http://html5boilerplate.com/) that will help you make better themes.
* Source: [https://github.com/roots/roots](https://github.com/roots/roots)
* Homepage: [http://roots.io/](http://roots.io/)
* Documentation: [http://roots.io/docs/](http://roots.io/docs/)
* Source: [https://github.com/roots/sage](https://github.com/roots/sage)
* Homepage: [http://roots.io/sage/](http://roots.io/sage/)
* Documentation: [http://roots.io/sage/getting-started/](http://roots.io/sage/getting-started/)
* Twitter: [@rootswp](https://twitter.com/rootswp), [@retlehs](https://twitter.com/retlehs), [@swalkinshaw](https://twitter.com/swalkinshaw), [@Foxaii](https://twitter.com/Foxaii), [@c2foryou](https://twitter.com/c2foryou), [@austinpray](https://twitter.com/austinpray)
* Newsletter: [Subscribe](http://roots.io/subscribe/)
* Forum: [http://discourse.roots.io/](http://discourse.roots.io/)
@@ -22,12 +22,12 @@ Roots is a WordPress starter theme based on [HTML5 Boilerplate](http://html5boil
* [Bootstrap](http://getbootstrap.com/)
* ARIA roles and microformats
* [Theme activation](http://roots.io/roots-101/#theme-activation)
* [Theme wrapper](http://roots.io/an-introduction-to-the-roots-theme-wrapper/)
* [Theme wrapper](http://roots.io/sage/getting-started/theme-wrapper/)
* Cleaner HTML output of navigation menus
* Posts use the [hNews](http://microformats.org/wiki/hnews) microformat
* [Multilingual ready](http://roots.io/wpml/) and over 30 available [community translations](https://github.com/roots/roots-translations)
* [Multilingual ready](http://roots.io/wpml/) and over 30 available [community translations](https://github.com/roots/sage-translations)
### Go further with Roots
### Go further with Sage
#### Clean up WordPress
Install the [Soil](https://github.com/roots/soil) plugin to enable additional features:
@@ -45,7 +45,7 @@ Install the [Soil](https://github.com/roots/soil) plugin to enable additional fe
## Installation
Clone the git repo - `git clone https://github.com/roots/roots.git` - or [download it](https://github.com/roots/roots/zipball/master) and then rename the directory to the name of your theme or website.
Clone the git repo - `git clone https://github.com/roots/sage.git` and then rename the directory to the name of your theme or website.
If you don't use [Bedrock](https://github.com/roots/bedrock), you'll need to add the following to your `wp-config.php` on your development installation:
@@ -55,7 +55,7 @@ define('WP_ENV', 'development');
## Theme activation
Reference the [theme activation](http://roots.io/roots-101/#theme-activation) documentation to understand everything that happens once you activate Roots.
Reference the [theme activation](http://roots.io/roots-101/#theme-activation) documentation to understand everything that happens once you activate Sage.
## Configuration
@@ -65,7 +65,7 @@ Edit `lib/init.php` to setup navigation menus, post thumbnail sizes, post format
## Theme development
Roots uses [gulp](http://gulpjs.com/) as its build system and [Bower](http://bower.io/) to manage front-end packages.
Sage uses [gulp](http://gulpjs.com/) as its build system and [Bower](http://bower.io/) to manage front-end packages.
### Install gulp and Bower
@@ -86,7 +86,7 @@ You now have all the necessary dependencies to run the build process.
## Documentation
Roots documentation is available at [http://roots.io/docs/](http://roots.io/docs/).
Sage documentation is available at [http://roots.io/sage/getting-started/](http://roots.io/sage/getting-started/).
## Contributing

View File

@@ -6,7 +6,7 @@
* replace the dash with an underscore when adding it to the object below.
*
* .noConflict()
* The routing is enclosed within an anonymous function so that you can
* The routing is enclosed within an anonymous function so that you can
* always reference jQuery with $, even when in .noConflict() mode.
*
* Google CDN, Latest jQuery
@@ -16,9 +16,9 @@
(function($) {
// Use this variable to set up the common and page specific functions. If you
// Use this variable to set up the common and page specific functions. If you
// rename this variable, you will also need to rename the namespace below.
var Roots = {
var Sage = {
// All pages
common: {
init: function() {
@@ -43,7 +43,7 @@ var Roots = {
// Add additional events for more control over timing e.g. a finalize event
var UTIL = {
fire: function(func, funcname, args) {
var namespace = Roots;
var namespace = Sage;
funcname = (funcname === undefined) ? 'init' : funcname;
if (func !== '' && namespace[func] && typeof namespace[func][funcname] === 'function') {
namespace[func][funcname](args);

View File

@@ -2,10 +2,7 @@
@import "../../bower_components/bootstrap/less/bootstrap.less";
// endbower
// Variable overrides and custom variables
@import "_variables";
// Roots
@import "_variables"; // Variable overrides and custom variables
@import "_global"; // Base styling & custom mixins
@import "components/_buttons"; // Button tweaks
@import "components/_comments"; // Comment styling

View File

@@ -3,7 +3,7 @@
<!--[if lt IE 8]>
<div class="alert alert-warning">
<?php _e('You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.', 'roots'); ?>
<?php _e('You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.', 'sage'); ?>
</div>
<![endif]-->
@@ -15,11 +15,11 @@
<div class="wrap container" role="document">
<div class="content row">
<main class="main" role="main">
<?php include roots_template_path(); ?>
<?php include sage_template_path(); ?>
</main><!-- /.main -->
<?php if (roots_display_sidebar()) : ?>
<?php if (sage_display_sidebar()) : ?>
<aside class="sidebar" role="complementary">
<?php include roots_sidebar_path(); ?>
<?php include sage_sidebar_path(); ?>
</aside><!-- /.sidebar -->
<?php endif; ?>
</div><!-- /.content -->

View File

@@ -1,7 +1,7 @@
{
"name": "roots",
"version": "7.0.3",
"homepage": "http://roots.io",
"name": "sage",
"version": "8.0.0",
"homepage": "http://roots.io/sage/",
"authors": [
"Ben Word <ben@benword.com>"
],

View File

@@ -1,15 +1,15 @@
<?php
/**
* Roots includes
* Sage includes
*
* The $roots_includes array determines the code library included in your theme.
* The $sage_includes array determines the code library included in your theme.
* Add or remove files to the array as needed. Supports child theme overrides.
*
* Please note that missing files will produce a fatal error.
*
* @link https://github.com/roots/roots/pull/1042
* @link https://github.com/roots/sage/pull/1042
*/
$roots_includes = array(
$sage_includes = array(
'lib/utils.php', // Utility functions
'lib/init.php', // Initial theme setup and constants
'lib/wrapper.php', // Theme wrapper class
@@ -23,9 +23,9 @@ $roots_includes = array(
'lib/extras.php', // Custom functions
);
foreach ($roots_includes as $file) {
foreach ($sage_includes as $file) {
if (!$filepath = locate_template($file)) {
trigger_error(sprintf(__('Error locating %s for inclusion', 'roots'), $file), E_USER_ERROR);
trigger_error(sprintf(__('Error locating %s for inclusion', 'sage'), $file), E_USER_ERROR);
}
require_once $filepath;

View File

@@ -2,7 +2,7 @@
<?php if (!have_posts()) : ?>
<div class="alert alert-warning">
<?php _e('Sorry, no results were found.', 'roots'); ?>
<?php _e('Sorry, no results were found.', 'sage'); ?>
</div>
<?php get_search_form(); ?>
<?php endif; ?>
@@ -14,8 +14,8 @@
<?php if ($wp_query->max_num_pages > 1) : ?>
<nav class="post-nav">
<ul class="pager">
<li class="previous"><?php next_posts_link(__('&larr; Older posts', 'roots')); ?></li>
<li class="next"><?php previous_posts_link(__('Newer posts &rarr;', 'roots')); ?></li>
<li class="previous"><?php next_posts_link(__('&larr; Older posts', 'sage')); ?></li>
<li class="next"><?php previous_posts_link(__('Newer posts &rarr;', 'sage')); ?></li>
</ul>
</nav>
<?php endif; ?>

View File

@@ -7,29 +7,29 @@ if (is_admin() && isset($_GET['activated']) && 'themes.php' == $GLOBALS['pagenow
exit;
}
function roots_theme_activation_options_init() {
function sage_theme_activation_options_init() {
register_setting(
'roots_activation_options',
'roots_theme_activation_options'
'sage_activation_options',
'sage_theme_activation_options'
);
}
add_action('admin_init', 'roots_theme_activation_options_init');
add_action('admin_init', 'sage_theme_activation_options_init');
function roots_activation_options_page_capability() {
function sage_activation_options_page_capability() {
return 'edit_theme_options';
}
add_filter('option_page_capability_roots_activation_options', 'roots_activation_options_page_capability');
add_filter('option_page_capability_sage_activation_options', 'sage_activation_options_page_capability');
function roots_theme_activation_options_add_page() {
$roots_activation_options = roots_get_theme_activation_options();
function sage_theme_activation_options_add_page() {
$sage_activation_options = sage_get_theme_activation_options();
if (!$roots_activation_options) {
if (!$sage_activation_options) {
add_theme_page(
__('Theme Activation', 'roots'),
__('Theme Activation', 'roots'),
__('Theme Activation', 'sage'),
__('Theme Activation', 'sage'),
'edit_theme_options',
'theme_activation_options',
'roots_theme_activation_options_render_page'
'sage_theme_activation_options_render_page'
);
} else {
if (is_admin() && isset($_GET['page']) && $_GET['page'] === 'theme_activation_options') {
@@ -39,68 +39,68 @@ function roots_theme_activation_options_add_page() {
}
}
}
add_action('admin_menu', 'roots_theme_activation_options_add_page', 50);
add_action('admin_menu', 'sage_theme_activation_options_add_page', 50);
function roots_get_theme_activation_options() {
return get_option('roots_theme_activation_options');
function sage_get_theme_activation_options() {
return get_option('sage_theme_activation_options');
}
function roots_theme_activation_options_render_page() { ?>
function sage_theme_activation_options_render_page() { ?>
<div class="wrap">
<h2><?php printf(__('%s Theme Activation', 'roots'), wp_get_theme()); ?></h2>
<h2><?php printf(__('%s Theme Activation', 'sage'), wp_get_theme()); ?></h2>
<div class="update-nag">
<?php _e('These settings are optional and should usually be used only on a fresh installation', 'roots'); ?>
<?php _e('These settings are optional and should usually be used only on a fresh installation', 'sage'); ?>
</div>
<?php settings_errors(); ?>
<form method="post" action="options.php">
<?php settings_fields('roots_activation_options'); ?>
<?php settings_fields('sage_activation_options'); ?>
<table class="form-table">
<tr valign="top"><th scope="row"><?php _e('Create static front page?', 'roots'); ?></th>
<tr valign="top"><th scope="row"><?php _e('Create static front page?', 'sage'); ?></th>
<td>
<fieldset>
<legend class="screen-reader-text"><span><?php _e('Create static front page?', 'roots'); ?></span></legend>
<select name="roots_theme_activation_options[create_front_page]" id="create_front_page">
<option selected="selected" value="true"><?php echo _e('Yes', 'roots'); ?></option>
<option value="false"><?php echo _e('No', 'roots'); ?></option>
<legend class="screen-reader-text"><span><?php _e('Create static front page?', 'sage'); ?></span></legend>
<select name="sage_theme_activation_options[create_front_page]" id="create_front_page">
<option selected="selected" value="true"><?php echo _e('Yes', 'sage'); ?></option>
<option value="false"><?php echo _e('No', 'sage'); ?></option>
</select>
<p class="description"><?php printf(__('Create a page called Home and set it to be the static front page', 'roots')); ?></p>
<p class="description"><?php printf(__('Create a page called Home and set it to be the static front page', 'sage')); ?></p>
</fieldset>
</td>
</tr>
<tr valign="top"><th scope="row"><?php _e('Change permalink structure?', 'roots'); ?></th>
<tr valign="top"><th scope="row"><?php _e('Change permalink structure?', 'sage'); ?></th>
<td>
<fieldset>
<legend class="screen-reader-text"><span><?php _e('Update permalink structure?', 'roots'); ?></span></legend>
<select name="roots_theme_activation_options[change_permalink_structure]" id="change_permalink_structure">
<option selected="selected" value="true"><?php echo _e('Yes', 'roots'); ?></option>
<option value="false"><?php echo _e('No', 'roots'); ?></option>
<legend class="screen-reader-text"><span><?php _e('Update permalink structure?', 'sage'); ?></span></legend>
<select name="sage_theme_activation_options[change_permalink_structure]" id="change_permalink_structure">
<option selected="selected" value="true"><?php echo _e('Yes', 'sage'); ?></option>
<option value="false"><?php echo _e('No', 'sage'); ?></option>
</select>
<p class="description"><?php printf(__('Change permalink structure to /&#37;postname&#37;/', 'roots')); ?></p>
<p class="description"><?php printf(__('Change permalink structure to /&#37;postname&#37;/', 'sage')); ?></p>
</fieldset>
</td>
</tr>
<tr valign="top"><th scope="row"><?php _e('Create navigation menu?', 'roots'); ?></th>
<tr valign="top"><th scope="row"><?php _e('Create navigation menu?', 'sage'); ?></th>
<td>
<fieldset>
<legend class="screen-reader-text"><span><?php _e('Create navigation menu?', 'roots'); ?></span></legend>
<select name="roots_theme_activation_options[create_navigation_menus]" id="create_navigation_menus">
<option selected="selected" value="true"><?php echo _e('Yes', 'roots'); ?></option>
<option value="false"><?php echo _e('No', 'roots'); ?></option>
<legend class="screen-reader-text"><span><?php _e('Create navigation menu?', 'sage'); ?></span></legend>
<select name="sage_theme_activation_options[create_navigation_menus]" id="create_navigation_menus">
<option selected="selected" value="true"><?php echo _e('Yes', 'sage'); ?></option>
<option value="false"><?php echo _e('No', 'sage'); ?></option>
</select>
<p class="description"><?php printf(__('Create the Primary Navigation menu and set the location', 'roots')); ?></p>
<p class="description"><?php printf(__('Create the Primary Navigation menu and set the location', 'sage')); ?></p>
</fieldset>
</td>
</tr>
<tr valign="top"><th scope="row"><?php _e('Add pages to menu?', 'roots'); ?></th>
<tr valign="top"><th scope="row"><?php _e('Add pages to menu?', 'sage'); ?></th>
<td>
<fieldset>
<legend class="screen-reader-text"><span><?php _e('Add pages to menu?', 'roots'); ?></span></legend>
<select name="roots_theme_activation_options[add_pages_to_primary_navigation]" id="add_pages_to_primary_navigation">
<option selected="selected" value="true"><?php echo _e('Yes', 'roots'); ?></option>
<option value="false"><?php echo _e('No', 'roots'); ?></option>
<legend class="screen-reader-text"><span><?php _e('Add pages to menu?', 'sage'); ?></span></legend>
<select name="sage_theme_activation_options[add_pages_to_primary_navigation]" id="add_pages_to_primary_navigation">
<option selected="selected" value="true"><?php echo _e('Yes', 'sage'); ?></option>
<option value="false"><?php echo _e('No', 'sage'); ?></option>
</select>
<p class="description"><?php printf(__('Add all current published pages to the Primary Navigation', 'roots')); ?></p>
<p class="description"><?php printf(__('Add all current published pages to the Primary Navigation', 'sage')); ?></p>
</fieldset>
</td>
</tr>
@@ -111,8 +111,8 @@ function roots_theme_activation_options_render_page() { ?>
<?php }
function roots_theme_activation_action() {
if (!($roots_theme_activation_options = roots_get_theme_activation_options())) {
function sage_theme_activation_action() {
if (!($sage_theme_activation_options = sage_get_theme_activation_options())) {
return;
}
@@ -120,10 +120,10 @@ function roots_theme_activation_action() {
return;
}
if ($roots_theme_activation_options['create_front_page'] === 'true') {
$roots_theme_activation_options['create_front_page'] = false;
if ($sage_theme_activation_options['create_front_page'] === 'true') {
$sage_theme_activation_options['create_front_page'] = false;
$default_pages = array(__('Home', 'roots'));
$default_pages = array(__('Home', 'sage'));
$existing_pages = get_pages();
$temp = array();
@@ -144,7 +144,7 @@ function roots_theme_activation_action() {
wp_insert_post($add_default_pages);
}
$home = get_page_by_title(__('Home', 'roots'));
$home = get_page_by_title(__('Home', 'sage'));
update_option('show_on_front', 'page');
update_option('page_on_front', $home->ID);
@@ -155,8 +155,8 @@ function roots_theme_activation_action() {
wp_update_post($home_menu_order);
}
if ($roots_theme_activation_options['change_permalink_structure'] === 'true') {
$roots_theme_activation_options['change_permalink_structure'] = false;
if ($sage_theme_activation_options['change_permalink_structure'] === 'true') {
$sage_theme_activation_options['change_permalink_structure'] = false;
if (get_option('permalink_structure') !== '/%postname%/') {
global $wp_rewrite;
@@ -165,29 +165,29 @@ function roots_theme_activation_action() {
}
}
if ($roots_theme_activation_options['create_navigation_menus'] === 'true') {
$roots_theme_activation_options['create_navigation_menus'] = false;
if ($sage_theme_activation_options['create_navigation_menus'] === 'true') {
$sage_theme_activation_options['create_navigation_menus'] = false;
$roots_nav_theme_mod = false;
$sage_nav_theme_mod = false;
$primary_nav = wp_get_nav_menu_object(__('Primary Navigation', 'roots'));
$primary_nav = wp_get_nav_menu_object(__('Primary Navigation', 'sage'));
if (!$primary_nav) {
$primary_nav_id = wp_create_nav_menu(__('Primary Navigation', 'roots'), array('slug' => 'primary_navigation'));
$roots_nav_theme_mod['primary_navigation'] = $primary_nav_id;
$primary_nav_id = wp_create_nav_menu(__('Primary Navigation', 'sage'), array('slug' => 'primary_navigation'));
$sage_nav_theme_mod['primary_navigation'] = $primary_nav_id;
} else {
$roots_nav_theme_mod['primary_navigation'] = $primary_nav->term_id;
$sage_nav_theme_mod['primary_navigation'] = $primary_nav->term_id;
}
if ($roots_nav_theme_mod) {
set_theme_mod('nav_menu_locations', $roots_nav_theme_mod);
if ($sage_nav_theme_mod) {
set_theme_mod('nav_menu_locations', $sage_nav_theme_mod);
}
}
if ($roots_theme_activation_options['add_pages_to_primary_navigation'] === 'true') {
$roots_theme_activation_options['add_pages_to_primary_navigation'] = false;
if ($sage_theme_activation_options['add_pages_to_primary_navigation'] === 'true') {
$sage_theme_activation_options['add_pages_to_primary_navigation'] = false;
$primary_nav = wp_get_nav_menu_object(__('Primary Navigation', 'roots'));
$primary_nav = wp_get_nav_menu_object(__('Primary Navigation', 'sage'));
$primary_nav_term_id = (int) $primary_nav->term_id;
$menu_items= wp_get_nav_menu_items($primary_nav_term_id);
@@ -205,11 +205,11 @@ function roots_theme_activation_action() {
}
}
update_option('roots_theme_activation_options', $roots_theme_activation_options);
update_option('sage_theme_activation_options', $sage_theme_activation_options);
}
add_action('admin_init','roots_theme_activation_action');
add_action('admin_init','sage_theme_activation_action');
function roots_deactivation() {
delete_option('roots_theme_activation_options');
function sage_deactivation() {
delete_option('sage_theme_activation_options');
}
add_action('switch_theme', 'roots_deactivation');
add_action('switch_theme', 'sage_deactivation');

View File

@@ -14,7 +14,7 @@
* - An ID has been defined in config.php
* - You're not logged in as an administrator
*/
function roots_asset_path($filename) {
function sage_asset_path($filename) {
if (WP_ENV === 'development') {
return get_template_directory_uri() . '/dist/' . $filename;
}
@@ -32,8 +32,8 @@ function roots_asset_path($filename) {
}
}
function roots_assets() {
wp_enqueue_style('roots_css', roots_asset_path('styles/main.css'), false, null);
function sage_assets() {
wp_enqueue_style('sage_css', sage_asset_path('styles/main.css'), false, null);
/**
* Grab Google CDN's latest jQuery with a protocol relative URL; fallback to local if offline
@@ -46,21 +46,21 @@ function roots_assets() {
wp_register_script('jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.js', array(), null, true);
add_filter('script_loader_src', 'roots_jquery_local_fallback', 10, 2);
add_filter('script_loader_src', 'sage_jquery_local_fallback', 10, 2);
}
if (is_single() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
wp_enqueue_script('modernizr', roots_asset_path('scripts/modernizr.js'), array(), null, true);
wp_enqueue_script('modernizr', sage_asset_path('scripts/modernizr.js'), array(), null, true);
wp_enqueue_script('jquery');
wp_enqueue_script('roots_js', roots_asset_path('scripts/app.js'), array(), null, true);
wp_enqueue_script('sage_js', sage_asset_path('scripts/app.js'), array(), null, true);
}
add_action('wp_enqueue_scripts', 'roots_assets', 100);
add_action('wp_enqueue_scripts', 'sage_assets', 100);
// http://wordpress.stackexchange.com/a/12450
function roots_jquery_local_fallback($src, $handle = null) {
function sage_jquery_local_fallback($src, $handle = null) {
static $add_jquery_fallback = false;
if ($add_jquery_fallback) {
@@ -74,14 +74,14 @@ function roots_jquery_local_fallback($src, $handle = null) {
return $src;
}
add_action('wp_head', 'roots_jquery_local_fallback');
add_action('wp_head', 'sage_jquery_local_fallback');
/**
* Google Analytics snippet from HTML5 Boilerplate
*
* Cookie domain is 'auto' configured. See: http://goo.gl/VUCHKM
*/
function roots_google_analytics() { ?>
function sage_google_analytics() { ?>
<script>
<?php if (WP_ENV === 'production') : ?>
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
@@ -99,5 +99,5 @@ function roots_google_analytics() { ?>
<?php }
if (GOOGLE_ANALYTICS_ID && (WP_ENV !== 'production' || !current_user_can('manage_options'))) {
add_action('wp_footer', 'roots_google_analytics', 20);
add_action('wp_footer', 'sage_google_analytics', 20);
}

View File

@@ -20,24 +20,24 @@ if (!defined('WP_ENV')) {
/**
* Add body class if sidebar is active
*/
function roots_sidebar_body_class($classes) {
if (roots_display_sidebar()) {
function sage_sidebar_body_class($classes) {
if (sage_display_sidebar()) {
$classes[] = 'sidebar-primary';
}
return $classes;
}
add_filter('body_class', 'roots_sidebar_body_class');
add_filter('body_class', 'sage_sidebar_body_class');
/**
* Define which pages shouldn't have the sidebar
*
* See lib/sidebar.php for more details
*/
function roots_display_sidebar() {
function sage_display_sidebar() {
static $display;
if (!isset($display)) {
$sidebar_config = new Roots_Sidebar(
$sidebar_config = new Sage_Sidebar(
/**
* Conditional tag checks (http://codex.wordpress.org/Conditional_Tags)
* Any of these conditional tags that return true won't show the sidebar
@@ -60,8 +60,8 @@ function roots_display_sidebar() {
'template-custom.php'
)
);
$display = apply_filters('roots/display_sidebar', $sidebar_config->display);
}
$display = apply_filters('sage/display_sidebar', $sidebar_config->display);
}
return $display;
}

View File

@@ -2,7 +2,7 @@
/**
* Clean up the_excerpt()
*/
function roots_excerpt_more() {
return ' &hellip; <a href="' . get_permalink() . '">' . __('Continued', 'roots') . '</a>';
function sage_excerpt_more() {
return ' &hellip; <a href="' . get_permalink() . '">' . __('Continued', 'sage') . '</a>';
}
add_filter('excerpt_more', 'roots_excerpt_more');
add_filter('excerpt_more', 'sage_excerpt_more');

View File

@@ -7,7 +7,7 @@
*
* @link http://getbootstrap.com/components/#thumbnails
*/
function roots_gallery($attr) {
function sage_gallery($attr) {
$post = get_post();
static $instance = 0;
@@ -115,15 +115,15 @@ function roots_gallery($attr) {
}
if (current_theme_supports('bootstrap-gallery')) {
remove_shortcode('gallery');
add_shortcode('gallery', 'roots_gallery');
add_shortcode('gallery', 'sage_gallery');
add_filter('use_default_gallery_style', '__return_null');
}
/**
* Add class="thumbnail img-thumbnail" to attachment items
*/
function roots_attachment_link_class($html) {
function sage_attachment_link_class($html) {
$html = str_replace('<a', '<a class="thumbnail img-thumbnail"', $html);
return $html;
}
add_filter('wp_get_attachment_link', 'roots_attachment_link_class', 10, 1);
add_filter('wp_get_attachment_link', 'sage_attachment_link_class', 10, 1);

View File

@@ -1,11 +1,11 @@
<?php
/**
* Roots initial setup and constants
* Sage initial setup and constants
*/
function roots_setup() {
function sage_setup() {
// Make theme available for translation
// Community translations can be found at https://github.com/roots/roots-translations
load_theme_textdomain('roots', get_template_directory() . '/lang');
// Community translations can be found at https://github.com/roots/sage-translations
load_theme_textdomain('sage', get_template_directory() . '/lang');
// Enable plugins to manage the document title
// http://codex.wordpress.org/Function_Reference/add_theme_support#Title_Tag
@@ -14,7 +14,7 @@ function roots_setup() {
// Register wp_nav_menu() menus
// http://codex.wordpress.org/Function_Reference/register_nav_menus
register_nav_menus(array(
'primary_navigation' => __('Primary Navigation', 'roots')
'primary_navigation' => __('Primary Navigation', 'sage')
));
// Add post thumbnails
@@ -34,14 +34,14 @@ function roots_setup() {
// Tell the TinyMCE editor to use a custom stylesheet
add_editor_style('/dist/css/editor-style.css');
}
add_action('after_setup_theme', 'roots_setup');
add_action('after_setup_theme', 'sage_setup');
/**
* Register sidebars
*/
function roots_widgets_init() {
function sage_widgets_init() {
register_sidebar(array(
'name' => __('Primary', 'roots'),
'name' => __('Primary', 'sage'),
'id' => 'sidebar-primary',
'before_widget' => '<section class="widget %1$s %2$s">',
'after_widget' => '</section>',
@@ -50,7 +50,7 @@ function roots_widgets_init() {
));
register_sidebar(array(
'name' => __('Footer', 'roots'),
'name' => __('Footer', 'sage'),
'id' => 'sidebar-footer',
'before_widget' => '<section class="widget %1$s %2$s">',
'after_widget' => '</section>',
@@ -58,4 +58,4 @@ function roots_widgets_init() {
'after_title' => '</h3>',
));
}
add_action('widgets_init', 'roots_widgets_init');
add_action('widgets_init', 'sage_widgets_init');

View File

@@ -6,11 +6,11 @@
* <li id="menu-item-8" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8"><a href="/">Home</a></li>
* <li id="menu-item-9" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9"><a href="/sample-page/">Sample Page</a></l
*
* Roots_Nav_Walker example output:
* Sage_Nav_Walker example output:
* <li class="menu-home"><a href="/">Home</a></li>
* <li class="menu-sample-page"><a href="/sample-page/">Sample Page</a></li>
*/
class Roots_Nav_Walker extends Walker_Nav_Menu {
class Sage_Nav_Walker extends Walker_Nav_Menu {
function check_current($classes) {
return preg_match('/(current[-_])|active|dropdown/', $classes);
}
@@ -34,7 +34,7 @@ class Roots_Nav_Walker extends Walker_Nav_Menu {
$item_html = preg_replace('/<a[^>]*>(.*)<\/a>/iU', '$1', $item_html);
}
$item_html = apply_filters('roots/wp_nav_menu_item', $item_html);
$item_html = apply_filters('sage/wp_nav_menu_item', $item_html);
$output .= $item_html;
}
@@ -53,7 +53,7 @@ class Roots_Nav_Walker extends Walker_Nav_Menu {
* Remove the id="" on nav menu items
* Return 'menu-slug' for nav menu classes
*/
function roots_nav_menu_css_class($classes, $item) {
function sage_nav_menu_css_class($classes, $item) {
$slug = sanitize_title($item->title);
$classes = preg_replace('/(current(-menu-|[-_]page[-_])(item|parent|ancestor))/', 'active', $classes);
$classes = preg_replace('/^((menu|page)[-_\w+]+)+/', '', $classes);
@@ -64,28 +64,28 @@ function roots_nav_menu_css_class($classes, $item) {
return array_filter($classes, 'is_element_empty');
}
add_filter('nav_menu_css_class', 'roots_nav_menu_css_class', 10, 2);
add_filter('nav_menu_css_class', 'sage_nav_menu_css_class', 10, 2);
add_filter('nav_menu_item_id', '__return_null');
/**
* Clean up wp_nav_menu_args
*
* Remove the container
* Use Roots_Nav_Walker() by default
* Use Sage_Nav_Walker() by default
*/
function roots_nav_menu_args($args = '') {
$roots_nav_menu_args = array();
function sage_nav_menu_args($args = '') {
$sage_nav_menu_args = array();
$roots_nav_menu_args['container'] = false;
$sage_nav_menu_args['container'] = false;
if (!$args['items_wrap']) {
$roots_nav_menu_args['items_wrap'] = '<ul class="%2$s">%3$s</ul>';
$sage_nav_menu_args['items_wrap'] = '<ul class="%2$s">%3$s</ul>';
}
if (!$args['depth']) {
$roots_nav_menu_args['depth'] = 2;
$sage_nav_menu_args['depth'] = 2;
}
return array_merge($args, $roots_nav_menu_args);
return array_merge($args, $sage_nav_menu_args);
}
add_filter('wp_nav_menu_args', 'roots_nav_menu_args');
add_filter('wp_nav_menu_args', 'sage_nav_menu_args');

View File

@@ -4,14 +4,14 @@
*
* If any of the is_* conditional tags or is_page_template(template_file) checks return true, the sidebar will NOT be displayed.
*
* @link http://roots.io/the-roots-sidebar/
* @link http://roots.io/getting-started/theme-sidebar/
*
* @param array list of conditional tags (http://codex.wordpress.org/Conditional_Tags)
* @param array list of page templates. These will be checked via is_page_template()
*
* @return boolean True will display the sidebar, False will not
*/
class Roots_Sidebar {
class Sage_Sidebar {
private $conditionals;
private $templates;

View File

@@ -2,19 +2,19 @@
/**
* Page titles
*/
function roots_title() {
function sage_title() {
if (is_home()) {
if (get_option('page_for_posts', true)) {
return get_the_title(get_option('page_for_posts', true));
} else {
return __('Latest Posts', 'roots');
return __('Latest Posts', 'sage');
}
} elseif (is_archive()) {
return get_the_archive_title();
} elseif (is_search()) {
return sprintf(__('Search Results for %s', 'roots'), get_search_query());
return sprintf(__('Search Results for %s', 'sage'), get_search_query());
} elseif (is_404()) {
return __('Not Found', 'roots');
return __('Not Found', 'sage');
} else {
return get_the_title();
}

View File

@@ -8,17 +8,17 @@ function is_element_empty($element) {
}
// Tell WordPress to use searchform.php from the templates/ directory
function roots_get_search_form() {
function sage_get_search_form() {
$form = '';
locate_template('/templates/searchform.php', true, false);
return $form;
}
add_filter('get_search_form', 'roots_get_search_form');
add_filter('get_search_form', 'sage_get_search_form');
/**
* Add page slug to body_class() classes if it doesn't exist
*/
function roots_body_class($classes) {
function sage_body_class($classes) {
// Add post/page slug
if (is_single() || is_page() && !is_front_page()) {
if (!in_array(basename(get_permalink()), $classes)) {
@@ -27,4 +27,4 @@ function roots_body_class($classes) {
}
return $classes;
}
add_filter('body_class', 'roots_body_class');
add_filter('body_class', 'sage_body_class');

View File

@@ -2,18 +2,18 @@
/**
* Theme wrapper
*
* @link http://roots.io/an-introduction-to-the-roots-theme-wrapper/
* @link http://roots.io/getting-started/theme-wrapper/
* @link http://scribu.net/wordpress/theme-wrappers.html
*/
function roots_template_path() {
return Roots_Wrapping::$main_template;
function sage_template_path() {
return Sage_Wrapping::$main_template;
}
function roots_sidebar_path() {
return new Roots_Wrapping('templates/sidebar.php');
function sage_sidebar_path() {
return new Sage_Wrapping('templates/sidebar.php');
}
class Roots_Wrapping {
class Sage_Wrapping {
// Stores the full path to the main template file
public static $main_template;
@@ -37,7 +37,7 @@ class Roots_Wrapping {
}
public function __toString() {
$this->templates = apply_filters('roots/wrap_' . $this->slug, $this->templates);
$this->templates = apply_filters('sage/wrap_' . $this->slug, $this->templates);
return locate_template($this->templates);
}
@@ -54,7 +54,7 @@ class Roots_Wrapping {
self::$base = false;
}
return new Roots_Wrapping();
return new Sage_Wrapping();
}
}
add_filter('template_include', array('Roots_Wrapping', 'wrap'), 99);
add_filter('template_include', array('Sage_Wrapping', 'wrap'), 99);

View File

@@ -1,14 +1,14 @@
{
"name": "roots",
"version": "7.0.3",
"name": "sage",
"version": "8.0.0",
"author": "Ben Word <ben@benword.com>",
"homepage": "http://roots.io",
"homepage": "http://roots.io/sage/",
"repository": {
"type": "git",
"url": "git://github.com/roots/roots.git"
"url": "git://github.com/roots/sage.git"
},
"bugs": {
"url": "https://github.com/roots/roots/issues"
"url": "https://github.com/roots/sage/issues"
},
"licenses": [
{

View File

@@ -1,8 +1,8 @@
/*
Theme Name: Roots Starter Theme
Theme URI: http://roots.io/starter-theme/
Description: Roots is a WordPress starter theme based on HTML5 Boilerplate & Bootstrap. <a href="https://github.com/roots/roots/contributors">Contribute on GitHub</a>
Version: 7.0.3
Theme Name: Sage Starter Theme
Theme URI: http://roots.io/sage/
Description: Sage is a WordPress starter theme. <a href="https://github.com/roots/sage/contributors">Contribute on GitHub</a>
Version: 8.0.0
Author: Roots
Author URI: http://roots.io/

View File

@@ -6,7 +6,7 @@
<section id="comments" class="comments">
<?php if (have_comments()) : ?>
<h2><?php printf(_nx('One response to &ldquo;%2$s&rdquo;', '%1$s responses to &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'roots'), number_format_i18n(get_comments_number()), '<span>' . get_the_title() . '</span>'); ?></h2>
<h2><?php printf(_nx('One response to &ldquo;%2$s&rdquo;', '%1$s responses to &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'sage'), number_format_i18n(get_comments_number()), '<span>' . get_the_title() . '</span>'); ?></h2>
<ol class="comment-list">
<?php wp_list_comments(array('style' => 'ol', 'short_ping' => true)); ?>
@@ -16,10 +16,10 @@
<nav>
<ul class="pager">
<?php if (get_previous_comments_link()) : ?>
<li class="previous"><?php previous_comments_link(__('&larr; Older comments', 'roots')); ?></li>
<li class="previous"><?php previous_comments_link(__('&larr; Older comments', 'sage')); ?></li>
<?php endif; ?>
<?php if (get_next_comments_link()) : ?>
<li class="next"><?php next_comments_link(__('Newer comments &rarr;', 'roots')); ?></li>
<li class="next"><?php next_comments_link(__('Newer comments &rarr;', 'sage')); ?></li>
<?php endif; ?>
</ul>
</nav>
@@ -28,7 +28,7 @@
<?php if (!comments_open() && get_comments_number() != '0' && post_type_supports(get_post_type(), 'comments')) : ?>
<div class="alert alert-warning">
<?php _e('Comments are closed.', 'roots'); ?>
<?php _e('Comments are closed.', 'sage'); ?>
</div>
<?php endif; ?>

View File

@@ -8,7 +8,7 @@
<?php the_content(); ?>
</div>
<footer>
<?php wp_link_pages(array('before' => '<nav class="page-nav"><p>' . __('Pages:', 'roots'), 'after' => '</p></nav>')); ?>
<?php wp_link_pages(array('before' => '<nav class="page-nav"><p>' . __('Pages:', 'sage'), 'after' => '</p></nav>')); ?>
</footer>
<?php comments_template('/templates/comments.php'); ?>
</article>

View File

@@ -1,2 +1,2 @@
<time class="updated" datetime="<?php echo get_the_time('c'); ?>"><?php echo get_the_date(); ?></time>
<p class="byline author vcard"><?php echo __('By', 'roots'); ?> <a href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>" rel="author" class="fn"><?php echo get_the_author(); ?></a></p>
<p class="byline author vcard"><?php echo __('By', 'sage'); ?> <a href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>" rel="author" class="fn"><?php echo get_the_author(); ?></a></p>

View File

@@ -13,7 +13,7 @@
<nav class="collapse navbar-collapse" role="navigation">
<?php
if (has_nav_menu('primary_navigation')) :
wp_nav_menu(array('theme_location' => 'primary_navigation', 'walker' => new Roots_Nav_Walker(), 'menu_class' => 'nav navbar-nav'));
wp_nav_menu(array('theme_location' => 'primary_navigation', 'walker' => new Sage_Nav_Walker(), 'menu_class' => 'nav navbar-nav'));
endif;
?>
</nav>

View File

@@ -1,5 +1,5 @@
<div class="page-header">
<h1>
<?php echo roots_title(); ?>
<?php echo sage_title(); ?>
</h1>
</div>

View File

@@ -1,9 +1,9 @@
<form role="search" method="get" class="search-form form-inline" action="<?php echo esc_url(home_url('/')); ?>">
<label class="sr-only"><?php _e('Search for:', 'roots'); ?></label>
<label class="sr-only"><?php _e('Search for:', 'sage'); ?></label>
<div class="input-group">
<input type="search" value="<?php echo get_search_query(); ?>" name="s" class="search-field form-control" placeholder="<?php _e('Search', 'roots'); ?> <?php bloginfo('name'); ?>" required>
<input type="search" value="<?php echo get_search_query(); ?>" name="s" class="search-field form-control" placeholder="<?php _e('Search', 'sage'); ?> <?php bloginfo('name'); ?>" required>
<span class="input-group-btn">
<button type="submit" class="search-submit btn btn-default"><?php _e('Search', 'roots'); ?></button>
<button type="submit" class="search-submit btn btn-default"><?php _e('Search', 'sage'); ?></button>
</span>
</div>
</form>