@@ -11,7 +11,12 @@
|
||||
"node": true
|
||||
},
|
||||
"rules": {
|
||||
"react/require-extension": 0,
|
||||
"import/extensions": [1, { "js": "never" }]
|
||||
"comma-dangle": ["error", {
|
||||
"arrays": "always-multiline",
|
||||
"objects": "always-multiline",
|
||||
"imports": "always-multiline",
|
||||
"exports": "always-multiline",
|
||||
"functions": "ignore"
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
### HEAD
|
||||
### 9.0.0-beta.1: January 10th, 2016
|
||||
* 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))
|
||||
* Remove sidebar defaults ([#1760](https://github.com/roots/sage/pull/1760))
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
Sage is a WordPress starter theme with a modern development workflow.
|
||||
|
||||
**Sage 9 is in active development and is only currently in alpha. The `master` branch tracks Sage 9 development. If you want a stable version, use the [latest Sage 8 release](https://github.com/roots/sage/releases/latest).**
|
||||
**Sage 9 is in active development and is currently in beta. The `master` branch tracks Sage 9 development. If you want a stable version, use the [latest Sage 8 release](https://github.com/roots/sage/releases/latest).**
|
||||
|
||||
## Features
|
||||
|
||||
|
||||
@@ -4,7 +4,12 @@
|
||||
"rules": {
|
||||
"import/no-extraneous-dependencies": 0,
|
||||
"prefer-rest-params": 0,
|
||||
"react/require-extension": 0,
|
||||
"import/extensions": [1, { "js": "never" }]
|
||||
"comma-dangle": ["error", {
|
||||
"arrays": "always-multiline",
|
||||
"objects": "always-multiline",
|
||||
"imports": "always-multiline",
|
||||
"exports": "always-multiline",
|
||||
"functions": "ignore"
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,12 +31,27 @@ const config = mergeWithConcat({
|
||||
config.watch.push(`${path.basename(config.paths.assets)}/${config.copy}`);
|
||||
config.watch = uniq(config.watch);
|
||||
|
||||
Object.keys(config.entry).forEach(id =>
|
||||
config.entry[id].unshift(path.join(__dirname, 'public-path.js')));
|
||||
|
||||
module.exports = mergeWithConcat(config, {
|
||||
env: Object.assign({ production: isProduction, development: !isProduction }, argv.env),
|
||||
publicPath: `${config.publicPath}/${path.basename(config.paths.dist)}/`,
|
||||
manifest: {},
|
||||
});
|
||||
|
||||
/**
|
||||
* If your publicPath differs between environments, but you know it at compile time,
|
||||
* then set SAGE_DIST_PATH as an environment variable before compiling.
|
||||
* Example:
|
||||
* SAGE_DIST_PATH=/wp-content/themes/sage/dist yarn build:production
|
||||
*/
|
||||
if (process.env.SAGE_DIST_PATH) {
|
||||
module.exports.publicPath = process.env.SAGE_DIST_PATH;
|
||||
}
|
||||
|
||||
/**
|
||||
* If you don't know your publicPath at compile time, then uncomment the lines
|
||||
* below and use WordPress's wp_localize_script() to set SAGE_DIST_PATH global.
|
||||
* Example:
|
||||
* wp_localize_script('sage/main.js', 'SAGE_DIST_PATH', get_theme_file_uri('dist/'))
|
||||
*/
|
||||
// Object.keys(module.exports.entry).forEach(id =>
|
||||
// module.exports.entry[id].unshift(path.join(__dirname, 'public-path.js')));
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
/* eslint-env browser */
|
||||
/* globals WEBPACK_PUBLIC_PATH */
|
||||
/* globals SAGE_DIST_PATH */
|
||||
|
||||
// Dynamically set absolute public path from current protocol and host
|
||||
if (WEBPACK_PUBLIC_PATH) {
|
||||
// eslint-disable-next-line no-undef, camelcase
|
||||
__webpack_public_path__ = `${location.protocol}//${location.host}${WEBPACK_PUBLIC_PATH}`;
|
||||
/** Dynamically set absolute public path from current protocol and host */
|
||||
if (SAGE_DIST_PATH) {
|
||||
__webpack_public_path__ = SAGE_DIST_PATH; // eslint-disable-line no-undef, camelcase
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@ let webpackConfig = {
|
||||
include: config.paths.assets,
|
||||
loader: ExtractTextPlugin.extract({
|
||||
fallbackLoader: 'style',
|
||||
publicPath: '../',
|
||||
loader: [
|
||||
`css?${sourceMapQueryStr}`,
|
||||
'postcss',
|
||||
@@ -60,6 +61,7 @@ let webpackConfig = {
|
||||
include: config.paths.assets,
|
||||
loader: ExtractTextPlugin.extract({
|
||||
fallbackLoader: 'style',
|
||||
publicPath: '../',
|
||||
loader: [
|
||||
`css?${sourceMapQueryStr}`,
|
||||
'postcss',
|
||||
@@ -71,11 +73,9 @@ let webpackConfig = {
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg|ico)$/,
|
||||
include: config.paths.assets,
|
||||
use: [
|
||||
`file?${qs.stringify({
|
||||
name: `[path]${assetsFilenames}.[ext]`,
|
||||
})}`,
|
||||
],
|
||||
loader: `file?${qs.stringify({
|
||||
name: `[path]${assetsFilenames}.[ext]`,
|
||||
})}`,
|
||||
},
|
||||
{
|
||||
test: /\.(ttf|eot)$/,
|
||||
@@ -122,9 +122,12 @@ let webpackConfig = {
|
||||
root: config.paths.root,
|
||||
verbose: false,
|
||||
}),
|
||||
/**
|
||||
* It would be nice to switch to copy-webpack-plugin, but
|
||||
* unfortunately it doesn't provide a reliable way of
|
||||
* tracking the before/after file names
|
||||
*/
|
||||
new CopyGlobsPlugin({
|
||||
// It would be nice to switch to copy-webpack-plugin, but unfortunately it doesn't
|
||||
// provide a reliable way of tracking the before/after file names
|
||||
pattern: config.copy,
|
||||
output: `[path]${assetsFilenames}.[ext]`,
|
||||
manifest: config.manifest,
|
||||
@@ -141,11 +144,6 @@ let webpackConfig = {
|
||||
Tether: 'tether',
|
||||
'window.Tether': 'tether',
|
||||
}),
|
||||
new webpack.DefinePlugin({
|
||||
WEBPACK_PUBLIC_PATH: (config.enabled.watcher)
|
||||
? JSON.stringify(config.publicPath)
|
||||
: false,
|
||||
}),
|
||||
new webpack.LoaderOptionsPlugin({
|
||||
minimize: config.enabled.optimize,
|
||||
debug: config.enabled.watcher,
|
||||
|
||||
@@ -4,7 +4,10 @@ const BrowserSyncPlugin = require('browsersync-webpack-plugin');
|
||||
const config = require('./config');
|
||||
|
||||
module.exports = {
|
||||
output: { pathinfo: true },
|
||||
output: {
|
||||
pathinfo: true,
|
||||
publicPath: config.proxyUrl + config.publicPath,
|
||||
},
|
||||
devtool: '#cheap-module-source-map',
|
||||
stats: false,
|
||||
plugins: [
|
||||
@@ -13,7 +16,7 @@ module.exports = {
|
||||
new webpack.NoErrorsPlugin(),
|
||||
new BrowserSyncPlugin({
|
||||
target: config.devUrl,
|
||||
publicPath: config.publicPath,
|
||||
publicPath: '../',
|
||||
proxyUrl: config.proxyUrl,
|
||||
watch: config.watch,
|
||||
}),
|
||||
|
||||
@@ -71,6 +71,7 @@ module.exports = class {
|
||||
this.globOptions.nodir = true;
|
||||
this.manifest = options.manifest || {};
|
||||
this.files = [];
|
||||
this.started = false;
|
||||
}
|
||||
apply(compiler) {
|
||||
if (this.disable) {
|
||||
@@ -78,8 +79,12 @@ module.exports = class {
|
||||
}
|
||||
this.compiler = compiler;
|
||||
this.resolveWorkingDirectory();
|
||||
compiler.plugin('emit', this.emitHandler.bind(this));
|
||||
compiler.plugin('after-emit', this.afterEmitHandler.bind(this));
|
||||
if (!this.started) {
|
||||
compiler.plugin('emit', this.emitHandler.bind(this));
|
||||
compiler.plugin('after-emit', this.afterEmitHandler.bind(this));
|
||||
compiler.plugin('after-emit', this.afterEmitHandler.bind(this));
|
||||
this.started = true;
|
||||
}
|
||||
}
|
||||
emitHandler(compilation, callback) {
|
||||
this.compilation = compilation;
|
||||
|
||||
@@ -1,23 +1,25 @@
|
||||
// import external dependencies
|
||||
/** import external dependencies */
|
||||
import 'jquery';
|
||||
import 'bootstrap/dist/js/bootstrap';
|
||||
|
||||
// import local dependencies
|
||||
import Router from './util/router';
|
||||
import common from './routes/Common';
|
||||
import home from './routes/Home';
|
||||
import aboutUs from './routes/About';
|
||||
/** import local dependencies */
|
||||
import Router from './util/Router';
|
||||
import common from './routes/common';
|
||||
import home from './routes/home';
|
||||
import aboutUs from './routes/about';
|
||||
|
||||
// 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.
|
||||
const routes = {
|
||||
// All pages
|
||||
/**
|
||||
* Populate Router instance with DOM routes
|
||||
* @type {Router} routes - An instance of our router
|
||||
*/
|
||||
const routes = new Router({
|
||||
/** All pages */
|
||||
common,
|
||||
// Home page
|
||||
/** Home page */
|
||||
home,
|
||||
// About us page, note the change from about-us to aboutUs.
|
||||
/** About Us page, note the change from about-us to aboutUs. */
|
||||
aboutUs,
|
||||
};
|
||||
});
|
||||
|
||||
// Load Events
|
||||
jQuery(document).ready(() => new Router(routes).loadEvents());
|
||||
/** Load Events */
|
||||
jQuery(document).ready(() => routes.loadEvents());
|
||||
|
||||
50
package.json
50
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sage",
|
||||
"version": "9.0.0-alpha.4",
|
||||
"version": "9.0.0-beta.1",
|
||||
"author": "Roots <team@roots.io>",
|
||||
"homepage": "https://roots.io/sage/",
|
||||
"private": true,
|
||||
@@ -27,48 +27,48 @@
|
||||
"test": "yarn run lint"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 4.5"
|
||||
"node": ">= 6.9.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"autoprefixer": "^6.5.2",
|
||||
"autoprefixer": "^6.6.1",
|
||||
"body-parser": "^1.15.2",
|
||||
"browser-sync": "^2.17.5",
|
||||
"browsersync-webpack-plugin": "^0.1.1",
|
||||
"buble": "^0.14.2",
|
||||
"buble-loader": "^0.3.2",
|
||||
"clean-webpack-plugin": "^0.1.13",
|
||||
"css-loader": "^0.25.0",
|
||||
"cssnano": "^3.8.0",
|
||||
"eslint": "^3.9.1",
|
||||
"eslint-config-airbnb": "^12.0.0",
|
||||
"browser-sync": "^2.18.6",
|
||||
"browsersync-webpack-plugin": "^0.2.0",
|
||||
"buble": "^0.15.2",
|
||||
"buble-loader": "^0.4.0",
|
||||
"clean-webpack-plugin": "^0.1.15",
|
||||
"css-loader": "^0.26.1",
|
||||
"cssnano": "^3.10.0",
|
||||
"eslint": "^3.13.1",
|
||||
"eslint-config-airbnb": "^14.0.0",
|
||||
"eslint-loader": "^1.6.1",
|
||||
"eslint-plugin-import": "^2.0.1",
|
||||
"eslint-plugin-jsx-a11y": "^2.2.3",
|
||||
"eslint-plugin-react": "^6.6.0",
|
||||
"eslint-plugin-jsx-a11y": "^3.0.2",
|
||||
"eslint-plugin-react": "^6.9.0",
|
||||
"extract-text-webpack-plugin": "^2.0.0-beta.4",
|
||||
"file-loader": "^0.9.0",
|
||||
"glob": "^7.1.1",
|
||||
"imagemin-mozjpeg": "^6.0.0",
|
||||
"imagemin-webpack-plugin": "^1.2.1",
|
||||
"imports-loader": "^0.6.5",
|
||||
"imagemin-webpack-plugin": "^1.4.4",
|
||||
"imports-loader": "^0.7.0",
|
||||
"loader-utils": "^0.2.16",
|
||||
"lodash": "^4.16.6",
|
||||
"lodash": "^4.17.4",
|
||||
"minimist": "^1.2.0",
|
||||
"monkey-hot-loader": "github:rmarscher/monkey-hot-loader#webpack2-import",
|
||||
"node-sass": "^3.11.2",
|
||||
"node-sass": "^4.2.0",
|
||||
"optimize-css-assets-webpack-plugin": "^1.3.0",
|
||||
"postcss": "^5.2.5",
|
||||
"postcss-loader": "^1.1.0",
|
||||
"postcss": "^5.2.9",
|
||||
"postcss-loader": "^1.2.1",
|
||||
"qs": "^6.3.0",
|
||||
"resolve-url-loader": "^1.6.0",
|
||||
"resolve-url-loader": "^1.6.1",
|
||||
"rimraf": "^2.5.4",
|
||||
"sass-loader": "^4.0.2",
|
||||
"sass-loader": "^4.1.1",
|
||||
"style-loader": "^0.13.1",
|
||||
"url-loader": "^0.5.7",
|
||||
"webpack": "^2.1.0-beta.26",
|
||||
"webpack": "^2.2.0-rc.3",
|
||||
"webpack-assets-manifest": "^0.6.1",
|
||||
"webpack-dev-middleware": "^1.8.4",
|
||||
"webpack-hot-middleware": "^2.13.1"
|
||||
"webpack-dev-middleware": "^1.9.0",
|
||||
"webpack-hot-middleware": "^2.15.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"bootstrap": "^4.0.0-alpha.6",
|
||||
|
||||
@@ -89,6 +89,14 @@ add_action('widgets_init', function () {
|
||||
] + $config);
|
||||
});
|
||||
|
||||
/**
|
||||
* Updates the `$post` variable on each iteration of the loop.
|
||||
* Note: updated value is only available for subsequently loaded views, such as partials
|
||||
*/
|
||||
add_action('the_post', function ($post) {
|
||||
sage('blade')->share('post', $post);
|
||||
});
|
||||
|
||||
/**
|
||||
* Setup Sage options
|
||||
*/
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Theme Name: Sage Starter Theme
|
||||
Theme URI: https://roots.io/sage/
|
||||
Description: Sage is a WordPress starter theme. <a href="https://github.com/roots/sage">Contribute on GitHub</a>
|
||||
Version: 9.0.0-alpha.4
|
||||
Version: 9.0.0-beta.1
|
||||
Author: Roots
|
||||
Author URI: https://roots.io/
|
||||
Text Domain: sage
|
||||
|
||||
Reference in New Issue
Block a user