From 0e731cab4bb577d85bcfb85b90be8cc7c34176f4 Mon Sep 17 00:00:00 2001 From: StevenDufresne Date: Thu, 21 Dec 2023 13:53:17 +0900 Subject: [PATCH] Update the templates. --- .../themes/wporg-main-2022/functions.php | 10 ++++++++ .../inc/data-liberation-handbook.php | 2 +- .../patterns/_nav-data-liberation.php | 25 +++++++++++++++++++ .../patterns/data-liberation-guides.php | 14 +++++------ .../templates/archive-and-handbook.html | 11 ++++++++ .../page-data-liberation-guides.html | 18 ------------- ...e-single.html => single-and-handbook.html} | 8 +----- 7 files changed, 55 insertions(+), 33 deletions(-) create mode 100644 source/wp-content/themes/wporg-main-2022/patterns/_nav-data-liberation.php create mode 100644 source/wp-content/themes/wporg-main-2022/templates/archive-and-handbook.html delete mode 100644 source/wp-content/themes/wporg-main-2022/templates/page-data-liberation-guides.html rename source/wp-content/themes/wporg-main-2022/templates/{page-data-liberation-guide-single.html => single-and-handbook.html} (81%) diff --git a/source/wp-content/themes/wporg-main-2022/functions.php b/source/wp-content/themes/wporg-main-2022/functions.php index 6003c79c..d4aba0d3 100644 --- a/source/wp-content/themes/wporg-main-2022/functions.php +++ b/source/wp-content/themes/wporg-main-2022/functions.php @@ -250,6 +250,16 @@ function add_site_navigation_menus( $menus ) { * @param WP_Block $instance The block instance. */ function use_parent_page_title( $block_content, $block, $instance ) { + + // Handle the site title for data liberation. + if ( is_post_type_archive( 'and-handbook') || is_singular( 'and-handbook' ) ) { + return str_replace( + array( home_url(), get_bloginfo( 'name' ) ), + array( home_url( '/data-liberation' ), __( 'Data Liberation', 'wporg' ) ), + $block_content + ); + } + if ( is_home() || is_single() || is_archive() ) { return str_replace( array( home_url(), get_bloginfo( 'name' ) ), diff --git a/source/wp-content/themes/wporg-main-2022/inc/data-liberation-handbook.php b/source/wp-content/themes/wporg-main-2022/inc/data-liberation-handbook.php index afd53ef5..47aae21b 100644 --- a/source/wp-content/themes/wporg-main-2022/inc/data-liberation-handbook.php +++ b/source/wp-content/themes/wporg-main-2022/inc/data-liberation-handbook.php @@ -15,7 +15,7 @@ function add_data_liberation_handbook( $handbooks ) { $handbooks['and'] = [ 'label' => 'Data Liberation Guides', 'manifest' => 'https://raw.githubusercontent.com/WordPress/data-liberation/add/manifest/assets/manifest.json', // TODO: See https://github.com/WordPress/data-liberation/pull/46 - 'slug' => 'and', + 'slug' => 'data-liberation/and', ]; return $handbooks; diff --git a/source/wp-content/themes/wporg-main-2022/patterns/_nav-data-liberation.php b/source/wp-content/themes/wporg-main-2022/patterns/_nav-data-liberation.php new file mode 100644 index 00000000..8725dc75 --- /dev/null +++ b/source/wp-content/themes/wporg-main-2022/patterns/_nav-data-liberation.php @@ -0,0 +1,25 @@ + + + + + + + + + + + + +
+ + + +
\ No newline at end of file diff --git a/source/wp-content/themes/wporg-main-2022/patterns/data-liberation-guides.php b/source/wp-content/themes/wporg-main-2022/patterns/data-liberation-guides.php index 36a72d58..de95726c 100644 --- a/source/wp-content/themes/wporg-main-2022/patterns/data-liberation-guides.php +++ b/source/wp-content/themes/wporg-main-2022/patterns/data-liberation-guides.php @@ -7,19 +7,18 @@ ?> - -

Guides

+ +
+

Guides

- +
- - +
- @@ -29,4 +28,5 @@
- +
+ \ No newline at end of file diff --git a/source/wp-content/themes/wporg-main-2022/templates/archive-and-handbook.html b/source/wp-content/themes/wporg-main-2022/templates/archive-and-handbook.html new file mode 100644 index 00000000..9b7e7bbf --- /dev/null +++ b/source/wp-content/themes/wporg-main-2022/templates/archive-and-handbook.html @@ -0,0 +1,11 @@ + + + + + +
+ +
+ + + diff --git a/source/wp-content/themes/wporg-main-2022/templates/page-data-liberation-guides.html b/source/wp-content/themes/wporg-main-2022/templates/page-data-liberation-guides.html deleted file mode 100644 index 310bffa2..00000000 --- a/source/wp-content/themes/wporg-main-2022/templates/page-data-liberation-guides.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - -
- -
- - - diff --git a/source/wp-content/themes/wporg-main-2022/templates/page-data-liberation-guide-single.html b/source/wp-content/themes/wporg-main-2022/templates/single-and-handbook.html similarity index 81% rename from source/wp-content/themes/wporg-main-2022/templates/page-data-liberation-guide-single.html rename to source/wp-content/themes/wporg-main-2022/templates/single-and-handbook.html index bffa9c99..e25d36db 100644 --- a/source/wp-content/themes/wporg-main-2022/templates/page-data-liberation-guide-single.html +++ b/source/wp-content/themes/wporg-main-2022/templates/single-and-handbook.html @@ -1,12 +1,6 @@ - - - - - - - +