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

Bring Parisienne up-to-date with Gutenberg 7.9 #38

Merged
merged 3 commits into from
Jun 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 0 additions & 11 deletions parisienne/block-template-parts/about.html

This file was deleted.

37 changes: 0 additions & 37 deletions parisienne/block-template-parts/contact.html

This file was deleted.

9 changes: 0 additions & 9 deletions parisienne/block-template-parts/cover.html

This file was deleted.

8 changes: 6 additions & 2 deletions parisienne/block-template-parts/footer.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<!-- wp:group {"align":"full", "tagName": "footer", "className": "site-footer"} -->
<footer class="wp-block-group alignfull site-footer">
<!-- wp:separator {"className":"is-style-wide"} -->
<hr class="wp-block-separator is-style-wide"/>
<hr class="wp-block-separator is-style-default"/>
<!-- /wp:separator -->

<!-- wp:paragraph {"align":"center"} -->
<p class="has-text-align-center">337 Bedford Ave, Brooklyn, New York 11211</p>
<!-- /wp:paragraph -->
<!-- /wp:paragraph -->
</footer>
<!-- /wp:group -->
18 changes: 9 additions & 9 deletions parisienne/block-template-parts/header.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- wp:group {"align":"full"} -->
<div class="wp-block-group alignfull"><div class="wp-block-group__inner-container"><!-- wp:columns {"align":"full"} -->
<div class="wp-block-columns alignfull"><!-- wp:column {"width":20} -->
<div class="wp-block-column" style="flex-basis:20%"><!-- wp:navigation {"className":"is-style-dark"} -->
<!-- wp:group {"align":"full", "tagName": "header", "className": "site-header"} -->
<header class="wp-block-group alignfull"><div class="wp-block-group__inner-container"><!-- wp:columns {"align":"full"} -->
<div class="wp-block-columns alignfull"><!-- wp:column {"width":25} -->
<div class="wp-block-column" style="flex-basis:25%"><!-- wp:navigation -->
<!-- wp:navigation-link {"label":"Home","title":"Home","type":"page","id":185,"url":"/"} /-->

<!-- wp:navigation-link {"label":"About","title":"About","url":"/about"} /-->
Expand All @@ -10,12 +10,12 @@
<!-- /wp:navigation --></div>
<!-- /wp:column -->

<!-- wp:column {"width":60} -->
<div class="wp-block-column" style="flex-basis:60%"><!-- wp:site-title /--></div>
<!-- wp:column {"width":50} -->
<div class="wp-block-column" style="flex-basis:50%"><!-- wp:site-title /--></div>
<!-- /wp:column -->

<!-- wp:column {"width":20} -->
<div class="wp-block-column" style="flex-basis:20%"><!-- wp:group -->
<!-- wp:column {"width":25} -->
<div class="wp-block-column" style="flex-basis:25%"><!-- wp:group -->
<div class="wp-block-group"><div class="wp-block-group__inner-container"><!-- wp:group -->
<div class="wp-block-group"><div class="wp-block-group__inner-container"><!-- wp:paragraph {"fontSize":"small"} -->
<p class="has-small-font-size address-align">337 Bedford Ave, Brooklyn, New York 11211</p>
Expand All @@ -31,5 +31,5 @@

<!-- wp:separator {"customColor":"#decabf","className":"is-style-default"} -->
<hr class="wp-block-separator has-text-color has-background is-style-default" style="background-color:#decabf;color:#decabf"/>
<!-- /wp:separator --></div></div>
<!-- /wp:separator --></div></header>
<!-- /wp:group -->
5 changes: 0 additions & 5 deletions parisienne/block-template-parts/image-quote.html

This file was deleted.

25 changes: 0 additions & 25 deletions parisienne/block-template-parts/quick-facts.html

This file was deleted.

12 changes: 4 additions & 8 deletions parisienne/block-templates/index.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
<!-- wp:group {"align":"full","className":"site-header"} -->
<div class="wp-block-group alignfull site-header"><div class="wp-block-group__inner-container"><!-- wp:template-part {"slug":"header","theme":"parisienne"} /--></div></div>
<!-- /wp:group -->
<!-- wp:template-part {"slug":"header","theme":"parisienne"} /-->

