Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blockbase: make 404 into a php template so it can be translated #4332

Merged
merged 2 commits into from
Jul 27, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions blockbase/404.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
/**
* The template for displaying 404 pages (not found)
*
* @package Blockbase
* @since 1.1.1
*/
wp_head();

echo gutenberg_block_template_part( 'header' );
?>

<main class="container-404">
<h1 class="has-text-align-center has-large-font-size"><?php _e( 'Oops! That page can&rsquo;t be found.', 'blockbase' ); ?></h1>

<p><?php _e( 'It looks like nothing was found at this location. Maybe try a search?', 'blockbase' ); ?></p>

<?php echo do_blocks('<!-- wp:search {"label":""} /-->'); ?>
</main>

<?php
echo gutenberg_block_template_part( 'footer' );

wp_footer();
6 changes: 6 additions & 0 deletions blockbase/assets/ponyfill.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 0 additions & 18 deletions blockbase/block-templates/404.html

This file was deleted.

7 changes: 7 additions & 0 deletions blockbase/sass/base/_alignment.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,10 @@
.aligncenter {
text-align: center;
}

// Mimick the Gutenberg-generated rules of the layout container on the 404 template
.container-404 {
max-width: var(--wp--custom--layout--content-size);
margin-left: auto !important;
margin-right: auto !important;
}
2 changes: 1 addition & 1 deletion blockbase/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Description: Blockbase is a simple theme that supports full-site editing. It com
Requires at least: 5.7
Tested up to: 5.7
Requires PHP: 5.7
Version: 1.1.0
Version: 1.1.1
License: GNU General Public License v2 or later
License URI: https://raw.githubusercontent.com/Automattic/themes/trunk/LICENSE
Text Domain: blockbase
Expand Down
3 changes: 3 additions & 0 deletions blockbase/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@
}
}
},
"layout": {
"contentSize": "620px"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably also look into making it so the layout key generates a CSS variable, because this is redundant.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't find anything so opened this: WordPress/gutenberg#33705

},
"list": {
"spacing": {
"padding": {
Expand Down
18 changes: 0 additions & 18 deletions quadrat/block-templates/404.html

This file was deleted.

4 changes: 0 additions & 4 deletions quadrat/block-templates/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
<!-- wp:group {"layout":{"inherit":true}, "tagName":"main"} -->
<main class="wp-block-group">

<!-- wp:heading -->
<h2>Results:</h2>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we do the same for blockbase? That would make all 4 blockbase themes i11n-ready.

<!-- /wp:heading -->

<!-- wp:query {"queryId":1,"query":{"perPage":10,"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true}} -->
<!-- wp:query-loop -->

Expand Down
3 changes: 3 additions & 0 deletions quadrat/child-theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@
"fontSize": "min(max(28px, 5vw), 38px)"
}
},
"layout": {
"contentSize":"664px"
},
"line-height": {
"body": 1.7
},
Expand Down
3 changes: 3 additions & 0 deletions quadrat/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@
}
}
},
"layout": {
"contentSize": "664px"
},
"list": {
"spacing": {
"padding": {
Expand Down