From 6d462c8f4ea86723b286c8c33f4c533bc91caa26 Mon Sep 17 00:00:00 2001 From: FredericoAndrade Date: Mon, 12 Aug 2024 15:04:13 +0200 Subject: [PATCH 01/11] update readme --- readme.md | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/readme.md b/readme.md index d4b9540c..3ce69ae8 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -# theme structure +# Theme Structure * primary functions are stored in functions.php * secondary/plug-in functions are stored in /includes @@ -7,20 +7,33 @@ * php files named by wp page/template type or module/element type with -- modifiers * ACF organized into groups by corresponding post type, page template, or global group, with post type or page template name as prefix -# php style guidelines +# PHP style guidelines * we use { } for continguous php and :/else:/endif; for PHP broken up by html * https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/ * in-line php lines up with previous html element (if statements) * line-breaks between php and in-line html -# Deployment -* This repository will automatically deploy changes to production when successfully merging to the `main` branch. +# Deployment Details + +* We follow Continuous Integration principles. +* We work with 4 primary environments: feature, Integration, Staging, and Production (branch name: Main) + * Feature: an independent, feature-scoped environment for developing new features. + * Integration: a pre-deployment environment to manage feature integration and catch merge conflicts independently from deployment. + * Staging: a deployed environment to safely test integrations on a live server without touching Production. + * Production: the public-facing environment on the live URL. +* Feature development is done in a feature branch. (Be sure to push feature branches to Github so others might test and review them) +* Once features are ready for integration, the first step is to merge the feature branch to `integration` locally + +## Automatic Deployment + +* This repository will automatically deploy changes to production when successfully merging to deployment branches. +* We use 2 deployment branches: `staging` and `main`. * `main` can only be edited by pull-requests from other branches. -# to-do +# To-Do -## code structure and styles +## Code structure and styles - [] later - simplify if statement syntax ( a ? b : c); e.g. `wp_nav_menu( array( 'theme_location' => is_user_logged_in() ? 'logged-in-menu' : 'logged-out-menu' From 598101fb1618692ee3f66c12bdbac41757f5917c Mon Sep 17 00:00:00 2001 From: FredericoAndrade Date: Mon, 12 Aug 2024 15:04:57 +0200 Subject: [PATCH 02/11] update prod deploy script to use prod branch --- .github/workflows/deploy-production.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml index d0c45734..e8757f61 100644 --- a/.github/workflows/deploy-production.yml +++ b/.github/workflows/deploy-production.yml @@ -3,7 +3,7 @@ name: Deploy to Production on: push: branches: - - main + - production env: REMOTE_DIR: ./public_html/wp-content/themes/blankslate-child From 5d05b15028cf838a893ece3106df29b12878b027 Mon Sep 17 00:00:00 2001 From: Frederico Andrade Date: Mon, 12 Aug 2024 15:11:21 +0200 Subject: [PATCH 03/11] Update readme.md --- readme.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/readme.md b/readme.md index 3ce69ae8..97250306 100644 --- a/readme.md +++ b/readme.md @@ -18,10 +18,10 @@ * We follow Continuous Integration principles. * We work with 4 primary environments: feature, Integration, Staging, and Production (branch name: Main) - * Feature: an independent, feature-scoped environment for developing new features. - * Integration: a pre-deployment environment to manage feature integration and catch merge conflicts independently from deployment. - * Staging: a deployed environment to safely test integrations on a live server without touching Production. - * Production: the public-facing environment on the live URL. + * Feature: an independent, feature-scoped environment for developing new features. + * Integration: a pre-deployment environment to manage feature integration and catch merge conflicts independently from deployment. + * Staging: a deployed environment to safely test integrations on a live server without touching Production. + * Production: the public-facing environment on the live URL. * Feature development is done in a feature branch. (Be sure to push feature branches to Github so others might test and review them) * Once features are ready for integration, the first step is to merge the feature branch to `integration` locally @@ -75,4 +75,4 @@ ## revitalization toolkit - [] toolkit newsletter propt - [] toolkit language prompt -- [] toolkit donate prompt \ No newline at end of file +- [] toolkit donate prompt From ddbfe73273b2f5c38e69b834dabcbbd04f7d7fcd Mon Sep 17 00:00:00 2001 From: Frederico Andrade Date: Mon, 12 Aug 2024 15:12:37 +0200 Subject: [PATCH 04/11] Update readme.md --- readme.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/readme.md b/readme.md index 97250306..b7efc602 100644 --- a/readme.md +++ b/readme.md @@ -17,18 +17,18 @@ # Deployment Details * We follow Continuous Integration principles. -* We work with 4 primary environments: feature, Integration, Staging, and Production (branch name: Main) - * Feature: an independent, feature-scoped environment for developing new features. - * Integration: a pre-deployment environment to manage feature integration and catch merge conflicts independently from deployment. - * Staging: a deployed environment to safely test integrations on a live server without touching Production. - * Production: the public-facing environment on the live URL. +* We work with 4 primary environments: feature, Main, Staging, and Production + * **Feature:** an independent, feature-scoped environment for developing new features. + * **Main:** a pre-deployment environment to manage feature integration and catch merge conflicts independently from deployment. + * **Staging:** a deployed environment to safely test integrations on a live server without touching Production. + * **Production:** the public-facing environment on the live URL. * Feature development is done in a feature branch. (Be sure to push feature branches to Github so others might test and review them) * Once features are ready for integration, the first step is to merge the feature branch to `integration` locally ## Automatic Deployment * This repository will automatically deploy changes to production when successfully merging to deployment branches. -* We use 2 deployment branches: `staging` and `main`. +* We use 2 deployment branches: `staging` and `production`. * `main` can only be edited by pull-requests from other branches. # To-Do From 8889a43f9c5a1140cc30ccaf62afdddc584c8229 Mon Sep 17 00:00:00 2001 From: FredericoAndrade Date: Wed, 10 Jul 2024 14:49:30 +0200 Subject: [PATCH 05/11] set up new search plugin --- acf-json/group_668bbbba9bae8.json | 165 ++++++++++++++++++++++++++++++ header.php | 6 +- readme.md | 24 +++++ stylus/main.css | 80 +++++++++++---- stylus/require/header.styl | 86 ++++++++++++---- 5 files changed, 317 insertions(+), 44 deletions(-) create mode 100644 acf-json/group_668bbbba9bae8.json diff --git a/acf-json/group_668bbbba9bae8.json b/acf-json/group_668bbbba9bae8.json new file mode 100644 index 00000000..b95ecf86 --- /dev/null +++ b/acf-json/group_668bbbba9bae8.json @@ -0,0 +1,165 @@ +{ + "key": "group_668bbbba9bae8", + "title": "Typeahead-Settings", + "fields": [ + { + "key": "field_668bbbbc1ad8d", + "label": "Airtable API Key", + "name": "airtable_api_key", + "aria-label": "", + "type": "text", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "maxlength": "", + "placeholder": "", + "prepend": "", + "append": "" + }, + { + "key": "field_668bbc2c1ad8e", + "label": "Airtable Base ID", + "name": "airtable_base_id", + "aria-label": "", + "type": "text", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "maxlength": "", + "placeholder": "", + "prepend": "", + "append": "" + }, + { + "key": "field_668bbc3a1ad8f", + "label": "Airtable Table Name", + "name": "airtable_table_name", + "aria-label": "", + "type": "text", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "maxlength": "", + "placeholder": "", + "prepend": "", + "append": "" + }, + { + "key": "field_668bbc461ad90", + "label": "Label Field ID", + "name": "airtable_label_field_id", + "aria-label": "", + "type": "text", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "maxlength": "", + "placeholder": "", + "prepend": "", + "append": "" + }, + { + "key": "field_668bbc511ad91", + "label": "Label Field Name", + "name": "airtable_label_field_name", + "aria-label": "", + "type": "text", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "maxlength": "", + "placeholder": "", + "prepend": "", + "append": "" + }, + { + "key": "field_668bbc5c1ad92", + "label": "Identifier Field", + "name": "airtable_identifier_field", + "aria-label": "", + "type": "text", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "maxlength": "", + "placeholder": "", + "prepend": "", + "append": "" + }, + { + "key": "field_668dc52476308", + "label": "Custom Class", + "name": "custom_class", + "aria-label": "", + "type": "text", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "maxlength": "", + "placeholder": "", + "prepend": "", + "append": "" + } + ], + "location": [ + [ + { + "param": "options_page", + "operator": "==", + "value": "acf-options" + } + ] + ], + "menu_order": 0, + "position": "normal", + "style": "default", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": "", + "active": true, + "description": "", + "show_in_rest": 0, + "modified": 1720567110 +} diff --git a/header.php b/header.php index cdba2fe8..22835e25 100644 --- a/header.php +++ b/header.php @@ -167,10 +167,8 @@ - - -
- [react_typeahead] +
+ [react_typeahead id="typeahead-nav" custom_class="nav-style" data_source="wordpress"]
- - - Date: Mon, 22 Jul 2024 11:41:17 +0200 Subject: [PATCH 10/11] cleanup styles --- js/custom.js | 7 +++---- stylus/main.css | 9 +++++++++ stylus/require/banner--searchbar.styl | 4 ++++ stylus/require/header.styl | 4 ++++ 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/js/custom.js b/js/custom.js index 3646e677..82254877 100644 --- a/js/custom.js +++ b/js/custom.js @@ -140,7 +140,7 @@ function setActiveLinks() { // Add active class to the archive nav item let archiveNavItem = document.querySelector('nav li'); if (archiveNavItem) { - archiveNavItem.classList.add('current_page_parent'); + archiveNavItem.classList.add('current_page_item'); } } } @@ -151,8 +151,7 @@ function toggleDarkOverlay() { darkBackground.id = "dark"; nav.appendChild(darkBackground); - const navItems = document.querySelectorAll(".menu-item"); - + const navItems = document.querySelectorAll(".wt_header__nav .menu-item"); function showDarkOverlay() { darkBackground.classList.add("visible"); } @@ -163,7 +162,7 @@ function toggleDarkOverlay() { navItems.forEach((item) => { item.addEventListener("mouseenter", function() { - if (!item.classList.contains("current_page_parent")) { + if (!item.classList.contains("current_page_item")) { showDarkOverlay(); } }); diff --git a/stylus/main.css b/stylus/main.css index b2aafc8b..57e6dffa 100644 --- a/stylus/main.css +++ b/stylus/main.css @@ -178,6 +178,8 @@ body.page-template-template-giving-campaign.logged-in[data-alert="true"] { .wt_header #typeahead-nav .typeahead-form .typeahead-list { width: 400px; border-radius: 8px; + outline: 2px solid #3814a5; + z-index: 3; } @media all and (max-width: 1024px) { .wt_header #typeahead-nav.react-typeahead-container { @@ -248,6 +250,10 @@ body.page-template-template-giving-campaign.logged-in[data-alert="true"] { padding: 0; z-index: 0; } +.wt_header__nav>ul>li.current_page_item, +.wt_header__nav>ul>li.current_page_parent { + pointer-events: none; +} .wt_header__nav>ul>li.current_page_item > a, .wt_header__nav>ul>li.current_page_parent > a { font-weight: bold; @@ -640,6 +646,9 @@ body.home .wt_banner { padding: 12px; font-size: 1.2em; } +body.search-results .wt_banner--searchbar { + min-height: initial; +} @media all and (max-width: 768px) { .wt_banner--searchbar #typeahead-archive { margin-left: 0; diff --git a/stylus/require/banner--searchbar.styl b/stylus/require/banner--searchbar.styl index 44ea7a1a..6bc3b3d3 100644 --- a/stylus/require/banner--searchbar.styl +++ b/stylus/require/banner--searchbar.styl @@ -32,6 +32,10 @@ border-radius 8px padding 12px font-size 1.2em + +body.search-results + .wt_banner--searchbar + min-height initial @media all and (max-width:$mobile) .wt_banner--searchbar diff --git a/stylus/require/header.styl b/stylus/require/header.styl index e9904a2c..73c786b8 100644 --- a/stylus/require/header.styl +++ b/stylus/require/header.styl @@ -112,6 +112,8 @@ body .typeahead-list width 400px border-radius 8px + outline 2px solid #3814a5 + z-index 3 @media all and (max-width:$smallScreen) #typeahead-nav.react-typeahead-container @@ -172,6 +174,8 @@ body &.current_page_item, &.current_page_parent + pointer-events none + > a font-weight bold cursor default From e3d0f5b60491ad080e23021d1dbc0ebc94993fd1 Mon Sep 17 00:00:00 2001 From: FredericoAndrade Date: Wed, 24 Jul 2024 01:52:15 +0200 Subject: [PATCH 11/11] enable custom datasource --- functions.php | 2 +- header.php | 5 +---- modules/banner--searchbar.php | 4 +--- stylus/main.css | 27 ++++++++++++++------------- stylus/require/banner--main.styl | 1 + stylus/require/banner--searchbar.styl | 4 ++-- stylus/require/header.styl | 4 ++-- 7 files changed, 22 insertions(+), 25 deletions(-) diff --git a/functions.php b/functions.php index 1a935e01..88b666e1 100644 --- a/functions.php +++ b/functions.php @@ -244,7 +244,7 @@ function custom_search_callback($request) { $args = array( 'post_type' => 'languages', 'post_status' => 'publish', - 'posts_per_page' => 10, + 'posts_per_page' => 100, 'meta_query' => $meta_query ); diff --git a/header.php b/header.php index 845b3103..1921ace7 100644 --- a/header.php +++ b/header.php @@ -166,10 +166,7 @@ Wikitongues logo: dark color scheme
- -
- [react_typeahead id="typeahead-nav" custom_class="nav-style" data_source="wordpress"] -
+ -
- [react_typeahead custom_class="body-style"] -
+ diff --git a/stylus/main.css b/stylus/main.css index 57e6dffa..545ac343 100644 --- a/stylus/main.css +++ b/stylus/main.css @@ -162,27 +162,27 @@ body.page-template-template-giving-campaign.logged-in[data-alert="true"] { height: 40px; width: auto; } -.wt_header #typeahead-nav .typeahead-form input { +.wt_header #typeahead_nav .typeahead-form input { border: none; width: 330px; padding: 11px; } -.wt_header #typeahead-nav .typeahead-form input:active, -.wt_header #typeahead-nav .typeahead-form input:focus { +.wt_header #typeahead_nav .typeahead-form input:active, +.wt_header #typeahead_nav .typeahead-form input:focus { width: 400px; background: #fffcef; transition-property: background, width; transition-duration: 0.6s; transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1); } -.wt_header #typeahead-nav .typeahead-form .typeahead-list { +.wt_header #typeahead_nav .typeahead-form .typeahead-list { width: 400px; border-radius: 8px; outline: 2px solid #3814a5; z-index: 3; } @media all and (max-width: 1024px) { - .wt_header #typeahead-nav.react-typeahead-container { + .wt_header #typeahead_nav.react-typeahead-container { display: none !important; } } @@ -484,6 +484,7 @@ body.home .wt_banner { width: 100%; height: 100%; background: rgba(0,0,0,0.3); + background: linear-gradient(90deg, rgba(1,1,1,0) 0%, rgba(1,1,1,0.3) 80%); } .wt_banner__copy { position: absolute; @@ -622,26 +623,26 @@ body.home .wt_banner { align-items: center; padding: 4rem 0; } -.wt_banner--searchbar #typeahead-archive .typeahead-form { +.wt_banner--searchbar #typeahead_archive .typeahead-form { width: 50vw; } -.wt_banner--searchbar #typeahead-archive .typeahead-form.loaded { +.wt_banner--searchbar #typeahead_archive .typeahead-form.loaded { display: inline-block; } -.wt_banner--searchbar #typeahead-archive .typeahead-form input { +.wt_banner--searchbar #typeahead_archive .typeahead-form input { width: inherit; border: none; padding: 2.5rem; font-size: 2rem; } -.wt_banner--searchbar #typeahead-archive .typeahead-form .typeahead-list { +.wt_banner--searchbar #typeahead_archive .typeahead-form .typeahead-list { position: initial; max-height: 60vh; border-radius: 0; border-top: 2px solid #3814a5; padding-top: 4px; } -.wt_banner--searchbar #typeahead-archive .typeahead-form .typeahead-list .typeahead-item { +.wt_banner--searchbar #typeahead_archive .typeahead-form .typeahead-list .typeahead-item { border-radius: 8px; padding: 12px; font-size: 1.2em; @@ -650,13 +651,13 @@ body.search-results .wt_banner--searchbar { min-height: initial; } @media all and (max-width: 768px) { - .wt_banner--searchbar #typeahead-archive { + .wt_banner--searchbar #typeahead_archive { margin-left: 0; } - .wt_banner--searchbar #typeahead-archive .typeahead-form { + .wt_banner--searchbar #typeahead_archive .typeahead-form { width: 90vw; } - .wt_banner--searchbar #typeahead-archive .typeahead-form .typeahead-list { + .wt_banner--searchbar #typeahead_archive .typeahead-form .typeahead-list { max-height: initial; } } diff --git a/stylus/require/banner--main.styl b/stylus/require/banner--main.styl index 5b530fed..a0ebd4c2 100644 --- a/stylus/require/banner--main.styl +++ b/stylus/require/banner--main.styl @@ -21,6 +21,7 @@ body width 100% height 100% background rgba(0,0,0,.3) + background linear-gradient(90deg, rgba(1, 1, 1, 0) 0%, rgba(1, 1, 1, .3) 80%) &__copy position absolute diff --git a/stylus/require/banner--searchbar.styl b/stylus/require/banner--searchbar.styl index 6bc3b3d3..8bfecee6 100644 --- a/stylus/require/banner--searchbar.styl +++ b/stylus/require/banner--searchbar.styl @@ -8,7 +8,7 @@ align-items center padding 4rem 0 - #typeahead-archive + #typeahead_archive .typeahead-form width 50vw @@ -39,7 +39,7 @@ body.search-results @media all and (max-width:$mobile) .wt_banner--searchbar - #typeahead-archive + #typeahead_archive margin-left 0 .typeahead-form diff --git a/stylus/require/header.styl b/stylus/require/header.styl index 73c786b8..3b685214 100644 --- a/stylus/require/header.styl +++ b/stylus/require/header.styl @@ -94,7 +94,7 @@ body width auto - #typeahead-nav + #typeahead_nav .typeahead-form input border none @@ -116,7 +116,7 @@ body z-index 3 @media all and (max-width:$smallScreen) - #typeahead-nav.react-typeahead-container + #typeahead_nav.react-typeahead-container display none !important &--secondary