This repository has been archived by the owner on Dec 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ac7d26
commit eb6949f
Showing
199 changed files
with
10,855 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
/** | ||
* The template for displaying 404 pages (not found). | ||
*/ | ||
|
||
get_header(); ?> | ||
<main id="main" class="site-main col" role="main"> | ||
<section class="error-404 not-found"> | ||
<header class="page-header"> | ||
<h1 class="page-title">Oops! That page can't be found.</h1> | ||
</header> | ||
</section> | ||
</main> | ||
<?php get_footer(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,79 @@ | ||
# wpvue | ||
# WP Boilerplate | ||
|
||
## Set Up | ||
|
||
### Clone the Repo | ||
|
||
There are two branches of note: | ||
|
||
* `Master` production branch | ||
* `Staging` staging branch | ||
|
||
Both branches go through [DeployBot](https://blackstonemedia.deploybot.com/) to be pushed to WP Engine via SFTP. | ||
- `staging` is an automatic deployment | ||
- `master` must be manually triggered | ||
|
||
You should never have to pull from WP Engine | ||
|
||
### Local WP Setup | ||
|
||
Run the follow code in your repo's root | ||
|
||
*If you have a database dump to import, replace `wp db create` with `wp db import path_to_sql`* | ||
|
||
``` | ||
wp core download --skip-content | ||
wp config create --dbname="wp-bsm" --dbuser="root" --dbpass="root" | ||
wp db create | ||
wp core install --url=bsm.localhost --title="Blackstone Media" --admin_user=admin --admin_password=admin --admin_email=your_email | ||
``` | ||
|
||
#### Theme | ||
|
||
1. Activate the theme: `wp theme activate bsm` | ||
2. Navigate to the theme folder `cd wp-content/themes/bsm` | ||
3. Install node packages: `yarn install` or `npm install` | ||
4. Generate a dist folder with `yarn staging` (`npm run staging`) or start webpack dev server with `yarn dev` (`npm run dev`) | ||
|
||
#### Plugins | ||
|
||
These plugins are required. You can activate them via command line. | ||
|
||
* *[WP-Migrate-DB Pro](https://deliciousbrains.com/wp-migrate-db-pro)* | ||
* *[Advanced Custom Fields Pro](https://advancedcustomfields.com)* | ||
|
||
``` | ||
wp plugin activate wp-migrate-db-pro wp-migrate-db-pro-cli advanced-custom-fields-pro | ||
``` | ||
|
||
WP-Migrate-DB Pro requires a license key that you'll need to manually add in the plugin settings | ||
|
||
* URL: `/wp-admin/tools.php?page=wp-migrate-db-pro#settings` | ||
* KEY: `4d92f653-67ca-4b99-9f1a-8922f8cfc40f` | ||
|
||
To setup WP-Migrate-DB Pro to pull from production, from the plugin's settings: | ||
|
||
1. Click Migrate | ||
2. Click Pull | ||
3. Paste this code: `https://teamblackstone.wpengine.com I0h/G/WuZOTjEDPrpnvQh1WHAV4JqTqiqa2FvLdO` | ||
4. **(Optional)** Backup local database | ||
5. Save Migration Profile | ||
6. Pull & Save | ||
7. Log back in...if you want | ||
|
||
These plugins are ignored in the repo so they're not tracked but are useful for local development. | ||
|
||
*[Debug This](https://wordpress.org/plugins/debug-this)* | ||
Helpful plugin to track down anything on the page | ||
``` | ||
wp plugin install debug-this --activate | ||
``` | ||
|
||
*[Coral Remote Images](https://wordpress.org/plugins/coral-remote-images/)* | ||
Redirects images to another url, alleviating the need to download/sync uploads directory. | ||
``` | ||
wp plugin install coral-remote-images --activate | ||
``` | ||
|
||
> WP-Migrate Pro does provide a [Media Files Addon](https://deliciousbrains.com/wp-migrate-db-pro/doc/media-files-addon/) but hasn't been tested |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html> | ||
<html <?php language_attributes(); ?>> | ||
<head> | ||
<meta charset="<?php bloginfo( 'charset' ); ?>"> | ||
<?php // force Internet Explorer to use the latest rendering engine available ?> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1"> | ||
<link rel="profile" href="http://gmpg.org/xfn/11"> | ||
<?php wp_head(); ?> | ||
</head> | ||
|
||
<body <?php body_class(); ?>> | ||
|
||
<app id="app" role="main"></app><!-- #app --> | ||
|
||
<?php wp_footer(); ?> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
'extends': ['plugin:vue/essential'] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = ({ file, options, env }) => ({ | ||
plugins: { | ||
autoprefixer: {}, // add browserslist config to package.json | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
const webpack = require('webpack'); | ||
const merge = require('webpack-merge'); | ||
const path = require('path'); | ||
const CleanWebpackPlugin = require('clean-webpack-plugin'); | ||
const { VueLoaderPlugin } = require('vue-loader'); | ||
var ProgressBarPlugin = require('progress-bar-webpack-plugin'); | ||
|
||
module.exports = (env, options) => { | ||
return merge( require('./webpack.' + env + '.js'), { | ||
entry: { | ||
main: path.resolve(__dirname, '../src/main.js'), | ||
'style-guide': path.resolve(__dirname, '../src/style-guide/index.js'), | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.json$/, | ||
use: 'json-loader' | ||
}, | ||
{ | ||
enforce: 'pre', | ||
test: /\.(js|vue)$/, | ||
exclude: /node_modules/, | ||
loader: 'eslint-loader', | ||
options: { | ||
emitWarning: true, | ||
failOnError: true, | ||
configFile: path.join(__dirname, ".eslintrc.js"), | ||
} | ||
}, | ||
{ | ||
test: /\.vue$/, | ||
loader: 'vue-loader' | ||
}, | ||
{ | ||
test: /\.js$/, | ||
exclude: /node_modules/, | ||
use: { | ||
loader: 'babel-loader', | ||
options: { | ||
presets: [ | ||
['env', { | ||
useBuiltIns: (env !== 'dev') | ||
}] | ||
], | ||
plugins: (env !== 'dev') ? ["transform-object-assign", "syntax-dynamic-import"] : [] | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
plugins: [ | ||
new ProgressBarPlugin(), | ||
new CleanWebpackPlugin('dist', { | ||
root: path.join(__dirname, '..') | ||
}), | ||
new webpack.DefinePlugin({ | ||
'ENV': JSON.stringify(env), | ||
'THEME_URI': JSON.stringify('/wp-content/themes/' + process.env.npm_package_name) | ||
}), | ||
new VueLoaderPlugin() | ||
] | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
const webpack = require('webpack'); | ||
const merge = require('webpack-merge'); | ||
const path = require('path'); | ||
|
||
const config = require('./webpack.config.js'); | ||
|
||
module.exports = merge(config, { | ||
devtool: 'inline-source-map', | ||
devServer: { | ||
hot: true, // this enables hot reload | ||
inline: true, // use inline method for hmr | ||
host: "localhost", | ||
port: 8080, | ||
publicPath: "/dist", | ||
// publicPath: "/" + process.env.npm_package_name + "/dist", // this isn't working with HMR for some reason | ||
contentBase: path.join(__dirname, "../"), | ||
stats: "minimal", // https://webpack.js.org/configuration/stats/ | ||
// watchOptions: { | ||
// poll: false // needed for homestead/vagrant setup --- TM removed and doesn't seem to harm anything | ||
// }, | ||
headers: { | ||
"Access-Control-Allow-Origin": "*" | ||
}, | ||
overlay: { | ||
// warnings: true, | ||
errors: true | ||
} | ||
}, | ||
output: { | ||
publicPath: 'http://localhost:8080/dist' | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.less$/, | ||
use: [ | ||
'vue-style-loader', | ||
'css-loader', | ||
{ | ||
loader: 'postcss-loader', | ||
options: { | ||
config: { | ||
path: path.resolve(__dirname, 'postcss.config.js') | ||
} | ||
} | ||
}, | ||
{ | ||
loader: 'less-loader', | ||
options: {} | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
plugins: [ | ||
new webpack.NamedModulesPlugin(), | ||
new webpack.HotModuleReplacementPlugin() | ||
] | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
const webpack = require('webpack'); | ||
const path = require('path'); | ||
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); | ||
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin"); | ||
|
||
module.exports = { | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.less$/, | ||
use: [ | ||
'vue-style-loader', | ||
MiniCssExtractPlugin.loader, | ||
'css-loader', | ||
{ | ||
loader: 'postcss-loader', | ||
options: { | ||
config: { | ||
path: path.resolve(__dirname, 'postcss.config.js'), | ||
}, | ||
} | ||
}, | ||
{ | ||
loader: 'less-loader', | ||
options: {} | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
optimization: { | ||
minimizer: [ | ||
new OptimizeCSSAssetsPlugin({}) | ||
] | ||
}, | ||
plugins: [ | ||
new MiniCssExtractPlugin() | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
const webpack = require('webpack'); | ||
const path = require('path'); | ||
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); | ||
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin"); | ||
|
||
module.exports = { | ||
devtool: 'source-map', | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.less$/, | ||
use: [ | ||
'vue-style-loader', | ||
MiniCssExtractPlugin.loader, | ||
'css-loader', | ||
{ | ||
loader: 'postcss-loader', | ||
options: { | ||
config: { | ||
path: path.resolve(__dirname, 'postcss.config.js'), | ||
}, | ||
} | ||
}, | ||
{ | ||
loader: 'less-loader', | ||
options: {} | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
plugins: [ | ||
new MiniCssExtractPlugin() | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
/** | ||
* The template for displaying the footer. | ||
* | ||
* Contains the closing of the #content div and all content after. | ||
* | ||
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials | ||
* | ||
* @package Base | ||
*/ | ||
|
||
?> | ||
|
||
<footer class="site-footer container" role="contentinfo"></footer> | ||
|
||
<?php wp_footer(); ?> | ||
|
||
</body> | ||
</html> |
Oops, something went wrong.