<!-- wp:group {"align":"full","className":"site-content"} -->
<div class="wp-block-group alignfull site-content"><div class="wp-block-group__inner-container"><!-- wp:post-content /--></div></div>
<!-- wp:group {"tagName": "main", "align":"full"} -->
<main class="wp-block-group alignfull"><!-- wp:post-content /--></main>
<!-- /wp:group -->

<!-- wp:group {"align":"full","className":"site-footer"} -->
<div class="wp-block-group alignfull site-footer"><div class="wp-block-group__inner-container"><!-- wp:template-part {"slug":"footer","theme":"parisienne"} /--></div></div>
<!-- /wp:group -->
<!-- wp:template-part {"slug":"footer","theme":"parisienne"} /-->
109 changes: 53 additions & 56 deletions parisienne/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,60 @@ function parisienne_theme_support() {
add_theme_support( 'align-wide' );

// Starter content
add_theme_support('starter-content', [
// Static front page set to Home, posts page set to Blog
'options' => [
'show_on_front' => 'page',
'page_on_front' => '{{home}}',
'page_for_posts' => '{{blog}}',
],
// Starter pages to include
'posts' => [
'home' => [
'post_content' => '<!-- wp:template-part {"slug":"cover","theme":"parisienne"} -->'
if ( is_customize_preview() ) {
add_theme_support('starter-content', [
// Static front page set to Home, posts page set to Blog
'options' => [
'show_on_front' => 'page',
'page_on_front' => '{{home}}',
'page_for_posts' => '{{blog}}',
],
'about' => [
'post_content' => '<!-- wp:template-part {"slug":"about","theme":"parisienne"} -->'
],
'contact' => [
'post_content' => '<!-- wp:template-part {"slug":"contact","theme":"parisienne"} -->'
],
'blog'
]
]);
// Starter pages to include
'posts' => [
'home' => [
'post_content' => '<!-- wp:cover {"url":"https://user-images.githubusercontent.com/5375500/72178518-09828c80-33b1-11ea-9ba9-818a64ed9398.png","id":273,"dimRatio":0,"minHeight":647,"align":"wide"} --> <div class="wp-block-cover alignwide" style="background-image:url(https://user-images.githubusercontent.com/5375500/72178518-09828c80-33b1-11ea-9ba9-818a64ed9398.png);min-height:647px"><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"Write title…","fontSize":"large"} --> <p class="has-text-align-center has-large-font-size">Open Daily at 7a</p> <!-- /wp:paragraph --> <!-- wp:button {"borderRadius":0,"align":"center","className":"is-style-fill","style":{"color":{"background":"#817361"}}} --> <a class="wp-block-button aligncenter wp-block-button__link no-border-radius is-style-fill has-background" href="/contact" style="background-color:#817361">Plan Your Visit</a> <!-- /wp:button --> <!-- wp:paragraph --> <p></p> <!-- /wp:paragraph --></div></div> <!-- /wp:cover -->'
],
'about' => [
'post_content' => '<!-- wp:media-text {"mediaPosition":"right","mediaId":311,"mediaType":"image","isStackedOnMobile":false,"className":"alignwide is-stacked-on-mobile"} --> <div class="wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile"><figure class="wp-block-media-text__media"><img src="https://user-images.githubusercontent.com/5375500/72178519-09828c80-33b1-11ea-9b10-19885c2eaa78.png" alt="cake on a platter" class="wp-image-311"/></figure><div class="wp-block-media-text__content"><!-- wp:quote {"align":"right","className":"is-style-large"} --> <blockquote class="wp-block-quote has-text-align-right is-style-large"><p>“When I sit down at Chez Maman’s, time stands still. It is like home to me.</p><cite>Harriett Stanton</cite></blockquote> <!-- /wp:quote --></div></div> <!-- /wp:media-text --> <!-- wp:separator {"className":"is-style-wide"} --> <hr class="wp-block-separator is-style-wide"/> <!-- /wp:separator --> <!-- wp:media-text {"mediaId":337,"mediaType":"image","mediaWidth":34,"verticalAlignment":"top","imageFill":false} --> <div class="wp-block-media-text alignwide is-stacked-on-mobile is-vertically-aligned-top" style="grid-template-columns:34% auto"><figure class="wp-block-media-text__media"><img src="https://user-images.githubusercontent.com/5375500/72178521-09828c80-33b1-11ea-9c3f-e17dd88b2d6c.png" alt="" class="wp-image-337"/></figure><div class="wp-block-media-text__content"><!-- wp:list --> <ul><li>Fresh bread baked daily with ancient yeasts and starter that’s been in the family for 50 years.</li><li>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip.</li><li>Excepteur sint occaecat cupidatat non proident.</li><li>Consectetur adipiscing elit, sed do eiusmod tempor incididunt ut.</li></ul> <!-- /wp:list --></div></div> <!-- /wp:media-text -->'
],
'contact' => [
'post_content' => '<!-- wp:columns {"align":"wide"} --> <div class="wp-block-columns alignwide"><!-- wp:column --> <div class="wp-block-column"><!-- wp:image {"sizeSlug":"large"} --> <figure class="wp-block-image size-large"><img src="https://user-images.githubusercontent.com/5375500/72178520-09828c80-33b1-11ea-8a89-e08b0feb6d85.png" alt=""/></figure> <!-- /wp:image --></div> <!-- /wp:column --> <!-- wp:column --> <div class="wp-block-column"><!-- wp:heading {"level":4} --> <h4>Reservations</h4> <!-- /wp:heading --> <!-- wp:paragraph --> <p>For parties under six persons, seating is on a first come, first serve basis.</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>If you are looking to make a reservation for a party of six or larger, please call us at 212 - 867 - 5409.</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>We look forward to hosting you!</p> <!-- /wp:paragraph --> <!-- wp:heading {"level":4} --> <h4>Address</h4> <!-- /wp:heading --> <!-- wp:paragraph --> <p>Visit or write us at:</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>337 Bedford Ave, Brooklyn, NY 11216</p> <!-- /wp:paragraph --></div> <!-- /wp:column --></div> <!-- /wp:columns -->'
],
'blog'
]
]);
}

/**
* Register Block Patterns.
*/
if ( function_exists( 'register_pattern' ) ) {
register_pattern(
'parisienne/about-pattern',
array (
'title' => __( 'A layout of images and text', 'parisienne' ),
'content' => '<!-- wp:media-text {"mediaPosition":"right","mediaId":311,"mediaType":"image","isStackedOnMobile":false,"className":"alignwide is-stacked-on-mobile"} --> <div class="wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile"><figure class="wp-block-media-text__media"><img src="https://user-images.githubusercontent.com/5375500/72178519-09828c80-33b1-11ea-9b10-19885c2eaa78.png" alt="cake on a platter" class="wp-image-311"/></figure><div class="wp-block-media-text__content"><!-- wp:quote {"align":"right","className":"is-style-large"} --> <blockquote class="wp-block-quote has-text-align-right is-style-large"><p>“When I sit down at Chez Maman’s, time stands still. It is like home to me.</p><cite>Harriett Stanton</cite></blockquote> <!-- /wp:quote --></div></div> <!-- /wp:media-text --> <!-- wp:separator {"className":"is-style-wide"} --> <hr class="wp-block-separator is-style-wide"/> <!-- /wp:separator --> <!-- wp:media-text {"mediaId":337,"mediaType":"image","mediaWidth":34,"verticalAlignment":"top","imageFill":false} --> <div class="wp-block-media-text alignwide is-stacked-on-mobile is-vertically-aligned-top" style="grid-template-columns:34% auto"><figure class="wp-block-media-text__media"><img src="https://user-images.githubusercontent.com/5375500/72178521-09828c80-33b1-11ea-9c3f-e17dd88b2d6c.png" alt="" class="wp-image-337"/></figure><div class="wp-block-media-text__content"><!-- wp:list --> <ul><li>Fresh bread baked daily with ancient yeasts and starter that’s been in the family for 50 years.</li><li>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip.</li><li>Excepteur sint occaecat cupidatat non proident.</li><li>Consectetur adipiscing elit, sed do eiusmod tempor incididunt ut.</li></ul> <!-- /wp:list --></div></div> <!-- /wp:media-text -->'
)
);

register_pattern(
'parisienne/cover-pattern',
array (
'title' => __( 'A cover block with text and a button', 'parisienne' ),
'content' => '<!-- wp:cover {"url":"https://user-images.githubusercontent.com/5375500/72178518-09828c80-33b1-11ea-9ba9-818a64ed9398.png","id":273,"dimRatio":0,"minHeight":647,"align":"wide"} --> <div class="wp-block-cover alignwide" style="background-image:url(https://user-images.githubusercontent.com/5375500/72178518-09828c80-33b1-11ea-9ba9-818a64ed9398.png);min-height:647px"><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"Write title…","fontSize":"large"} --> <p class="has-text-align-center has-large-font-size">Open Daily at 7a</p> <!-- /wp:paragraph --> <!-- wp:button {"borderRadius":0,"align":"center","className":"is-style-fill","style":{"color":{"background":"#817361"}}} --> <a class="wp-block-button aligncenter wp-block-button__link no-border-radius is-style-fill has-background" href="/contact" style="background-color:#817361">Plan Your Visit</a> <!-- /wp:button --> <!-- wp:paragraph --> <p></p> <!-- /wp:paragraph --></div></div> <!-- /wp:cover -->'
)
);

register_pattern(
'parisienne/contact-pattern',
array (
'title' => __( 'A contact page pattern', 'parisienne' ),
'content' => '<!-- wp:columns {"align":"wide"} --> <div class="wp-block-columns alignwide"><!-- wp:column --> <div class="wp-block-column"><!-- wp:image {"sizeSlug":"large"} --> <figure class="wp-block-image size-large"><img src="https://user-images.githubusercontent.com/5375500/72178520-09828c80-33b1-11ea-8a89-e08b0feb6d85.png" alt=""/></figure> <!-- /wp:image --></div> <!-- /wp:column --> <!-- wp:column --> <div class="wp-block-column"><!-- wp:heading {"level":4} --> <h4>Reservations</h4> <!-- /wp:heading --> <!-- wp:paragraph --> <p>For parties under six persons, seating is on a first come, first serve basis.</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>If you are looking to make a reservation for a party of six or larger, please call us at 212 - 867 - 5409.</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>We look forward to hosting you!</p> <!-- /wp:paragraph --> <!-- wp:heading {"level":4} --> <h4>Address</h4> <!-- /wp:heading --> <!-- wp:paragraph --> <p>Visit or write us at:</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>337 Bedford Ave, Brooklyn, NY 11216</p> <!-- /wp:paragraph --></div> <!-- /wp:column --></div> <!-- /wp:columns -->'
)
);
}
}

}
add_action( 'after_setup_theme', 'parisienne_theme_support' );
endif;

Expand All @@ -62,38 +93,4 @@ function parisienne_register_styles() {
wp_enqueue_style( 'parisienne-style', get_stylesheet_uri(), array(), $theme_version );
}

add_action( 'wp_enqueue_scripts', 'parisienne_register_styles' );


/**
* Block Editor Settings.
* Add custom colors to the block editor.
*/

function parisienne_block_editor_settings() {

// Editor Color Palette
add_theme_support( 'editor-color-palette', array(
array(
'name' => __( 'Blue', 'parisienne' ),
'slug' => 'blue',
'color' => '#59BACC',
),
array(
'name' => __( 'Green', 'parisienne' ),
'slug' => 'green',
'color' => '#58AD69',
),
array(
'name' => __( 'Orange', 'parisienne' ),
'slug' => 'orange',
'color' => '#FFBC49',
),
array(
'name' => __( 'Red', 'parisienne' ),
'slug' => 'red',
'color' => '#E2574C',
),
) );
}
add_action( 'after_setup_theme', 'parisienne_block_editor_settings' );
add_action( 'wp_enqueue_scripts', 'parisienne_register_styles' );
Loading