A WordPress theme for 73k.us that utilizes Bootstrap 5, Webpack 5, MaterialDesignIcons via SVG sprite, + PurgeCSS.
Find a file
2021-07-11 13:52:25 -04:00
assets improving styling for search button 2021-07-10 23:03:48 -04:00
content-templates fixing article links for search results 2021-07-11 13:52:25 -04:00
page-templates initial commit, yay 2019-05-23 10:30:31 -06:00
src working: footer widgets, searchform, search results 2021-07-10 17:13:24 -04:00
.gitignore remove tracked vendor files 2019-10-24 21:06:55 -06:00
404.php 404 page working, fixed some purgecss issues 2021-07-10 19:30:03 -04:00
comments.php working: footer widgets, searchform, search results 2021-07-10 17:13:24 -04:00
composer.json add composer and update 2019-10-24 21:06:18 -06:00
composer.lock add composer and update 2019-10-24 21:06:18 -06:00
custom-functions.php rearranged social icon handling, implemented shortcodes, front-page now uses page content 2021-07-09 12:20:38 -04:00
custom-shortcodes.php rearranged social icon handling, implemented shortcodes, front-page now uses page content 2021-07-09 12:20:38 -04:00
footer.php working: footer widgets, searchform, search results 2021-07-10 17:13:24 -04:00
front-page.php fixed front page layout issues on mobile 2021-07-10 20:29:27 -04:00
functions.php rearranged social icon handling, implemented shortcodes, front-page now uses page content 2021-07-09 12:20:38 -04:00
header.php fixed front page layout issues on mobile 2021-07-10 20:29:27 -04:00
index.php working: footer widgets, searchform, search results 2021-07-10 17:13:24 -04:00
package-lock.json updated deps 2021-07-10 19:59:52 -04:00
package.json code highlighting improvements including inline code 2021-07-10 10:24:05 -04:00
page-resume.php Resume page working, many other small improvements 2021-07-09 15:43:11 -04:00
page.php Resume page working, many other small improvements 2021-07-09 15:43:11 -04:00
postcss.config.js replace tailwind with bootstrap: initial webpack config for development 2021-07-02 12:51:36 -04:00
README.md fixing forked references 2021-07-10 19:38:28 -04:00
screenshot.png adding screenshot thumbnail for dashboard theme list 2021-07-11 09:02:11 -04:00
search.php working: footer widgets, searchform, search results 2021-07-10 17:13:24 -04:00
searchform.php working: footer widgets, searchform, search results 2021-07-10 17:13:24 -04:00
socials.php Resume page working, many other small improvements 2021-07-09 15:43:11 -04:00
style.css fixing forked references 2021-07-10 19:38:28 -04:00
TODO.md fixed front page layout issues on mobile 2021-07-10 20:29:27 -04:00
webpack.config.js fixing purgecss element issues 2021-07-10 19:54:56 -04:00

73k WordPress Bootstrap 5/PurgeCSS Theme

The WordPress theme for 73k.us, based on Bootstrap 5 and PurgeCSS.

Requirements

How to get started

  1. Clone or download the project onto your themes directory (./wp-content/themes)
  2. Run a find/replace for the following strings:
  • wp-73k
  • WP_73k
  • wp_73k_
  1. Run composer install
  2. Run npm install
  3. Update the BrowserSyncPlugin configuration in webpack.config.js to the domain of your local installation.
  4. Run npm start to begin development server.

Webpack

The theme uses Webpack as its bundler with ES6 modules for JavaScript files. It also compresses images found in src automatically, and maps images to the appropriate destination through the @images alias. For example, @images/example.jpg would be compiled to ../images/example.jpg.

Hamburgers

The sass for the hamburgers package throws warnings unless fixed, so do this before first npm run attempts:

npm i -g sass-migrator
HBPATH="./node_modules/hamburgers/_sass/hamburgers/"
find ${HBPATH} -type f | while read f; do npx sass-migrator division -d ${f}; done
# if cleaning node_modules & dist:
rm -rf node_modules && rm -rf dist && npm i && HBPATH="./node_modules/hamburgers/_sass/hamburgers/"
find ${HBPATH} -type f | while read f; do npx sass-migrator division -d ${f}; done

Syntax Highlighting

This theme supports server-side syntax highlighting via the Syntax-highlighting Code Block plugin. In classes.php the plugin-provided styling is disabled, and the theme incorporates sass styling from the highlight.js node package, imported in _code-highlight.scss (to change the highlight style, change the import there).

However, the plugin doesn't support highlighting inline code, but I like that option, so the theme also incorporates highlight.js in main.js with a DOM Loaded action to highlight any code blocks tagged with the class to-highlight (must also have language-$LANG class) -- this should be done in WordPress in the editor, where you can edit a paragraph as HTML and add the classes (e.g. <code class="to-highlight language-python">).

Static Files via nginx

Static files under assets/_root should be served by nginx with location config like so:

location ~ /(robots.txt|favicon.ico|F185CEE29A3D443_public_key.asc|android-chrome-192x192.png|android-chrome-512x512.png|browserconfig.xml|keybase.txt|mstile-150x150.png|qpalpha.jpg|thatsjotuncock.gif|vpalpha.jpg) {
    root /var/www/dev1/wordpress-5.8-RC2/wp-content/themes/wp-73k/assets/_root/;
    allow all;
    log_not_found off;
    access_log off;
}

Deployment

npm run build

This will run both a production and development set of webpack tasks. The enqueue hook will load the correct version of the JS file, based on whether your development/staging server's SCRIPT_DEBUG constant is set to true.

Bootstrap

You can customize Bootstrap SCSS & JavaScript imports in the assets/css/app.scss and assets/js/main.js files.

PurgeCSS

WP 73k uses PurgeCSS to remove unused styles from the production build. It scans your project directory for strings that match SCSS declarations. You can modify the directories to search for in the webpack.config.js file. Always check your production build to make sure styles you were developing with compiled correctly.