Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2.0.1 #182

Merged
merged 30 commits into from
Jan 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
badc9f2
Merge pull request #180 from uriweb/release-2.0.0
bjcfuller Jan 3, 2020
4f43120
Add styles for date component
bjcfuller Jan 15, 2020
d0ec810
Add styles for promo component
bjcfuller Jan 15, 2020
8ccd33b
Build travis on dev- branches
bjcfuller Jan 15, 2020
c32ddd7
Install ESlint and remove JSCS and JSHint
bjcfuller Jan 15, 2020
54c5277
Use ESLint in Travis
bjcfuller Jan 15, 2020
429780c
Have PHPCodeSniffer only sniff php files
bjcfuller Jan 15, 2020
cf91800
Lint customizer.js
bjcfuller Jan 15, 2020
ae2bad1
Lint navigation.js
bjcfuller Jan 15, 2020
a58e051
Lint skip-link-focus-fix.js
bjcfuller Jan 15, 2020
cb31a9d
Lint breadcrumbs.js
bjcfuller Jan 15, 2020
63f9a79
Lint searchbar.js
bjcfuller Jan 15, 2020
a8a8ee2
Lint stage.js
bjcfuller Jan 15, 2020
d392295
Lint youmenu.js
bjcfuller Jan 15, 2020
9e5530e
Lint default-block-editor-customizations.js
bjcfuller Jan 15, 2020
e8cdd3a
Ignore static dir in eslint
bjcfuller Jan 15, 2020
8450117
Merge pull request #181 from uriweb/dev-eslint-migration
bjcfuller Jan 15, 2020
377ff1b
removes button, quote, and pullquote blocks; removes custom colors; r…
Jan 15, 2020
367062e
Remove super panel button styles
bjcfuller Jan 15, 2020
a2b40a8
Merge branch 'develop' of github.com:uriweb/uri-modern into develop
bjcfuller Jan 15, 2020
0d9161d
adds styles for default WP blocks
Jan 15, 2020
20409db
Add more date component styles
bjcfuller Jan 16, 2020
0a9a4f1
Merge branch 'develop' of github.com:uriweb/uri-modern into develop
bjcfuller Jan 16, 2020
c1e9f2c
removes "circle-mask" option from images
Jan 16, 2020
124dc45
hides striped table option since default tables are striped; hides "w…
Jan 16, 2020
84e26cc
checks that the breadcrumb is an object before working with it. solv…
Jan 16, 2020
602c958
improves objection validation from previous commit
Jan 16, 2020
d7fbd7c
Bump version to 2.0.1
bjcfuller Jan 16, 2020
8257f88
Update readme
bjcfuller Jan 16, 2020
ff19100
Update devDependencies
bjcfuller Jan 16, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"env": {
"es6": true,
"browser": true
},
"extends": [ "plugin:@wordpress/eslint-plugin/recommended" ],
"rules": {
"no-undef": ["warn"],
"no-unused-vars": ["warn"],
"no-bitwise": ["warn"],
"no-alert": ["warn"],
"no-console": [ "error", { "allow": ["warn", "error"] } ],
"jsx-a11y/label-has-associated-control": ["warn"],
"jsx-a11y/label-has-for": [0]
},
"ignorePatterns": [
"node_modules/",
"gulpfile.js",
"js/script.min.js",
"js/block-editor.min.js",
"js/smoothscroll.min.js",
"static/**"
]
}
5 changes: 3 additions & 2 deletions .sniff
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@

ignore=node_modules,work_files,gulpfile.js,js/script.min.js,js/smoothscroll.min.js,js/block-editor.min.js
ruleset=.codesniffer.ruleset.xml
extensions=php
warn=-n

if hash phpcs 2>/dev/null; then

echo Running php code beautifier...
phpcbf --standard=$ruleset --ignore=$ignore $warn .
phpcbf --standard=$ruleset --ignore=$ignore --extensions=$extensions $warn .
echo done beautifying.

echo Running php codesniffer...
phpcs --standard=$ruleset --ignore=$ignore $warn .
phpcs --standard=$ruleset --ignore=$ignore --extensions=$extensions $warn .
echo done sniffing.

echo done with sniff.
Expand Down
9 changes: 6 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ branches:
only:
- master
- develop
- /^dev-.*$/
- /^travis-.*$/

# Declare which versions of WordPress to test against.
Expand Down Expand Up @@ -68,15 +69,17 @@ before_script:
- cd $theme_dir
# After CodeSniffer install you should refresh your path.
- phpenv rehash
# Install JSCS: JavaScript Code Style checker
- npm install -g jscs
# Install ESLint
- npm install -g eslint
# Install WP JS standards
- npm install @wordpress/eslint-plugin --save-dev

