Skip to content

Commit 0e731ca

Browse files
Update the templates.
1 parent 302f9d7 commit 0e731ca

File tree

7 files changed

+55
-33
lines changed

7 files changed

+55
-33
lines changed

source/wp-content/themes/wporg-main-2022/functions.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,16 @@ function add_site_navigation_menus( $menus ) {
250250
* @param WP_Block $instance The block instance.
251251
*/
252252
function use_parent_page_title( $block_content, $block, $instance ) {
253+
254+
// Handle the site title for data liberation.
255+
if ( is_post_type_archive( 'and-handbook') || is_singular( 'and-handbook' ) ) {
256+
return str_replace(
257+
array( home_url(), get_bloginfo( 'name' ) ),
258+
array( home_url( '/data-liberation' ), __( 'Data Liberation', 'wporg' ) ),
259+
$block_content
260+
);
261+
}
262+
253263
if ( is_home() || is_single() || is_archive() ) {
254264
return str_replace(
255265
array( home_url(), get_bloginfo( 'name' ) ),

source/wp-content/themes/wporg-main-2022/inc/data-liberation-handbook.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function add_data_liberation_handbook( $handbooks ) {
1515
$handbooks['and'] = [
1616
'label' => 'Data Liberation Guides',
1717
'manifest' => 'https://raw.githubusercontent.com/WordPress/data-liberation/add/manifest/assets/manifest.json', // TODO: See https://github.com/WordPress/data-liberation/pull/46
18-
'slug' => 'and',
18+
'slug' => 'data-liberation/and',
1919
];
2020

2121
return $handbooks;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
// phpcs:disable WordPress.Files.FileName -- Allow underscore for pattern partial.
3+
/**
4+
* Title: Section Nav (Data Liberation)
5+
* Slug: wporg-main-2022/nav-data-liberation
6+
* Inserter: no
7+
*/
8+
9+
?>
10+
11+
<!-- wp:wporg/local-navigation-bar {"backgroundColor":"charcoal-2","style":{"position":{"type":"sticky"},"elements":{"link":{"color":{"text":"var:preset|color|white"},":hover":{"color":{"text":"var:preset|color|white"}}}}},"textColor":"white","fontSize":"small"} -->
12+
13+
<!-- wp:site-title {"level":0,"fontSize":"small"} /-->
14+
15+
<!-- wp:navigation {"menuSlug":"documentation","icon":"menu","overlayBackgroundColor":"charcoal-2","overlayTextColor":"white","layout":{"type":"flex","orientation":"horizontal"},"fontSize":"small"} /-->
16+
17+
<!-- /wp:wporg/local-navigation-bar -->
18+
19+
20+
<!-- wp:group {"className":"wporg-breadcrumbs","align":"full","style":{"spacing":{"padding":{"top":"18px","bottom":"18px","left":"var:preset|spacing|edge-space","right":"var:preset|spacing|edge-space"}}},"backgroundColor":"white","layout":{"type":"flex","flexWrap":"wrap","justifyContent":"space-between"}} -->
21+
<div class="wporg-breadcrumbs wp-block-group alignfull has-white-background-color has-background" style="padding-top:18px;padding-right:var(--wp--preset--spacing--edge-space);padding-bottom:18px;padding-left:var(--wp--preset--spacing--edge-space)">
22+
23+
<!-- wp:wporg/site-breadcrumbs {"fontSize":"small"} /-->
24+
25+
</div>

source/wp-content/themes/wporg-main-2022/patterns/data-liberation-guides.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,18 @@
77

88
?>
99

10-
<!-- wp:heading {"style":{"spacing":{"margin":{"bottom":"var:preset|spacing|30"}}}} -->
11-
<h2 class="wp-block-heading" style="margin-bottom:var(--wp--preset--spacing--30)">Guides</h2>
10+
<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"var:preset|spacing|20","bottom":"var:preset|spacing|40","left":"var:preset|spacing|edge-space","right":"var:preset|spacing|edge-space"}}},"layout":{"type":"default"}} -->
11+
<div class="wp-block-group alignwide" style="padding-top:var(--wp--preset--spacing--20);padding-right:var(--wp--preset--spacing--edge-space);padding-bottom:var(--wp--preset--spacing--40);padding-left:var(--wp--preset--spacing--edge-space)"><!-- wp:heading {"style":{"spacing":{"margin":{"bottom":"var:preset|spacing|30","top":"0"}}}} -->
12+
<h2 class="wp-block-heading" style="margin-top:0;margin-bottom:var(--wp--preset--spacing--30)">Guides</h2>
1213
<!-- /wp:heading -->
1314

14-
<!-- wp:query {"queryId":2,"query":{"perPage":3,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false}} -->
15+
<!-- wp:query {"queryId":2,"query":{"perPage":10,"pages":0,"offset":0,"postType":"and-handbook","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false},"layout":{"type":"default"}} -->
1516
<div class="wp-block-query"><!-- wp:post-template -->
16-
17-
<!-- wp:group {"style":{"spacing":{"padding":{"top":"var:preset|spacing|20","bottom":"var:preset|spacing|20","left":"var:preset|spacing|20","right":"var:preset|spacing|20"}}},"borderColor":"light-grey-1","layout":{"type":"constrained"}} -->
17+
<!-- wp:group {"style":{"spacing":{"padding":{"top":"var:preset|spacing|20","bottom":"var:preset|spacing|20","left":"var:preset|spacing|20","right":"var:preset|spacing|20"}}},"borderColor":"light-grey-1","layout":{"type":"default"}} -->
1818
<div class="wp-block-group has-border-color has-light-grey-1-border-color" style="padding-top:var(--wp--preset--spacing--20);padding-right:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)"><!-- wp:post-title {"level":3,"isLink":true,"style":{"spacing":{"margin":{"top":"0","bottom":"0"}},"typography":{"fontStyle":"normal","fontWeight":"700"},"elements":{"link":{"color":{"text":"var:preset|color|blueberry-1"}}}},"textColor":"blueberry-1","fontSize":"normal","fontFamily":"inter"} /-->
1919

2020
<!-- wp:post-excerpt {"style":{"spacing":{"margin":{"top":"0","bottom":"0"}}}} /--></div>
2121
<!-- /wp:group -->
22-
2322
<!-- /wp:post-template -->
2423

2524
<!-- wp:query-pagination -->
@@ -29,4 +28,5 @@
2928

3029
<!-- wp:query-pagination-next /-->
3130
<!-- /wp:query-pagination --></div>
32-
<!-- /wp:query -->
31+
<!-- /wp:query --></div>
32+
<!-- /wp:group -->
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!-- wp:wporg/global-header /-->
2+
3+
<!-- wp:pattern {"slug":"wporg-main-2022/nav-data-liberation"} /-->
4+
5+
<!-- wp:group {"tagName":"main","layout":{"inherit":true},"className":"entry-content","style":{"spacing":{"blockGap":"0px"}}} -->
6+
<main class="wp-block-group entry-content">
7+
<!-- wp:pattern {"slug":"wporg-main-2022/data-liberation-guides"} /-->
8+
</main>
9+
<!-- /wp:group -->
10+
11+
<!-- wp:wporg/global-footer /-->

source/wp-content/themes/wporg-main-2022/templates/page-data-liberation-guides.html

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
<!-- wp:wporg/global-header /-->
22

3-
<!-- wp:wporg/local-navigation-bar {"backgroundColor":"charcoal-2","style":{"position":{"type":"sticky"},"elements":{"link":{"color":{"text":"var:preset|color|white"},":hover":{"color":{"text":"var:preset|color|white"}}}}},"textColor":"white","fontSize":"small"} -->
4-
5-
<!-- wp:site-title {"level":0,"fontSize":"small"} /-->
6-
7-
<!-- wp:navigation {"menuSlug":"documentation","icon":"menu","overlayBackgroundColor":"charcoal-2","overlayTextColor":"white","layout":{"type":"flex","orientation":"horizontal"},"fontSize":"small"} /-->
8-
9-
<!-- /wp:wporg/local-navigation-bar -->
3+
<!-- wp:pattern {"slug":"wporg-main-2022/nav-data-liberation"} /-->
104

115
<!-- wp:group {"tagName":"main","layout":{"type":"constrained"},"style":{"spacing":{"padding":{"left":"var:preset|spacing|edge-space","right":"var:preset|spacing|edge-space"}}}} -->
126
<main class="wp-block-group alignfull" style="padding-left:var(--wp--preset--spacing--edge-space);padding-right:var(--wp--preset--spacing--edge-space)">

0 commit comments

Comments
 (0)