From c1e342b1153b37f996294a1415b18845d1cefbc9 Mon Sep 17 00:00:00 2001 From: Amor Kumar Date: Thu, 3 Aug 2023 15:55:25 -0400 Subject: [PATCH] Overhaul templates, ensuring proper alignment --- inc/hooks/wrap-core-blocks.php | 44 ---------------------------------- parts/content.html | 15 ------------ parts/footer.html | 10 +------- parts/header.html | 14 +---------- patterns/footer.php | 18 ++++++++++++++ patterns/header.php | 22 +++++++++++++++++ patterns/query.php | 34 ++++++++++++++++++++++++++ templates/blank.html | 5 ++++ templates/index.html | 19 ++++++++++++--- templates/no-title.html | 13 ++++++++++ templates/page.html | 18 ++++++++++++++ theme.json | 6 ++++- 12 files changed, 133 insertions(+), 85 deletions(-) delete mode 100644 inc/hooks/wrap-core-blocks.php delete mode 100644 parts/content.html create mode 100644 patterns/footer.php create mode 100644 patterns/header.php create mode 100644 patterns/query.php create mode 100644 templates/no-title.html create mode 100644 templates/page.html diff --git a/inc/hooks/wrap-core-blocks.php b/inc/hooks/wrap-core-blocks.php deleted file mode 100644 index 75a694d..0000000 --- a/inc/hooks/wrap-core-blocks.php +++ /dev/null @@ -1,44 +0,0 @@ - 'core/heading', - 'paragraph' => 'core/paragraph', - 'html' => 'core/html', - 'list' => 'core/list', - ]; - - foreach ( $blocks_to_wrap as $block_class => $block_name ) { - if ( $block_name === $block['blockName'] ) { - $block_content = '' . $block_content . ''; - } - } - - // The core/freeform block doesn't have a block name. So we need to check for null to wrap it... - if ( null === $block['blockName'] && ! empty( $block_content ) && ! ctype_space( $block_content ) ) { - $block_content = '' . $block_content . ''; - } - - return $block_content; -} - -add_filter( 'render_block', __NAMESPACE__ . '\wrap_core_blocks', 10, 2 ); diff --git a/parts/content.html b/parts/content.html deleted file mode 100644 index 21e4b38..0000000 --- a/parts/content.html +++ /dev/null @@ -1,15 +0,0 @@ - -
- - - - - - - - - - - -
- diff --git a/parts/footer.html b/parts/footer.html index 5dfcb91..2df65f9 100644 --- a/parts/footer.html +++ b/parts/footer.html @@ -1,9 +1 @@ - - - + diff --git a/parts/header.html b/parts/header.html index 663ec6c..cff340f 100644 --- a/parts/header.html +++ b/parts/header.html @@ -1,13 +1 @@ - -
-
-
-
-
- - - -
-
-
- + diff --git a/patterns/footer.php b/patterns/footer.php new file mode 100644 index 0000000..75c6302 --- /dev/null +++ b/patterns/footer.php @@ -0,0 +1,18 @@ + + + + diff --git a/patterns/header.php b/patterns/header.php new file mode 100644 index 0000000..72a83c4 --- /dev/null +++ b/patterns/header.php @@ -0,0 +1,22 @@ + + +
+
+
+
+
+ + + +
+
+
+ diff --git a/patterns/query.php b/patterns/query.php new file mode 100644 index 0000000..48bac82 --- /dev/null +++ b/patterns/query.php @@ -0,0 +1,34 @@ + + +
+ + +
+ + +
+ + +

·

+ + +
+ +
+ + + + + + + +
+ diff --git a/templates/blank.html b/templates/blank.html index e69de29..649ce26 100644 --- a/templates/blank.html +++ b/templates/blank.html @@ -0,0 +1,5 @@ + +
+ +
+ diff --git a/templates/index.html b/templates/index.html index e5cead7..08028bf 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,3 +1,16 @@ - - - + + + +
+ +
+ + + diff --git a/templates/no-title.html b/templates/no-title.html new file mode 100644 index 0000000..a60610e --- /dev/null +++ b/templates/no-title.html @@ -0,0 +1,13 @@ + + +
+ +
+ + diff --git a/templates/page.html b/templates/page.html new file mode 100644 index 0000000..63a94d5 --- /dev/null +++ b/templates/page.html @@ -0,0 +1,18 @@ + + +
+ +
+ + + +
+ + diff --git a/theme.json b/theme.json index 99e4a0f..c0c8041 100644 --- a/theme.json +++ b/theme.json @@ -412,7 +412,11 @@ "customTemplates": [ { "name": "blank", - "title": "Blank Tempate" + "title": "Blank" + }, + { + "name": "no-title", + "title": "No Title" } ], "version": 2,