Skip to content

Commit

Permalink
Update the templates.
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenDufresne committed Dec 21, 2023
1 parent 302f9d7 commit 0e731ca
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 33 deletions.
10 changes: 10 additions & 0 deletions source/wp-content/themes/wporg-main-2022/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ) ),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
// phpcs:disable WordPress.Files.FileName -- Allow underscore for pattern partial.
/**
* Title: Section Nav (Data Liberation)
* Slug: wporg-main-2022/nav-data-liberation
* Inserter: no
*/

?>

<!-- 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"} -->

<!-- wp:site-title {"level":0,"fontSize":"small"} /-->

<!-- wp:navigation {"menuSlug":"documentation","icon":"menu","overlayBackgroundColor":"charcoal-2","overlayTextColor":"white","layout":{"type":"flex","orientation":"horizontal"},"fontSize":"small"} /-->

<!-- /wp:wporg/local-navigation-bar -->


<!-- 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"}} -->
<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)">

<!-- wp:wporg/site-breadcrumbs {"fontSize":"small"} /-->

</div>
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@

?>

<!-- wp:heading {"style":{"spacing":{"margin":{"bottom":"var:preset|spacing|30"}}}} -->
<h2 class="wp-block-heading" style="margin-bottom:var(--wp--preset--spacing--30)">Guides</h2>
<!-- 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"}} -->
<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"}}}} -->
<h2 class="wp-block-heading" style="margin-top:0;margin-bottom:var(--wp--preset--spacing--30)">Guides</h2>
<!-- /wp:heading -->

<!-- wp:query {"queryId":2,"query":{"perPage":3,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false}} -->
<!-- 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"}} -->
<div class="wp-block-query"><!-- wp:post-template -->

<!-- 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"}} -->
<!-- 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"}} -->
<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"} /-->

<!-- wp:post-excerpt {"style":{"spacing":{"margin":{"top":"0","bottom":"0"}}}} /--></div>
<!-- /wp:group -->

<!-- /wp:post-template -->

<!-- wp:query-pagination -->
Expand All @@ -29,4 +28,5 @@

<!-- wp:query-pagination-next /-->
<!-- /wp:query-pagination --></div>
<!-- /wp:query -->
<!-- /wp:query --></div>
<!-- /wp:group -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- wp:wporg/global-header /-->

<!-- wp:pattern {"slug":"wporg-main-2022/nav-data-liberation"} /-->

<!-- wp:group {"tagName":"main","layout":{"inherit":true},"className":"entry-content","style":{"spacing":{"blockGap":"0px"}}} -->
<main class="wp-block-group entry-content">
<!-- wp:pattern {"slug":"wporg-main-2022/data-liberation-guides"} /-->
</main>
<!-- /wp:group -->

<!-- wp:wporg/global-footer /-->

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
<!-- wp:wporg/global-header /-->

<!-- 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"} -->

<!-- wp:site-title {"level":0,"fontSize":"small"} /-->

<!-- wp:navigation {"menuSlug":"documentation","icon":"menu","overlayBackgroundColor":"charcoal-2","overlayTextColor":"white","layout":{"type":"flex","orientation":"horizontal"},"fontSize":"small"} /-->

<!-- /wp:wporg/local-navigation-bar -->
<!-- wp:pattern {"slug":"wporg-main-2022/nav-data-liberation"} /-->

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

0 comments on commit 0e731ca

Please sign in to comment.