From aaf54e1466cc4447e916902768ac1be77ac96687 Mon Sep 17 00:00:00 2001 From: JC Date: Tue, 5 Sep 2023 03:52:34 +0800 Subject: [PATCH 1/6] WDSUS-43 - Change src to assets --- {src => assets}/critical.js | 0 {src => assets}/fonts/inter/Inter-Black.woff2 | Bin {src => assets}/fonts/inter/Inter-Bold.woff2 | Bin {src => assets}/fonts/inter/Inter-Light.woff2 | Bin {src => assets}/fonts/inter/Inter-Regular.woff2 | Bin {src => assets}/fonts/inter/LICENSE.txt | 0 {src => assets}/fonts/oxygen/OFL.txt | 0 .../fonts/oxygen/oxygen-v15-latin-300.woff2 | Bin .../fonts/oxygen/oxygen-v15-latin-700.woff2 | Bin .../fonts/oxygen/oxygen-v15-latin-regular.woff2 | Bin {src => assets}/images/icons/caret-down.svg | 0 {src => assets}/images/icons/close.svg | 0 {src => assets}/images/icons/facebook-square.svg | 0 {src => assets}/images/icons/hamburger.svg | 0 {src => assets}/images/icons/instagram-square.svg | 0 {src => assets}/images/icons/linkedin-square.svg | 0 {src => assets}/images/icons/pause.svg | 0 {src => assets}/images/icons/play.svg | 0 {src => assets}/images/icons/twitter-square.svg | 0 {src => assets}/images/placeholder.png | Bin {src => assets}/index.js | 0 {src => assets}/js/blocks/custom/.gitkeep | 0 {src => assets}/js/blocks/index.js | 0 {src => assets}/js/global/index.js | 0 {src => assets}/js/global/js-enabled.js | 0 {src => assets}/js/global/window-ready.js | 0 {src => assets}/js/index.js | 0 {src => assets}/js/template-tags/index.js | 0 {src => assets}/js/template-tags/mobile-menu.js | 0 {src => assets}/js/template-tags/modal.js | 0 .../js/template-tags/navigation-primary.js | 0 {src => assets}/js/template-tags/off-canvas.js | 0 {src => assets}/js/template-tags/table.js | 0 {src => assets}/js/template-tags/video.js | 0 {src => assets}/js/templates/index.js | 0 {src => assets}/scss/blocks/core/index.scss | 0 {src => assets}/scss/blocks/custom/.gitkeep | 0 {src => assets}/scss/blocks/custom/index.scss | 0 {src => assets}/scss/blocks/index.scss | 0 {src => assets}/scss/critical.scss | 0 {src => assets}/scss/critical/_footer.scss | 0 {src => assets}/scss/critical/_header.scss | 0 {src => assets}/scss/critical/_menus.scss | 0 {src => assets}/scss/critical/index.scss | 0 {src => assets}/scss/global/_editor.scss | 0 {src => assets}/scss/global/_global.scss | 0 {src => assets}/scss/global/index.scss | 0 {src => assets}/scss/index.scss | 0 {src => assets}/scss/tailwind.scss | 0 {src => assets}/scss/template-tags/index.scss | 0 {src => assets}/scss/templates/index.scss | 0 {src => assets}/tailwind-preflight.css | 0 52 files changed, 0 insertions(+), 0 deletions(-) rename {src => assets}/critical.js (100%) rename {src => assets}/fonts/inter/Inter-Black.woff2 (100%) rename {src => assets}/fonts/inter/Inter-Bold.woff2 (100%) rename {src => assets}/fonts/inter/Inter-Light.woff2 (100%) rename {src => assets}/fonts/inter/Inter-Regular.woff2 (100%) rename {src => assets}/fonts/inter/LICENSE.txt (100%) rename {src => assets}/fonts/oxygen/OFL.txt (100%) rename {src => assets}/fonts/oxygen/oxygen-v15-latin-300.woff2 (100%) rename {src => assets}/fonts/oxygen/oxygen-v15-latin-700.woff2 (100%) rename {src => assets}/fonts/oxygen/oxygen-v15-latin-regular.woff2 (100%) rename {src => assets}/images/icons/caret-down.svg (100%) rename {src => assets}/images/icons/close.svg (100%) rename {src => assets}/images/icons/facebook-square.svg (100%) rename {src => assets}/images/icons/hamburger.svg (100%) rename {src => assets}/images/icons/instagram-square.svg (100%) rename {src => assets}/images/icons/linkedin-square.svg (100%) rename {src => assets}/images/icons/pause.svg (100%) rename {src => assets}/images/icons/play.svg (100%) rename {src => assets}/images/icons/twitter-square.svg (100%) rename {src => assets}/images/placeholder.png (100%) rename {src => assets}/index.js (100%) rename {src => assets}/js/blocks/custom/.gitkeep (100%) rename {src => assets}/js/blocks/index.js (100%) rename {src => assets}/js/global/index.js (100%) rename {src => assets}/js/global/js-enabled.js (100%) rename {src => assets}/js/global/window-ready.js (100%) rename {src => assets}/js/index.js (100%) rename {src => assets}/js/template-tags/index.js (100%) rename {src => assets}/js/template-tags/mobile-menu.js (100%) rename {src => assets}/js/template-tags/modal.js (100%) rename {src => assets}/js/template-tags/navigation-primary.js (100%) rename {src => assets}/js/template-tags/off-canvas.js (100%) rename {src => assets}/js/template-tags/table.js (100%) rename {src => assets}/js/template-tags/video.js (100%) rename {src => assets}/js/templates/index.js (100%) rename {src => assets}/scss/blocks/core/index.scss (100%) rename {src => assets}/scss/blocks/custom/.gitkeep (100%) rename {src => assets}/scss/blocks/custom/index.scss (100%) rename {src => assets}/scss/blocks/index.scss (100%) rename {src => assets}/scss/critical.scss (100%) rename {src => assets}/scss/critical/_footer.scss (100%) rename {src => assets}/scss/critical/_header.scss (100%) rename {src => assets}/scss/critical/_menus.scss (100%) rename {src => assets}/scss/critical/index.scss (100%) rename {src => assets}/scss/global/_editor.scss (100%) rename {src => assets}/scss/global/_global.scss (100%) rename {src => assets}/scss/global/index.scss (100%) rename {src => assets}/scss/index.scss (100%) rename {src => assets}/scss/tailwind.scss (100%) rename {src => assets}/scss/template-tags/index.scss (100%) rename {src => assets}/scss/templates/index.scss (100%) rename {src => assets}/tailwind-preflight.css (100%) diff --git a/src/critical.js b/assets/critical.js similarity index 100% rename from src/critical.js rename to assets/critical.js diff --git a/src/fonts/inter/Inter-Black.woff2 b/assets/fonts/inter/Inter-Black.woff2 similarity index 100% rename from src/fonts/inter/Inter-Black.woff2 rename to assets/fonts/inter/Inter-Black.woff2 diff --git a/src/fonts/inter/Inter-Bold.woff2 b/assets/fonts/inter/Inter-Bold.woff2 similarity index 100% rename from src/fonts/inter/Inter-Bold.woff2 rename to assets/fonts/inter/Inter-Bold.woff2 diff --git a/src/fonts/inter/Inter-Light.woff2 b/assets/fonts/inter/Inter-Light.woff2 similarity index 100% rename from src/fonts/inter/Inter-Light.woff2 rename to assets/fonts/inter/Inter-Light.woff2 diff --git a/src/fonts/inter/Inter-Regular.woff2 b/assets/fonts/inter/Inter-Regular.woff2 similarity index 100% rename from src/fonts/inter/Inter-Regular.woff2 rename to assets/fonts/inter/Inter-Regular.woff2 diff --git a/src/fonts/inter/LICENSE.txt b/assets/fonts/inter/LICENSE.txt similarity index 100% rename from src/fonts/inter/LICENSE.txt rename to assets/fonts/inter/LICENSE.txt diff --git a/src/fonts/oxygen/OFL.txt b/assets/fonts/oxygen/OFL.txt similarity index 100% rename from src/fonts/oxygen/OFL.txt rename to assets/fonts/oxygen/OFL.txt diff --git a/src/fonts/oxygen/oxygen-v15-latin-300.woff2 b/assets/fonts/oxygen/oxygen-v15-latin-300.woff2 similarity index 100% rename from src/fonts/oxygen/oxygen-v15-latin-300.woff2 rename to assets/fonts/oxygen/oxygen-v15-latin-300.woff2 diff --git a/src/fonts/oxygen/oxygen-v15-latin-700.woff2 b/assets/fonts/oxygen/oxygen-v15-latin-700.woff2 similarity index 100% rename from src/fonts/oxygen/oxygen-v15-latin-700.woff2 rename to assets/fonts/oxygen/oxygen-v15-latin-700.woff2 diff --git a/src/fonts/oxygen/oxygen-v15-latin-regular.woff2 b/assets/fonts/oxygen/oxygen-v15-latin-regular.woff2 similarity index 100% rename from src/fonts/oxygen/oxygen-v15-latin-regular.woff2 rename to assets/fonts/oxygen/oxygen-v15-latin-regular.woff2 diff --git a/src/images/icons/caret-down.svg b/assets/images/icons/caret-down.svg similarity index 100% rename from src/images/icons/caret-down.svg rename to assets/images/icons/caret-down.svg diff --git a/src/images/icons/close.svg b/assets/images/icons/close.svg similarity index 100% rename from src/images/icons/close.svg rename to assets/images/icons/close.svg diff --git a/src/images/icons/facebook-square.svg b/assets/images/icons/facebook-square.svg similarity index 100% rename from src/images/icons/facebook-square.svg rename to assets/images/icons/facebook-square.svg diff --git a/src/images/icons/hamburger.svg b/assets/images/icons/hamburger.svg similarity index 100% rename from src/images/icons/hamburger.svg rename to assets/images/icons/hamburger.svg diff --git a/src/images/icons/instagram-square.svg b/assets/images/icons/instagram-square.svg similarity index 100% rename from src/images/icons/instagram-square.svg rename to assets/images/icons/instagram-square.svg diff --git a/src/images/icons/linkedin-square.svg b/assets/images/icons/linkedin-square.svg similarity index 100% rename from src/images/icons/linkedin-square.svg rename to assets/images/icons/linkedin-square.svg diff --git a/src/images/icons/pause.svg b/assets/images/icons/pause.svg similarity index 100% rename from src/images/icons/pause.svg rename to assets/images/icons/pause.svg diff --git a/src/images/icons/play.svg b/assets/images/icons/play.svg similarity index 100% rename from src/images/icons/play.svg rename to assets/images/icons/play.svg diff --git a/src/images/icons/twitter-square.svg b/assets/images/icons/twitter-square.svg similarity index 100% rename from src/images/icons/twitter-square.svg rename to assets/images/icons/twitter-square.svg diff --git a/src/images/placeholder.png b/assets/images/placeholder.png similarity index 100% rename from src/images/placeholder.png rename to assets/images/placeholder.png diff --git a/src/index.js b/assets/index.js similarity index 100% rename from src/index.js rename to assets/index.js diff --git a/src/js/blocks/custom/.gitkeep b/assets/js/blocks/custom/.gitkeep similarity index 100% rename from src/js/blocks/custom/.gitkeep rename to assets/js/blocks/custom/.gitkeep diff --git a/src/js/blocks/index.js b/assets/js/blocks/index.js similarity index 100% rename from src/js/blocks/index.js rename to assets/js/blocks/index.js diff --git a/src/js/global/index.js b/assets/js/global/index.js similarity index 100% rename from src/js/global/index.js rename to assets/js/global/index.js diff --git a/src/js/global/js-enabled.js b/assets/js/global/js-enabled.js similarity index 100% rename from src/js/global/js-enabled.js rename to assets/js/global/js-enabled.js diff --git a/src/js/global/window-ready.js b/assets/js/global/window-ready.js similarity index 100% rename from src/js/global/window-ready.js rename to assets/js/global/window-ready.js diff --git a/src/js/index.js b/assets/js/index.js similarity index 100% rename from src/js/index.js rename to assets/js/index.js diff --git a/src/js/template-tags/index.js b/assets/js/template-tags/index.js similarity index 100% rename from src/js/template-tags/index.js rename to assets/js/template-tags/index.js diff --git a/src/js/template-tags/mobile-menu.js b/assets/js/template-tags/mobile-menu.js similarity index 100% rename from src/js/template-tags/mobile-menu.js rename to assets/js/template-tags/mobile-menu.js diff --git a/src/js/template-tags/modal.js b/assets/js/template-tags/modal.js similarity index 100% rename from src/js/template-tags/modal.js rename to assets/js/template-tags/modal.js diff --git a/src/js/template-tags/navigation-primary.js b/assets/js/template-tags/navigation-primary.js similarity index 100% rename from src/js/template-tags/navigation-primary.js rename to assets/js/template-tags/navigation-primary.js diff --git a/src/js/template-tags/off-canvas.js b/assets/js/template-tags/off-canvas.js similarity index 100% rename from src/js/template-tags/off-canvas.js rename to assets/js/template-tags/off-canvas.js diff --git a/src/js/template-tags/table.js b/assets/js/template-tags/table.js similarity index 100% rename from src/js/template-tags/table.js rename to assets/js/template-tags/table.js diff --git a/src/js/template-tags/video.js b/assets/js/template-tags/video.js similarity index 100% rename from src/js/template-tags/video.js rename to assets/js/template-tags/video.js diff --git a/src/js/templates/index.js b/assets/js/templates/index.js similarity index 100% rename from src/js/templates/index.js rename to assets/js/templates/index.js diff --git a/src/scss/blocks/core/index.scss b/assets/scss/blocks/core/index.scss similarity index 100% rename from src/scss/blocks/core/index.scss rename to assets/scss/blocks/core/index.scss diff --git a/src/scss/blocks/custom/.gitkeep b/assets/scss/blocks/custom/.gitkeep similarity index 100% rename from src/scss/blocks/custom/.gitkeep rename to assets/scss/blocks/custom/.gitkeep diff --git a/src/scss/blocks/custom/index.scss b/assets/scss/blocks/custom/index.scss similarity index 100% rename from src/scss/blocks/custom/index.scss rename to assets/scss/blocks/custom/index.scss diff --git a/src/scss/blocks/index.scss b/assets/scss/blocks/index.scss similarity index 100% rename from src/scss/blocks/index.scss rename to assets/scss/blocks/index.scss diff --git a/src/scss/critical.scss b/assets/scss/critical.scss similarity index 100% rename from src/scss/critical.scss rename to assets/scss/critical.scss diff --git a/src/scss/critical/_footer.scss b/assets/scss/critical/_footer.scss similarity index 100% rename from src/scss/critical/_footer.scss rename to assets/scss/critical/_footer.scss diff --git a/src/scss/critical/_header.scss b/assets/scss/critical/_header.scss similarity index 100% rename from src/scss/critical/_header.scss rename to assets/scss/critical/_header.scss diff --git a/src/scss/critical/_menus.scss b/assets/scss/critical/_menus.scss similarity index 100% rename from src/scss/critical/_menus.scss rename to assets/scss/critical/_menus.scss diff --git a/src/scss/critical/index.scss b/assets/scss/critical/index.scss similarity index 100% rename from src/scss/critical/index.scss rename to assets/scss/critical/index.scss diff --git a/src/scss/global/_editor.scss b/assets/scss/global/_editor.scss similarity index 100% rename from src/scss/global/_editor.scss rename to assets/scss/global/_editor.scss diff --git a/src/scss/global/_global.scss b/assets/scss/global/_global.scss similarity index 100% rename from src/scss/global/_global.scss rename to assets/scss/global/_global.scss diff --git a/src/scss/global/index.scss b/assets/scss/global/index.scss similarity index 100% rename from src/scss/global/index.scss rename to assets/scss/global/index.scss diff --git a/src/scss/index.scss b/assets/scss/index.scss similarity index 100% rename from src/scss/index.scss rename to assets/scss/index.scss diff --git a/src/scss/tailwind.scss b/assets/scss/tailwind.scss similarity index 100% rename from src/scss/tailwind.scss rename to assets/scss/tailwind.scss diff --git a/src/scss/template-tags/index.scss b/assets/scss/template-tags/index.scss similarity index 100% rename from src/scss/template-tags/index.scss rename to assets/scss/template-tags/index.scss diff --git a/src/scss/templates/index.scss b/assets/scss/templates/index.scss similarity index 100% rename from src/scss/templates/index.scss rename to assets/scss/templates/index.scss diff --git a/src/tailwind-preflight.css b/assets/tailwind-preflight.css similarity index 100% rename from src/tailwind-preflight.css rename to assets/tailwind-preflight.css From 4f68c017e5bebb52cd9678d4610ab51bd26a54b6 Mon Sep 17 00:00:00 2001 From: JC Date: Tue, 5 Sep 2023 04:03:33 +0800 Subject: [PATCH 2/6] WDSUS-43 - Update files to use assets folder instead of src --- composer.lock | 38 ++++++++++++++--------------- inc/setup/scripts.php | 2 +- inc/wpcli/class-blocks-scaffold.php | 8 +++--- tailwind.config.js | 2 +- theme.json | 14 +++++------ webpack.config.js | 15 +++++++----- 6 files changed, 41 insertions(+), 38 deletions(-) diff --git a/composer.lock b/composer.lock index 5a856ba74..e458cb40b 100644 --- a/composer.lock +++ b/composer.lock @@ -155,16 +155,16 @@ "packages-dev": [ { "name": "composer/ca-bundle", - "version": "1.3.6", + "version": "1.3.7", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "90d087e988ff194065333d16bc5cf649872d9cdb" + "reference": "76e46335014860eec1aa5a724799a00a2e47cc85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/90d087e988ff194065333d16bc5cf649872d9cdb", - "reference": "90d087e988ff194065333d16bc5cf649872d9cdb", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/76e46335014860eec1aa5a724799a00a2e47cc85", + "reference": "76e46335014860eec1aa5a724799a00a2e47cc85", "shasum": "" }, "require": { @@ -211,7 +211,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.3.6" + "source": "https://github.com/composer/ca-bundle/tree/1.3.7" }, "funding": [ { @@ -227,7 +227,7 @@ "type": "tidelift" } ], - "time": "2023-06-06T12:02:59+00:00" + "time": "2023-08-30T09:31:38+00:00" }, { "name": "composer/composer", @@ -470,16 +470,16 @@ }, { "name": "composer/semver", - "version": "3.3.2", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9" + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9", + "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", "shasum": "" }, "require": { @@ -529,9 +529,9 @@ "versioning" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.3.2" + "source": "https://github.com/composer/semver/tree/3.4.0" }, "funding": [ { @@ -547,7 +547,7 @@ "type": "tidelift" } ], - "time": "2022-04-01T19:23:25+00:00" + "time": "2023-08-31T09:50:34+00:00" }, { "name": "composer/spdx-licenses", @@ -4005,16 +4005,16 @@ }, { "name": "wp-cli/media-command", - "version": "v2.0.18", + "version": "v2.0.19", "source": { "type": "git", "url": "https://github.com/wp-cli/media-command.git", - "reference": "92fc32580a16a70ccc028786896d22f6ca51a261" + "reference": "3d167f43b019a13738f4e082c3c33f8f9ea82bbb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/media-command/zipball/92fc32580a16a70ccc028786896d22f6ca51a261", - "reference": "92fc32580a16a70ccc028786896d22f6ca51a261", + "url": "https://api.github.com/repos/wp-cli/media-command/zipball/3d167f43b019a13738f4e082c3c33f8f9ea82bbb", + "reference": "3d167f43b019a13738f4e082c3c33f8f9ea82bbb", "shasum": "" }, "require": { @@ -4061,9 +4061,9 @@ "homepage": "https://github.com/wp-cli/media-command", "support": { "issues": "https://github.com/wp-cli/media-command/issues", - "source": "https://github.com/wp-cli/media-command/tree/v2.0.18" + "source": "https://github.com/wp-cli/media-command/tree/v2.0.19" }, - "time": "2023-07-13T14:04:45+00:00" + "time": "2023-08-30T11:14:00+00:00" }, { "name": "wp-cli/mustangostang-spyc", diff --git a/inc/setup/scripts.php b/inc/setup/scripts.php index c26c08be8..e21a9279c 100644 --- a/inc/setup/scripts.php +++ b/inc/setup/scripts.php @@ -26,7 +26,7 @@ function scripts() { // Register styles & scripts. wp_enqueue_style( 'wd_s-styles', get_stylesheet_directory_uri() . '/build/index.css', [], $asset_file['version'] ); - wp_enqueue_style( 'custom-preflight', get_stylesheet_directory_uri() . '/src/tailwind-preflight.css', [], $asset_file['version'] ); + wp_enqueue_style( 'custom-preflight', get_stylesheet_directory_uri() . '/assets/tailwind-preflight.css', [], $asset_file['version'] ); wp_enqueue_script( 'wd_s-scripts', get_stylesheet_directory_uri() . '/build/index.js', $asset_file['dependencies'], $asset_file['version'], true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { diff --git a/inc/wpcli/class-blocks-scaffold.php b/inc/wpcli/class-blocks-scaffold.php index d29a9fcb1..6924dda30 100644 --- a/inc/wpcli/class-blocks-scaffold.php +++ b/inc/wpcli/class-blocks-scaffold.php @@ -228,14 +228,14 @@ private function create_block_editor_assets() { } // copy styles. - if ( ! $this->init_filesystem()->copy( $asset_scss, ROOT_PATH . 'src/scss/blocks/custom/' . $this->name . '.editor.scss' ) ) { + if ( ! $this->init_filesystem()->copy( $asset_scss, ROOT_PATH . 'assets/scss/blocks/custom/' . $this->name . '.editor.scss' ) ) { WP_CLI::error( 'ERROR :: Could not create styles file.', true ); } // add js file for build process. if ( ! $this->init_filesystem()->put_contents( - ROOT_PATH . 'src/js/blocks/custom/' . $this->name . '.editor.js', + ROOT_PATH . 'assets/js/blocks/custom/' . $this->name . '.editor.js', "import '../../../scss/blocks/custom/" . $this->name . ".editor.scss';\n" ) ) { @@ -274,14 +274,14 @@ private function create_block_assets() { } // copy styles. - if ( ! $this->init_filesystem()->copy( $asset_scss, ROOT_PATH . 'src/scss/blocks/custom/' . $this->name . '.scss' ) ) { + if ( ! $this->init_filesystem()->copy( $asset_scss, ROOT_PATH . 'assets/scss/blocks/custom/' . $this->name . '.scss' ) ) { WP_CLI::error( 'ERROR :: Could not create styles file.', true ); } // add js file for build process. if ( ! $this->init_filesystem()->put_contents( - ROOT_PATH . 'src/js/blocks/custom/' . $this->name . '.js', + ROOT_PATH . 'assets/js/blocks/custom/' . $this->name . '.js', "import '../../../scss/blocks/custom/" . $this->name . ".scss';\n" ) ) { diff --git a/tailwind.config.js b/tailwind.config.js index c4b923048..b674b2399 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -7,7 +7,7 @@ const topLevelPhpFiles = glob.sync( './*.php' ), directoryFiles = [ './inc/*.php', './template-parts/*.php', - './src/js/**/*.js', + './assets/js/**/*.js', ]; const themeJsonPath = path.join( __dirname, 'theme.json' ); diff --git a/theme.json b/theme.json index 1f92987cf..69890747a 100644 --- a/theme.json +++ b/theme.json @@ -53,7 +53,7 @@ "fontStyle": "normal", "fontWeight": "300", "src": [ - "file:./src/fonts/inter/Inter-Light.woff2" + "file:./build/fonts/inter/Inter-Light.woff2" ] }, { @@ -61,7 +61,7 @@ "fontStyle": "normal", "fontWeight": "400", "src": [ - "file:./src/fonts/inter/Inter-Regular.woff2" + "file:./build/fonts/inter/Inter-Regular.woff2" ] }, { @@ -69,7 +69,7 @@ "fontStyle": "normal", "fontWeight": "700", "src": [ - "file:./src/fonts/inter/Inter-Bold.woff2" + "file:./build/fonts/inter/Inter-Bold.woff2" ] }, { @@ -77,7 +77,7 @@ "fontStyle": "normal", "fontWeight": "900", "src": [ - "file:./src/fonts/inter/Inter-Black.woff2" + "file:./build/fonts/inter/Inter-Black.woff2" ] } ] @@ -92,7 +92,7 @@ "fontStyle": "normal", "fontWeight": "300", "src": [ - "file:./src/fonts/oxygen/oxygen-v15-latin-300.woff2" + "file:./build/fonts/oxygen/oxygen-v15-latin-300.woff2" ] }, { @@ -100,7 +100,7 @@ "fontStyle": "normal", "fontWeight": "400", "src": [ - "file:./src/fonts/oxygen/oxygen-v15-latin-regular.woff2" + "file:./build/fonts/oxygen/oxygen-v15-latin-regular.woff2" ] }, { @@ -108,7 +108,7 @@ "fontStyle": "normal", "fontWeight": "900", "src": [ - "file:./src/fonts/oxygen/oxygen-v15-latin-700.woff2" + "file:./build/fonts/oxygen/oxygen-v15-latin-700.woff2" ] } ] diff --git a/webpack.config.js b/webpack.config.js index 1ae4c5e55..f2a27862f 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -15,8 +15,8 @@ const StylelintPlugin = require( 'stylelint-webpack-plugin' ); module.exports = { ...defaultConfig, entry: { - index: './src/index.js', - critical: './src/critical.js', + index: './assets/index.js', + critical: './assets/critical.js', }, module: { rules: [ @@ -67,19 +67,22 @@ module.exports = { { from: '**/*.{jpg,jpeg,png,gif,svg}', to: 'images/[path][name][ext]', - context: path.resolve( process.cwd(), 'src/images' ), + context: path.resolve( process.cwd(), 'assets/images' ), noErrorOnMissing: true, }, { from: '*.svg', to: 'images/icons/[name][ext]', - context: path.resolve( process.cwd(), 'src/images/icons' ), + context: path.resolve( + process.cwd(), + 'assets/images/icons' + ), noErrorOnMissing: true, }, { from: '**/*.{woff,woff2,eot,ttf,otf}', to: 'fonts/[path][name][ext]', - context: path.resolve( process.cwd(), 'src/fonts' ), + context: path.resolve( process.cwd(), 'assets/fonts' ), noErrorOnMissing: true, }, ], @@ -90,7 +93,7 @@ module.exports = { * * @see https://github.com/cascornelissen/svg-spritemap-webpack-plugin */ - new SVGSpritemapPlugin( 'src/images/icons/*.svg', { + new SVGSpritemapPlugin( 'assets/images/icons/*.svg', { output: { filename: 'images/icons/sprite.svg', }, From c085664b81bb52124dff7adce0aac6e919e8e404 Mon Sep 17 00:00:00 2001 From: JC Date: Tue, 5 Sep 2023 04:13:53 +0800 Subject: [PATCH 3/6] WDSUS-43 - Add patterns folder and sample cta pattern --- patterns/cta.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 patterns/cta.php diff --git a/patterns/cta.php b/patterns/cta.php new file mode 100644 index 000000000..97b8606e3 --- /dev/null +++ b/patterns/cta.php @@ -0,0 +1,26 @@ + + + +
+ +

+ + +

+ + +
+
+
+ +
+ From 9d0376354b5b33add0e1a78389279dccda00d957 Mon Sep 17 00:00:00 2001 From: JC Date: Tue, 5 Sep 2023 04:24:47 +0800 Subject: [PATCH 4/6] WDSUS-43 - Re-add footer text customizer --- footer.php | 11 +++++++++-- inc/template-tags/print-copyright-text.php | 22 ++++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 inc/template-tags/print-copyright-text.php diff --git a/footer.php b/footer.php index 182fbdf3d..815e0378d 100644 --- a/footer.php +++ b/footer.php @@ -9,13 +9,20 @@ * @package wd_s */ +use function WebDevStudios\wd_s\print_copyright_text; ?>
- -

+ ' . esc_html__( ' Copyright © ', 'wd_s' ) . esc_attr( gmdate( 'Y' ) ) . '

'; + endif; + ?>
diff --git a/inc/template-tags/print-copyright-text.php b/inc/template-tags/print-copyright-text.php new file mode 100644 index 000000000..eb3d38523 --- /dev/null +++ b/inc/template-tags/print-copyright-text.php @@ -0,0 +1,22 @@ + Date: Tue, 5 Sep 2023 04:37:56 +0800 Subject: [PATCH 5/6] WDSUS-43 - Remove unused customizer settings --- inc/customizer/assets/scripts/livepreview.js | 7 --- inc/customizer/customizer.php | 1 - inc/customizer/sections.php | 21 -------- inc/customizer/settings.php | 41 ---------------- inc/template-tags/print-mobile-menu.php | 51 -------------------- 5 files changed, 121 deletions(-) delete mode 100644 inc/template-tags/print-mobile-menu.php diff --git a/inc/customizer/assets/scripts/livepreview.js b/inc/customizer/assets/scripts/livepreview.js index c230b92a5..c6ec82637 100644 --- a/inc/customizer/assets/scripts/livepreview.js +++ b/inc/customizer/assets/scripts/livepreview.js @@ -42,13 +42,6 @@ } ); } ); - // Background image. - api( 'background_image', function ( value ) { - value.bind( function ( to ) { - $( 'body' ).toggleClass( 'custom-background-image', '' !== to ); - } ); - } ); - // Copyright text. api( 'wd_s_copyright_text', function ( value ) { value.bind( function ( to ) { diff --git a/inc/customizer/customizer.php b/inc/customizer/customizer.php index 93f2822c8..54a67896a 100644 --- a/inc/customizer/customizer.php +++ b/inc/customizer/customizer.php @@ -88,7 +88,6 @@ function live_preview_support( $wp_customize ) { 'blogname', 'blogdescription', 'header_textcolor', - 'background_image', 'wd_s_copyright_text', ]; diff --git a/inc/customizer/sections.php b/inc/customizer/sections.php index 660252d7e..8e101b101 100644 --- a/inc/customizer/sections.php +++ b/inc/customizer/sections.php @@ -25,27 +25,6 @@ function customize_sections( $wp_customize ) { ] ); - // Register a social links section. - $wp_customize->add_section( - 'wd_s_social_links_section', - [ - 'title' => esc_html__( 'Social Media', 'wd_s' ), - 'description' => esc_html__( 'Links here power the print_social_network_links() template tag.', 'wd_s' ), - 'priority' => 90, - 'panel' => 'site-options', - ] - ); - - // Register a header section. - $wp_customize->add_section( - 'wd_s_header_section', - [ - 'title' => esc_html__( 'Header Customizations', 'wd_s' ), - 'priority' => 90, - 'panel' => 'site-options', - ] - ); - // Register a footer section. $wp_customize->add_section( 'wd_s_footer_section', diff --git a/inc/customizer/settings.php b/inc/customizer/settings.php index 74c0c9d66..67007d4ad 100644 --- a/inc/customizer/settings.php +++ b/inc/customizer/settings.php @@ -58,47 +58,6 @@ function customize_additional_scripts( $wp_customize ) { add_action( 'customize_register', __NAMESPACE__ . '\customize_additional_scripts' ); -/** - * Register a social icons setting. - * - * @author WebDevStudios - * - * @param WP_Customize_Manager $wp_customize Instance of WP_Customize_Manager. - */ -function customize_social_icons( $wp_customize ) { - // Create an array of our social links for ease of setup. - $social_networks = [ - 'facebook', - 'instagram', - 'twitter', - 'linkedin', - ]; - - // Loop through our networks to setup our fields. - foreach ( $social_networks as $network ) { - - // Register a setting. - $wp_customize->add_setting( - 'wd_s_' . $network . '_link', - [ - 'default' => '', - 'sanitize_callback' => 'esc_url', - ] - ); - - // Create the setting field. - $wp_customize->add_control( - 'wd_s_' . $network . '_link', - [ - 'label' => /* translators: the social network name. */ sprintf( esc_attr__( '%s URL', 'wd_s' ), ucwords( $network ) ), - 'section' => 'wd_s_social_links_section', - 'type' => 'text', - ] - ); - } -} - -add_action( 'customize_register', __NAMESPACE__ . '\customize_social_icons' ); /** * Register copyright text setting. diff --git a/inc/template-tags/print-mobile-menu.php b/inc/template-tags/print-mobile-menu.php deleted file mode 100644 index 375232eb3..000000000 --- a/inc/template-tags/print-mobile-menu.php +++ /dev/null @@ -1,51 +0,0 @@ - -
- - Date: Tue, 5 Sep 2023 04:44:10 +0800 Subject: [PATCH 6/6] WDSUS-43 - Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e2359534f..3c3403905 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ Install theme dependencies and trigger an initial build. >Note: You will need to have Composer 2 and NPM 9 installed first. ```bash -npm i +npm i && composer i ``` ### Development