Jarvis is a highly optimised theme, designed with sustainable principles in mind, using modern web development techniques.
I want Jarvis to be a lightweight theme. To do this I have:
- Removed images
- Used system fonts
- Minimised complex features like widgets, and nav
- Removed jQuery, and kept Javascript to an absolute minimum
If you wish to work on Jarvis you will need to have node and npm set up. You can then run npm install to get the required packages. Once setup you just have to run npm run dev in order to set up the watcher. Npm will then take care of everything for you.
- assets - Files that could be included on the site. Mostly Javascript and CSS. Includes a SASS directory which gets built from but does not get included in a built zip.
- gulp - Contains the code for the different gulp tasks used to generate the site.
- inc - Holds all of the PHP files that add functionality to the site. This includes functions and filters that can be called from the theme.
- parts - Template parts that can be included from theme files.
- templates - Individual page templates that can be selected from the post/ page editor.
npm run devWatch for css and script changes, and compile them when required.npm run buildCompile css, scripts, and then generate a zip file containing the theme ready for installation.
Jarvis uses Gulp to process files. You probably won't need to use it, but just in case the available tasks are:
gulp buildBuild all of the files, and generate a zip containing the most up to date version of the theme.gulp watchFilesWatch the development files for changes and build if required.gulp buildScriptsCombine and minify the theme javascript.gulp buildCustomizerPreviewCombine and minify the theme Customizer preview javascript.gulp buildCustomizerControlsCombine and minify the theme Customizer controls javascript.gulp buildStylesProcess the .scss files and generate the theme styles.gulp buildZipGenerate a release ready zip file containing the theme files only.gulp buildRTLGenerate the RTL.css file.gulp buildTOCGenerate Table of Contents for style.css file.gulp buildCriticalCreate critical path CSS styles.gulp buildSVGClean up exported svg files.gulp buildPotBuild the latest version of the .pot language file.