# Run test script commands.
script:
# Search theme for PHP syntax errors.
- find . \( -name '*.php' \) -exec php -lf {} \;
# Run the theme through JavaScript Code Style checker
- jscs .
- eslint .
# WordPress Coding Standards
# @link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards
# @link http://pear.php.net/package/PHP_CodeSniffer/
Expand Down
35 changes: 14 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,22 @@

URI Modern is a WordPress theme designed for the University of Rhode Island. It's designed to replace all themes currently being used on the university's websites, and unify the online brand and experience.

## What's new in 2.0.0
## What's new in 2.0.1

URI Modern 2.0.0 is a major release focused on style refinements and improving core functionality.
URI Modern 2.0.1 is bug fix release.

### A Refined Look
* Adds styles for default Gutenberg blocks
* Removes certain Gutenberg functionality that is either duplicated by the [Component Library](https://github.com/uriweb/uri-component-library) or discouraged by URI web design practices
- Removes button, quote, and pull quote Gutenberg blocks
- Removes custom colors, font sizes, and drop caps
- Removes circular image option, striped tables, and wide separators
* Adds styles for Component Library date and promo components
* Removes button styles on Component Library panels formatted as `super`
* Fixes an issue with breadcrumbs on paginated posts
* All scripts are now linted with ESLint; JSCS and JSHint have been removed
* Updates development tools

The [URI Component Library](https://github.com/uriweb/uri-component-library) v4.0 and later relies on themes to control the look and feel of components beyond the general styles provided out-of-the-box. URI Modern introduces a refined look for components, as well as other widely-used elements of the theme.

* Introduces a refined look for several components — most notably cards, buttons, and tabs
* Introduces a refined look for site menus and brand bar elements
* Adds styles for definition lists

### General Improvements

* Improves theme support for the Gutenberg block editor, including previewing theme fonts, background colors, and page title visibility
* Improves responsiveness of certain oEmbed elements
* Adds a `button-list` CSS class for styling vertical groups of buttons
* Removes accessibility and code error checking (install the [URI Code Compliance](https://github.com/uriweb/uri-code-compliance) plugin instead)
* Fixes an issue in breadcrumbs that caused the current post to not be included
* Other bug fixes
* Updates devDependencies

For complete details, see the [commit history](https://github.com/uriweb/uri-modern/pull/179/commits) and the [issue tracker](https://github.com/uriweb/uri-modern/issues).
For complete details, see the [commit history](https://github.com/uriweb/uri-modern/pull/182/commits) and the [issue tracker](https://github.com/uriweb/uri-modern/issues).

## How do I get set up?

Expand All @@ -46,4 +39,4 @@ Contributors: Brandon Fuller, John Pennypacker
Tags: themes
Requires at least: 4.0
Tested up to: 5.3
Stable tag: 2.0.0
Stable tag: 2.0.1
11 changes: 3 additions & 8 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ var bannerStatic = ['/*',
''].join('\n');

// include plug-ins
var jshint = require('gulp-jshint');
var jscs = require('gulp-jscs');
var eslint = require('gulp-eslint');
var changed = require('gulp-changed');
var imagemin = require('gulp-imagemin');
var rename = require('gulp-rename');
Expand All @@ -57,12 +56,8 @@ gulp.task('scripts', scripts);
function scripts(done) {

gulp.src('./src/js/**/*.js')
.pipe(jshint(done))
.pipe(jshint.reporter('default'));

gulp.src('./src/js/**/*.js')
.pipe(jscs(done))
.pipe(jscs.reporter());
.pipe(eslint(done))
.pipe(eslint.format());

// Process top-level js (front side)
gulp.src('./src/js/*.js')
Expand Down
5 changes: 4 additions & 1 deletion inc/get-breadcrumbs.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function uri_modern_breadcrumbs() {
$path = $path . '/' . $p;
$link = uri_modern_breadcrumbs_get_link( $path );

if ( null != $link ) {
if ( ! empty( $link ) ) {
$crumbs[] = $link;
}
}
Expand All @@ -69,6 +69,9 @@ function uri_modern_breadcrumbs_get_link( $path ) {

if ( 0 !== $post_id ) { // it's a post or a page.
$p = get_page_by_path( $path );
if ( ! is_object( $p ) ) { // solves an issue with page break paginated pages and posts
return;
}
$output = array(
'name' => get_the_title( $p->ID ),
'href' => get_site_url() . $path,
Expand Down
127 changes: 41 additions & 86 deletions inc/gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ function uri_modern_allowed_blocks( $allowed_blocks, $post ) {
'core/paragraph',
'core/image',
'core/heading',
'core/subhead',
// 'core/subhead',
'core/gallery',
'core/list',
'core/quote',
// 'core/quote',
'core/audio',
'core/cover', // previously core/cover-image
'core/file',
Expand All @@ -47,9 +47,9 @@ function uri_modern_allowed_blocks( $allowed_blocks, $post ) {
'core/freeform', // Classic
'core/html', // Custom HTML
'core/preformatted',
'core/pullquote',
// 'core/pullquote',
// layout
'core/button',
// 'core/button',
'core/columns',
'core/media-text',
'core/more',
Expand Down Expand Up @@ -126,90 +126,45 @@ function uri_modern_allowed_blocks( $allowed_blocks, $post ) {





// COLORS //
// disable option for custom colors
add_theme_support( 'disable-custom-colors' );
// register custom palette with no colors to hide the color options entirely
add_theme_support( 'editor-color-palette' );

// Adds support for editor color palette.
add_theme_support(
'editor-color-palette',
array(
array(
'name' => __( 'URI Blue', 'uri' ),
'slug' => 'uri-gray',
'color' => '#002147',
),
array(
'name' => __( 'Light Blue', 'uri' ),
'slug' => 'light-blue',
'color' => '#c0ddf2',
),
array(
'name' => __( 'Keaney Blue', 'uri' ),
'slug' => 'keaney-blue',
'color' => '#2277b3',
),
array(
'name' => __( 'Dark Blue', 'uri' ),
'slug' => 'dark-blue',
'color' => '#001228',
),
array(
'name' => __( 'URI Gold', 'uri' ),
'slug' => 'uri-gold',
'color' => '#b5985a',
),
array(
'name' => __( 'Mid Gold', 'uri' ),
'slug' => 'mid-gold',
'color' => '#ffd453',
),
array(
'name' => __( 'Light Gold', 'uri' ),
'slug' => 'light-gold',
'color' => '#fefada',
),
array(
'name' => __( 'URI Gray', 'uri' ),
'slug' => 'uri-gray',
'color' => '#dddddd',
),
array(
'name' => __( 'Light Gray', 'uri' ),
'slug' => 'light-gray',
'color' => '#fafafa',
),
array(
'name' => __( 'Mid Gray', 'uri' ),
'slug' => 'mid-gray',
'color' => '#999999',
),
array(
'name' => __( 'Dark Gray', 'uri' ),
'slug' => 'dark-gray',
'color' => '#555555',
),
array(
'name' => __( 'White', 'uri' ),
'slug' => 'white',
'color' => '#fff',
),
array(
'name' => __( 'Black', 'uri' ),
'slug' => 'black',
'color' => '#000',
),
array(
'name' => __( 'Link Blue', 'uri' ),
'slug' => 'link-blue',
'color' => '#005eff',
),

/**
* Removes the dropcap widget with a little injected css.
*/
function uri_modern_hide_font_styles() {
// https://github.com/WordPress/gutenberg/issues/6184
// hide dropcap only
// echo '<style>.blocks-font-size .components-base-control:first-of-type { margin-bottom: 0; } .blocks-font-size .components-toggle-control { display: none; }</style>';
// hide the entire font size section
echo '<style>.blocks-font-size * { display: none; } .blocks-font-size { border: 0 !important; height: 0; padding: 0 !important; margin-top: 32px !important; }</style>';
}
add_action( 'admin_head', 'uri_modern_hide_font_styles' );


/**
* Removes options for different font sizes
* Not in use since we're using CSS to hide the entire pane
*
* @see uri_modern_hide_font_styles
*/
function uri_modern_set_font_sizes() {
// removes the text box where users can enter custom pixel sizes
add_theme_support( 'disable-custom-font-sizes' );
// forces the dropdown for font sizes to only contain "normal"
add_theme_support(
'editor-font-sizes',
array(
'name' => __( 'Link Hover Blue', 'uri' ),
'slug' => 'link-hover-blue',
'color' => '#003287',
),
)
);
array(
'name' => 'Normal',
'size' => 20,
'slug' => 'normal',
),
)
);
}
// add_action( 'after_setup_theme', 'uri_modern_set_font_sizes' );
2 changes: 1 addition & 1 deletion js/block-editor.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 6 additions & 7 deletions js/customizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*/

( function( $ ) {

// Site title and description.
wp.customize(
'blogname',
Expand Down Expand Up @@ -41,25 +40,25 @@
if ( 'blank' === to ) {
$( '.site-title a, .site-description' ).css(
{
'clip': 'rect(1px, 1px, 1px, 1px)',
'position': 'absolute'
clip: 'rect(1px, 1px, 1px, 1px)',
position: 'absolute',
}
);
} else {
$( '.site-title a, .site-description' ).css(
{
'clip': 'auto',
'position': 'relative'
clip: 'auto',
position: 'relative',
}
);
$( '.site-title a, .site-description' ).css(
{
'color': to
color: to,
}
);
}
}
);
}
);
} )( jQuery );
}( jQuery ) );
Loading