LezWatch / lwtv-underscores

LezWatch.TV Theme - Underscores
https://lezwatchtv.com
GNU General Public License v3.0
0 stars 0 forks source link
hacktoberfest lezwatch themes

LezWatch.TV Theme - Built on Yikes! Starter Theme

The 100% Original Theme for LezWatch.TV

WordPress Issues PRs License

Description

Based on the Yikes! Starter Theme, the LezWatch.TV theme has been customized for custom post types (shows, characters, actors) and to be as queer as possible.

Usage documentation can be found at docs.lezwatchtv.com

Scheduled Actions

Server crontab is used to run CLI commands that generate and update complex content.

The command wp lwtv generate cron daily will run a different debugger each day, update the FacetWP cache, and so on.

Requirements

It's recommended to use Homebrew on macOS or Chocolatey for Windows to install the project dependencies.

Setup 🛠

  1. Clone this repository: git clone git@github.com:lezwatch/lwtv-underscores
  2. Move into the project directory: cd lwtv-underscores
  3. Set NPM to the correct version: nvm use
  4. Install the project dependencies: npm install
  5. Update all the things (npm, composer, etc): npm run updater
  6. Run an initial build: npm run build

Contributing

All pull requests should be made to production.

  1. Using the production branch as base, create a new branch with a descriptive name like fixing-charts or fix/chartjs421 or feature/latest-posts . Commit your work to that branch until it's ready for full testing
  2. Open a pull request from your feature branch to the production branch.
  3. If you are not a main developer, your pull request will be reviewed before it can be merged. If there are issues or changes needed, you may be asked to do so, or they may be done for you.
  4. When the code passes review, run npm run merge-to-develop to push it to development (no extra PR needed).
  5. Once the code passes tests and is approved, the branch can be merged into production and the job is done!

To install and update:

Linting

To run linting:

To fix lint issues automatically:

CSS & JS

If you're updating CSS you have a couple options, since it's all SCSS.

Grunt

  1. $ grunt watch - run grunt and leave open for ongoing changes.
  2. $ grunt build - run the build process once.

NPM

$ npm run build will build all the CSS and JS, as well as update all the libraries.

Libraries

JS and PHP libraries are included via NPM and Composer. WordPress plugins that have been forked are now included in the main code and managed by us to prevent breakage.

The vendor and node_module files are not synced to Github anymore (as of 2023-August) to minimize the amount of files stored on the servers, and the following libraries have their required code moved via Composer and npm's post-install process:

NPM

Composer

Deployment

Pushes to branches are automatically deployed via Github Actions as follows:

Theme Features

Plugins

The following plugins are forked from their original versions to support newer versions of WordPress and PHP. They are stored in the /plugins/ folder:

LWTV Plugin (/plugins/lwtv-plugin/)

Formerly hosted as it's own, separate, plugin, it has been combined with the theme since everything is interconnected. For the plugin, we use Namespaces and auto-loading in order to properly generate and call new content dynamically.

Components

A component can be thought of as a sub-plugin. It is an atomic, independent module that stores business logic related to a specific feature. It may expose some template tags (functions) that can be called from within the theme.

All Components are stored in /plugins/lwtv-plugins/php/ and the details of their use in /plugins/lwtv-plugins/php/readme.md

Blocks

Development is fully documented in /plugins/lwtv-plugins/php/blocks/README.md

Features

The follow is a description of all the files in the code and more or less what they do.

In addition, on build there are two folders (/node_modules/ and /vendor/) which are used for building code and are not stored on Github.

Assets

Stored in /assets/

CSS (css)

Images (images)

Javascript (js)

The Code

Stored in /php/

_Components

All top-level components, stored in /php/_components/ - Many components have 'sub-components' stored in a folder of the same name. For example, class-queeries.php calls code stored in /php/queeries/ and so on. As long as the proper namespaces are applied, they will be autoloaded.

In addition there are interfaces uses by the classes:

_Helpers

Helper files are not used as 'code' per-sey but our code relies on them.

Admin Menu

Stored in /php/admin-menu/ -- Makes admin menu items

Blocks (aka Gutenberg)

Stored in /php/blocks/

Source (src)

Each block is broken up by folder with the following files:

Calendar

Stored in /php/calendar/:

Custom Post Types

Stored in /php/cpts/:

Actors (actors)

Characters (/characters/)

Shows (/shows/)

Debugger

Stored in /php/debugger/ -- a collection of all code used to debug and manage content.

Features

Stored in /php/features/ -- a collection of miscellaneous features.

Grading

Stored in /php/grading/ - code used to process show grades/scores

Of The Day

Stored in /php/of-the-day/ - code used to generate character and show of the day.

Plugin Addons

Stored in /php/plugins/ - all files are used to enhance other plugins installed on the site.

The file _main.php acts as an autoloader.

Queeries

Stored in /php/queeries/ - Custom arrays and WP_Query calls that are repeated in multiple places.

Rest API

Stored in /php/rest-api/ - These files generate the REST API output.

Alexa Skills (/php/rest-api/alexa/)

Templates (/php/rest-api/templates/)

Statistics

Stored in /php/statistics/ - These files generate everything for stats, from graphs to the rest API stuff.

Build (/php/statistics/build/)

Each file has a make() function which build an array that will be passed to the formatter code and output.

Formats (/php/statistics/formats)

Each file has a build() function which formats the arrays build in the build section (above) for proper display.

Templates (/php/statistics/templates/)

Templates used by the shortcodes and Gutenberg (as well as when included on the pages themselves).

Theme

Stored in /php/theme/ - Code used to generate data primarily for the theme in weird ways. Each class file has a make() function that generates the output. Some have sub-sets.

This Year

Stored in /php/this-year/ - Technically a subset of statistics, This Year shows you just the data for the indicated year.

Build (/php/this-year/build/)

Each file has a make() function which build an array that will be passed to the formatter code and output.

Formats (/php/this-year/formats)

Each file has a make() function which formats the arrays build in the BUILD section (above) for proper display.

Validator

Stored in /php/validator/ -- Called by /php/admin-menu/class-validation.php

WP-CLI

Stored in /wp-cli/ -- All code for WP-CLI

Developer Features

The following folders/files are for use by Developers. They are not pushed to the dev nor production servers.