Skip to content

Commit

Permalink
Updates readme, license files and rename script.js, replace jquery 3.…
Browse files Browse the repository at this point in the history
…3.1 slim w/ normal
  • Loading branch information
Joe Chung committed Feb 7, 2018
1 parent 91ecf26 commit ceb4282
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 24 deletions.
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2013-2015 Gunn-Jerkens
Copyright (c) 2013-2018 Gunn-Jerkens

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
24 changes: 9 additions & 15 deletions README.md
Expand Up @@ -91,19 +91,18 @@ The wp directory is a submodule and should not be modified in any way, the
content directory houses themes and plugins. The Shared directory is where all
uploaded files (via the WordPress backend) are stored.

### grunt
wp-boilerplate uses Grunt to compress Javascript files and run Compass. Run
### webpack
wp-boilerplate uses Webpack to compress Javascript files and compile Sass to CSS. Run
`npm install` from the root directory to install node dependencies, then run
`grunt` to watch for changes in `js/src` and `style/sass` in the theme
directory.
`npm run watch` to watch for changes in `js` files and `scss` files.

To compile a dev environment (Live Reload, Concatenated JS, Watch):
To compile a dev environment (concatenated js, watch):

`grunt dev -v`
`npm run start`

To compile a production build (Uglify JS):

`grunt -v`
`npm run build`

## features
### multi-environment handling in wp-config
Expand Down Expand Up @@ -141,10 +140,8 @@ images from an upstream environment.
### included javascript
[Modernizr](http://modernizr.com/)
[Bootstrap](http://getbootstrap.com)
[jQuery Placeholder](https://github.com/mathiasbynens/jquery-placeholder)
[jQuery imagesLoaded](https://github.com/desandro/imagesloaded)

All javascript (with exception of Modernizr, Respond, and jQuery (CDN) is compiled by Grunt into a 'main.js' file included in the footer. Bootstrap is included as a group of js files for easy customization && removal. Due to bootstrap files requiring a certain order in their compile they are called verbosely in the `Gruntfile.js` and need to be removed from that file if you are removing them from the project. Alternatively you can include Bootstrap via CDN if you uncomment it in the assets.php folder && make sure to remove it from your compiled JS.
The entry javascript file can be found in 'public/content/themes/gj-boilerplate/js/src/scripts.js'. Webpack will only compile files that are imports (or dependencies) in this file. To include Bootstrap javascript files, uncomment it in 'scripts.js' to include in this project.

### included Google Tag Manager integration
Option to add your `GTM ID` in GJ Options. A GTM custom event named `formSubmitted` also fires when the form is submitted successfully so you can track conversions on the ajax form submit.
Expand All @@ -153,7 +150,7 @@ Option to add your `GTM ID` in GJ Options. A GTM custom event named `formSubmitt
[Bootstrap](http://getbootstrap.com) is included as an scss file, to use uncomment it in the screen.scss file. It import alls the individual scss files, delete at will for a customized Bootstrap build.

```
/* Bootstrap v3.3.4 */
/* Bootstrap v4.0.0 */
//@import "bootstrap";
```

Expand All @@ -162,12 +159,9 @@ Option to add your `GTM ID` in GJ Options. A GTM custom event named `formSubmitt

```
// Font Awesome stylesheet
// wp_enqueue_style('font-awesome', 'http://netdna.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.css', false, null, false);
// wp_enqueue_style('font-awesome', 'http://netdna.bootstrapcdn.com/font-awesome/5.0.6/css/font-awesome.css', false, null, false);
```

### default compass configuration
Includes default configuration for SASS/Compass, which comes highly recommended.

## dependencies
[node](http://nodejs.org)
```
Expand Down
14 changes: 7 additions & 7 deletions init.sh
Expand Up @@ -99,15 +99,15 @@ binconfig="bin/config.sh"


# Development Configs
read -p "What is the local hostname? (e.g., example.test) " hostname_test
read -p "What is the local database name? (e.g., database_test) " db_test
read -p "What is the local hostname? (e.g., example.test) " hostname_dev
read -p "What is the local database name? (e.g., database_dev) " db_dev

if [[ $type = "initial" ]]; then
sed -i.bak s/{hostname_test}/$hostname_test/g $wpconfig || true
sed -i.bak s/{db_test}/$db_test/g $wpconfig || true
sed -i.bak s/{hostname_dev}/$hostname_dev/g $wpconfig || true
sed -i.bak s/{db_dev}/$db_dev/g $wpconfig || true
fi

sed -i.bak s/{db_test}/$db_test/g $binconfig || true
sed -i.bak s/{db_dev}/$db_dev/g $binconfig || true


# Staging Configs
Expand Down Expand Up @@ -173,12 +173,12 @@ then
if [[ $REPLY =~ ^[Yy](es)?$ ]]
then

mysql -uroot -e "CREATE DATABASE $db_test COLLATE utf8_general_ci" || true
mysql -uroot -e "CREATE DATABASE $db_dev COLLATE utf8_general_ci" || true
read -p "Would you like to import a sql file? (y/N) "
if [[ $REPLY =~ ^[Yy](es)?$ ]]
then
read -p "Where is the file located? (e.g., /home/user/sql/example.sql) " sql
mysql -uroot $db_test < $sql || true
mysql -uroot $db_dev < $sql || true
if [[ $type = "initial" ]]; then
read -p "What is the table prefix?" table
sed -i.bak s/gj_/$table/g $wpconfig || true
Expand Down
2 changes: 1 addition & 1 deletion public/content/themes/gj-boilerplate/inc/assets.php
Expand Up @@ -9,7 +9,7 @@ function enqueue_scripts()

// Libraries
wp_deregister_script('jquery');
wp_enqueue_script('jquery', 'https://code.jquery.com/jquery-3.2.1.slim.min.js', false, null, true);
wp_enqueue_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js', false, null, true);

$main = '/js/main.js';
$mainFilePath = get_template_directory() . $main;
Expand Down

0 comments on commit ceb4282

Please sign in to comment.