From 573dcbf799d764d7bf99bb99289a1c3a590d637b Mon Sep 17 00:00:00 2001 From: Adam Piontek Date: Thu, 8 Jul 2021 19:19:22 -0400 Subject: [PATCH] improvements including syntax highlighting by server-side plugin --- README.md | 13 +++++ .../DF185CEE29A3D443_public_key.asc | 0 .../android-chrome-192x192.png | Bin .../android-chrome-512x512.png | Bin .../{cp-to-root => _root}/browserconfig.xml | 0 assets/{cp-to-root => _root}/favicon.ico | Bin assets/{cp-to-root => _root}/keybase.txt | 0 .../{cp-to-root => _root}/mstile-150x150.png | Bin assets/{cp-to-root => _root}/qpalpha.jpg | Bin assets/{cp-to-root => _root}/robots.txt | 0 .../{cp-to-root => _root}/thatsjotuncock.gif | Bin assets/{cp-to-root => _root}/vpalpha.jpg | Bin assets/css/_bs-colors.scss | 1 + assets/css/app.scss | 45 +++++++++++++++--- src/classes.php | 3 +- webpack.config.js | 2 +- 16 files changed, 55 insertions(+), 9 deletions(-) rename assets/{cp-to-root => _root}/DF185CEE29A3D443_public_key.asc (100%) rename assets/{cp-to-root => _root}/android-chrome-192x192.png (100%) rename assets/{cp-to-root => _root}/android-chrome-512x512.png (100%) rename assets/{cp-to-root => _root}/browserconfig.xml (100%) rename assets/{cp-to-root => _root}/favicon.ico (100%) rename assets/{cp-to-root => _root}/keybase.txt (100%) rename assets/{cp-to-root => _root}/mstile-150x150.png (100%) rename assets/{cp-to-root => _root}/qpalpha.jpg (100%) rename assets/{cp-to-root => _root}/robots.txt (100%) rename assets/{cp-to-root => _root}/thatsjotuncock.gif (100%) rename assets/{cp-to-root => _root}/vpalpha.jpg (100%) diff --git a/README.md b/README.md index f40681f..2dde5e0 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,19 @@ NODE_ENV=development node --trace-deprecation node_modules/webpack/bin/webpack.j NODE_ENV=production node --trace-deprecation node_modules/webpack/bin/webpack.js ``` +## Static Files via nginx + +Static files under `assets/_root` should be served by nginx with location config like so: + +```conf +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 ```bash npm run build diff --git a/assets/cp-to-root/DF185CEE29A3D443_public_key.asc b/assets/_root/DF185CEE29A3D443_public_key.asc similarity index 100% rename from assets/cp-to-root/DF185CEE29A3D443_public_key.asc rename to assets/_root/DF185CEE29A3D443_public_key.asc diff --git a/assets/cp-to-root/android-chrome-192x192.png b/assets/_root/android-chrome-192x192.png similarity index 100% rename from assets/cp-to-root/android-chrome-192x192.png rename to assets/_root/android-chrome-192x192.png diff --git a/assets/cp-to-root/android-chrome-512x512.png b/assets/_root/android-chrome-512x512.png similarity index 100% rename from assets/cp-to-root/android-chrome-512x512.png rename to assets/_root/android-chrome-512x512.png diff --git a/assets/cp-to-root/browserconfig.xml b/assets/_root/browserconfig.xml similarity index 100% rename from assets/cp-to-root/browserconfig.xml rename to assets/_root/browserconfig.xml diff --git a/assets/cp-to-root/favicon.ico b/assets/_root/favicon.ico similarity index 100% rename from assets/cp-to-root/favicon.ico rename to assets/_root/favicon.ico diff --git a/assets/cp-to-root/keybase.txt b/assets/_root/keybase.txt similarity index 100% rename from assets/cp-to-root/keybase.txt rename to assets/_root/keybase.txt diff --git a/assets/cp-to-root/mstile-150x150.png b/assets/_root/mstile-150x150.png similarity index 100% rename from assets/cp-to-root/mstile-150x150.png rename to assets/_root/mstile-150x150.png diff --git a/assets/cp-to-root/qpalpha.jpg b/assets/_root/qpalpha.jpg similarity index 100% rename from assets/cp-to-root/qpalpha.jpg rename to assets/_root/qpalpha.jpg diff --git a/assets/cp-to-root/robots.txt b/assets/_root/robots.txt similarity index 100% rename from assets/cp-to-root/robots.txt rename to assets/_root/robots.txt diff --git a/assets/cp-to-root/thatsjotuncock.gif b/assets/_root/thatsjotuncock.gif similarity index 100% rename from assets/cp-to-root/thatsjotuncock.gif rename to assets/_root/thatsjotuncock.gif diff --git a/assets/cp-to-root/vpalpha.jpg b/assets/_root/vpalpha.jpg similarity index 100% rename from assets/cp-to-root/vpalpha.jpg rename to assets/_root/vpalpha.jpg diff --git a/assets/css/_bs-colors.scss b/assets/css/_bs-colors.scss index 61bff40..0e360c7 100644 --- a/assets/css/_bs-colors.scss +++ b/assets/css/_bs-colors.scss @@ -13,6 +13,7 @@ $gray-400: #9c9c9c; $gray-500: #828282; $gray-600: #696969; $gray-700: #4f4f4f; +$gray-750: #404040; $gray-800: #363636; $gray-900: #242424; $black: #000; diff --git a/assets/css/app.scss b/assets/css/app.scss index e4e3cb5..fb69fc3 100644 --- a/assets/css/app.scss +++ b/assets/css/app.scss @@ -13,17 +13,31 @@ /* Navbar custom styling */ @import "nav-bar-help"; - -/* code & syntax highlighting */ +/* + * Code syntax highlighting + * Actual highlighting is done by plugin + * "Syntax-highlighting Code Block (with Server-side Rendering)" + * url: https://wordpress.org/plugins/syntax-highlighting-code-block/ + * + * highlighting style is set in classes.php by adding filter to + * 'syntax_highlighting_code_block_style' + */ pre, code, .font-monospace { font-family: $font-family-monospace; font-weight: 300; font-size: 15px; } code.hljs { - padding: 0.75rem 1rem; + padding: 0.4rem 0.75rem; border-radius: .5em; - background-color: #1c1c1c; +// background-color: #1c1c1c; +} +p code { + background-color: #2d2d2d;; + color: #e2e4e5; + padding: .1em .4em; + border-radius: .25em; + display: inline; } /* main */ @@ -108,7 +122,11 @@ a { padding-top: 2px; padding-bottom: 2px; } -.mt--05r { +.tek-subtitle { + @extend .fs-5; + @extend .font-monospace; + @extend .text-gray-300; + @extend .mb-3; margin-top: -0.5rem; } @@ -130,19 +148,32 @@ blockquote { @extend .ms-0; @extend .my-4; @extend .ps-3; + @extend .py-2; + background-color: $gray-750; + &.tek-bq-lg { + p { + font-size: 1.375rem; + } + } p { @extend .blockquote; + font-size: 1em; &:last-of-type { - margin-bottom: -0.25rem !important; + @extend .my-0; + @extend .py-0; } } cite { @extend .blockquote-footer; @extend .text-gray-300; - @extend .mb-0; + @extend .my-0; + @extend .py-0; font-size: 0.85em; font-style: normal; } + :last-child { + @extend .py-1; + } } } diff --git a/src/classes.php b/src/classes.php index afa24bc..0a35c63 100644 --- a/src/classes.php +++ b/src/classes.php @@ -72,6 +72,7 @@ add_filter( 'wp_nav_menu_objects', function($items, $args) { add_filter( 'syntax_highlighting_code_block_style', function() { - return 'tomorrow-night-eighties'; + // return 'tomorrow-night-eighties'; + return 'tomorrow-night'; } ); \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index 4074919..6b5db00 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -180,7 +180,7 @@ function getCSSWhitelistPatterns() { /^(.*)?-?paged(-.*)?$/, /^depth(-.*)?$/, /^children(-.*)?$/, - /^mt--(.*)?$/, + /^tek(-.*)?$/, ]; }