Code Monkey home page Code Monkey logo

bureau-wordpress-boilerplate's Introduction

The Idea Bureau → WordPress Boilerplate

Version: 2.0.1

Environment Status
Production
Staging

Template Tasks

  • Add deployment status badges and environment URLs to README.md
  • Add project details to README.md
  • Add version number to README.md
  • Add project details to package.json
  • Add version number to package.json
  • Find and replace all instances of 'project-name'
  • Find and replace all instances of 'Project Name'
  • Find and replace all instances of 'theme-name'
  • Replace resources/img/logo-mark.svg with project logo
  • Replace all favicons and configurations in resources/img/favicons/

Project dependencies

Project guidelines

  • Git-Flow to be used for git branching
  • PHP PSR-12 coding standards
  • .editorconfig rules used to maintain coding styles

Code Quality

PHP

We use PHP CodeSniffer to enforce the PSR12 coding style, any PHP code style issues must be resolved before committing. Buddy.works will fail a deployment if code quality checks don't pass.

Installation and usage

Front-end

Start by installing all npm dependencies:

npm install

Laravel Mix provides various commands to compile front-end assets:

npm run watch          # watch all files and compile
npm run hot            # watch all files, compile with live reload
npm run development    # compile without minify
npm run production     # compile with minify

SVG sprites

SVG files within the /resources/svg directory will be combined into a single SVG sprite, and can be referenced using the following snippet, where a filename of icon-twitter.svg is referenced as:

<svg><use xlink:href="#icon-twitter"></use></svg>

SVGs used like this can be interacted with JavaScript and styled with CSS.

All SVGs must be optimised before being added to the codebase, tools such as svgomg can be useful for this.

Back-end

Composer is used for back-end libraries, use the following command to install dependencies.

composer install

Lock files

Both npm and composer lock files are to be committed.

bureau-wordpress-boilerplate's People

Contributors

beneverard avatar connorholyday avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

bureau-wordpress-boilerplate's Issues

Remove adaptive images

Adaptive images no longer provides any value to this project, it should be removed and later srcset should be added.

Add improved empty search results page

When searching with no query the template outputs all posts it can find.

It would be helpful to display a page that allows you to initiate a search, offers instruction and perhaps some popular searches etc.

Excerpt Function

add_filter('wp_trim_excerpt', function($excerpt) {
    global $excerpt_length;
    return trim(substr(str_replace( '[&hellip;]', '', $excerpt ), 0, $excerpt_length)) . ' ...';
});

Investigate on-the-fly image croping

I have discovered the WP_Image_Editor class within WordPress and think that it may be able to improve our image workflow.

At the moment we register the image size within the functions file and use a thumbnail regeneration plugin to re-create any legacy images.

This means we could be creating n different image sizes for instances that an image may never be viewed in.

It also means when using migrate db pro to copy the database and media that we're downloading a lot of files, this can take some time for larger sites.

This should be investigated and, if appropriate, incorporated within the WordPress boilerplate.

Consider bulking block assets together

Gutenberg blocks can include the following:

  • block.json definition file
  • render.php render file
  • a .twig for markup
  • a .scss for styles
  • a .js for behaviour

Rather than these being spread across the theme, consider bringing these files together for ease of development.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.