diff --git a/gutenberg-starter-theme-blocks/css/blocks.css b/gutenberg-starter-theme-blocks/css/blocks.css index 6e1fbb0f..9e2a5087 100644 --- a/gutenberg-starter-theme-blocks/css/blocks.css +++ b/gutenberg-starter-theme-blocks/css/blocks.css @@ -39,7 +39,7 @@ } .entry-content > .alignwide, -.site-header > .alignwide +.site-header > .alignwide, .site-footer > .alignwide { max-width: 1070px; } @@ -56,8 +56,8 @@ .site-header > *, .site-footer > *, .site-content > h1 { - padding-left: 0px; - padding-right: 0px; + padding-left: 0; + padding-right: 0; } } @@ -203,7 +203,7 @@ ul.wp-block-latest-posts.is-grid.alignwide { .entry-content li, .site-header li, -.site-footer li, { +.site-footer li { margin-left: 2.5em; } @@ -229,7 +229,7 @@ ul.wp-block-latest-posts.is-grid.alignwide { .site-header ul ul li, .site-header ol ol li, .site-header ul ol li, -.site-header ol ul li +.site-header ol ul li, .site-footer ul ul li, .site-footer ol ol li, .site-footer ul ol li, @@ -370,4 +370,4 @@ ul.wp-block-latest-posts.is-grid.alignwide { .has-very-dark-gray-background-color { background-color: #444; -} \ No newline at end of file +} diff --git a/parisienne/block-template-parts/about.html b/parisienne/block-template-parts/about.html deleted file mode 100644 index e17c2a99..00000000 --- a/parisienne/block-template-parts/about.html +++ /dev/null @@ -1,11 +0,0 @@ - -
- - - - - -
- - - diff --git a/parisienne/block-template-parts/contact.html b/parisienne/block-template-parts/contact.html deleted file mode 100644 index 5116967b..00000000 --- a/parisienne/block-template-parts/contact.html +++ /dev/null @@ -1,37 +0,0 @@ - -
-
-
-
- - - -
-

Reservations

- - - -

For parties under six persons, seating is on a first come, first serve basis.

- - - -

If you are looking to make a reservation for a party of six or larger, please call us at 212 - 867 - 5409.

- - - -

We look forward to hosting you!

- - - -

Address

- - - -

Visit or write us at:

- - - -

337 Bedford Ave, Brooklyn, NY 11216

-
-
- diff --git a/parisienne/block-template-parts/cover.html b/parisienne/block-template-parts/cover.html deleted file mode 100644 index 75f13e6e..00000000 --- a/parisienne/block-template-parts/cover.html +++ /dev/null @@ -1,9 +0,0 @@ - -
-

Open Daily at 7a

- - - - -
- diff --git a/parisienne/block-template-parts/footer.html b/parisienne/block-template-parts/footer.html index 2e75471b..2d2fac17 100644 --- a/parisienne/block-template-parts/footer.html +++ b/parisienne/block-template-parts/footer.html @@ -1,7 +1,11 @@ + + + \ No newline at end of file diff --git a/parisienne/block-template-parts/header.html b/parisienne/block-template-parts/header.html index d973babd..ec419fe3 100644 --- a/parisienne/block-template-parts/header.html +++ b/parisienne/block-template-parts/header.html @@ -1,7 +1,7 @@ - -
-
-
+ +
+
+
@@ -10,12 +10,12 @@
- -
+ +
- -
+ +

337 Bedford Ave, Brooklyn, New York 11211

@@ -31,5 +31,5 @@
-
+
diff --git a/parisienne/block-template-parts/image-quote.html b/parisienne/block-template-parts/image-quote.html deleted file mode 100644 index 44b56206..00000000 --- a/parisienne/block-template-parts/image-quote.html +++ /dev/null @@ -1,5 +0,0 @@ - -
-

“When I sit down at Chez Maman’s, time stands still. It is like home to me.

Harriett Stanton
-
- diff --git a/parisienne/block-template-parts/quick-facts.html b/parisienne/block-template-parts/quick-facts.html deleted file mode 100644 index 9ab79bfb..00000000 --- a/parisienne/block-template-parts/quick-facts.html +++ /dev/null @@ -1,25 +0,0 @@ - -
-
- - - -
-

Quick Facts

-
- - - -
-
- - - -
-
  • Fresh bread baked daily with ancient yeasts and starter that’s been in the family for 50 years.
  • Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip.
  • Excepteur sint occaecat cupidatat non proident.
  • Consectetur adipiscing elit, sed do eiusmod tempor incididunt ut.
- - - -

-
- diff --git a/parisienne/block-templates/index.html b/parisienne/block-templates/index.html index e1a6cc87..853be2d8 100644 --- a/parisienne/block-templates/index.html +++ b/parisienne/block-templates/index.html @@ -1,11 +1,7 @@ - - - + - -
+ +
- - - + \ No newline at end of file diff --git a/parisienne/functions.php b/parisienne/functions.php index c9720ba1..f7443fcd 100644 --- a/parisienne/functions.php +++ b/parisienne/functions.php @@ -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' => '' + 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' => '' - ], - 'contact' => [ - 'post_content' => '' - ], - 'blog' - ] - ]); + // Starter pages to include + 'posts' => [ + 'home' => [ + 'post_content' => '

Open Daily at 7a

Plan Your Visit

' + ], + 'about' => [ + 'post_content' => '
cake on a platter

“When I sit down at Chez Maman’s, time stands still. It is like home to me.

Harriett Stanton

  • Fresh bread baked daily with ancient yeasts and starter that’s been in the family for 50 years.
  • Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip.
  • Excepteur sint occaecat cupidatat non proident.
  • Consectetur adipiscing elit, sed do eiusmod tempor incididunt ut.
' + ], + 'contact' => [ + 'post_content' => '

Reservations

For parties under six persons, seating is on a first come, first serve basis.

If you are looking to make a reservation for a party of six or larger, please call us at 212 - 867 - 5409.

We look forward to hosting you!

Address

Visit or write us at:

337 Bedford Ave, Brooklyn, NY 11216

' + ], + 'blog' + ] + ]); + } + + /** + * Register Block Patterns. + */ + if ( function_exists( 'register_pattern' ) ) { + register_pattern( + 'parisienne/about-pattern', + array ( + 'title' => __( 'A layout of images and text', 'parisienne' ), + 'content' => '
cake on a platter

“When I sit down at Chez Maman’s, time stands still. It is like home to me.

Harriett Stanton

  • Fresh bread baked daily with ancient yeasts and starter that’s been in the family for 50 years.
  • Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip.
  • Excepteur sint occaecat cupidatat non proident.
  • Consectetur adipiscing elit, sed do eiusmod tempor incididunt ut.
' + ) + ); + + register_pattern( + 'parisienne/cover-pattern', + array ( + 'title' => __( 'A cover block with text and a button', 'parisienne' ), + 'content' => '

Open Daily at 7a

Plan Your Visit

' + ) + ); + + register_pattern( + 'parisienne/contact-pattern', + array ( + 'title' => __( 'A contact page pattern', 'parisienne' ), + 'content' => '

Reservations

For parties under six persons, seating is on a first come, first serve basis.

If you are looking to make a reservation for a party of six or larger, please call us at 212 - 867 - 5409.

We look forward to hosting you!

Address

Visit or write us at:

337 Bedford Ave, Brooklyn, NY 11216

' + ) + ); + } + } - } add_action( 'after_setup_theme', 'parisienne_theme_support' ); endif; @@ -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' ); \ No newline at end of file diff --git a/parisienne/style.css b/parisienne/style.css index fdebcc1d..b9d4f6a9 100644 --- a/parisienne/style.css +++ b/parisienne/style.css @@ -414,7 +414,7 @@ figcaption a, .alignwide { margin: auto; - max-width: 1280px; + max-width: 1040px; } .site-border { @@ -430,7 +430,7 @@ figcaption a, /* Header ------------------------------------- */ -.site-header p { +header p { margin: 1em 0; } @@ -438,20 +438,20 @@ p.address-align { text-align: right; } -.site-header .wp-block-columns { +header .wp-block-columns { margin: 0 2rem; margin-bottom: 0; align-items: center; } -.site-header h1 { +header h1 { font-family: 'Pinyon Script'; font-size: 7.2rem; text-align: center; margin: 3rem 0 0; } -.site-header .wp-block-social-links { +header .wp-block-social-links { justify-content: flex-end; } @@ -469,7 +469,7 @@ p.address-align { /* Content ------------------------------------- */ -.site-content { +main { margin: 4rem auto 0; } @@ -519,10 +519,16 @@ p.address-align { /* Footer ------------------------------------- */ -.site-footer { +footer { padding: 3rem; } -.site-footer .wp-block-group { +footer .wp-block-group { margin-bottom: 3rem; } + +/* Blocks ------------------------------------- */ + +.wp-block-cover { + text-align: center; +} \ No newline at end of file diff --git a/require-gutenberg/README.md b/require-gutenberg/README.md new file mode 100644 index 00000000..7e44a0d5 --- /dev/null +++ b/require-gutenberg/README.md @@ -0,0 +1,20 @@ +# Require Gutenberg + +While Full-Site Editing is still experimental, themes need a way to require Gutenberg be installed as a plugin, with the Full Site Editing experiment enabled. + +The PHP file here will do the following: + +* Show an admin notice stating this is an experimental theme +* Check if Gutenberg is installed as a plugin +* If Gutenberg is not installed, allow users to install it with the click of a button. +* Check if Gutenberg is Activated +* Check if Gutenberg has the "Full Site Editing" experiment enabled. +* If Gutenberg is not activated or the experiment is not enabled, allow users to activate them with the click of a button. +* If the user switches to a non-FSE theme, deactivates the experiment. + +Everything runs on AJAX so there are no page refreshes. + +## Usage + +Simply grab the contents of the `require-gutenberg.php` file and paste them in your `functions.php` file. Alternatively you can include it as a separate file. +Once you copy the code to your theme, replace `textdomain` inside the file with your theme's text-domain. diff --git a/require-gutenberg/require-gutenberg.php b/require-gutenberg/require-gutenberg.php new file mode 100644 index 00000000..3a52af9d --- /dev/null +++ b/require-gutenberg/require-gutenberg.php @@ -0,0 +1,331 @@ +is_plugin_installed() ) { + $active_step = 'install'; + } elseif ( ! $this->is_plugin_active() || ! $this->is_experiment_enabled() ) { + $active_step = 'activate'; + } + + // Early exit if there's nothing to do. + if ( ! $active_step ) { + return; + } + ?> +
+

+
+

+

+
+
+

+

+
+
+

+
+
+ + + + + get_template_directory(); + + // No need to do anything if the theme we switched to supports Full Site Editing. + // Check if the block-templates folder exists, and if it does then early exit. + if ( file_exists( $new_theme_path . '/block-templates' ) || is_dir( $new_theme_path . '/block-templates' ) ) { + return; + } + + // Get option. + $option = get_option( 'gutenberg-experiments', [] ); + + // Sanity check for option. + if ( ! is_array( $option ) ) { + $option = []; + } + + // Disable experiment. + unset( $option['gutenberg-full-site-editing'] ); + + // Update the option. + update_option( 'gutenberg-experiments', $option ); + } + } +} + +if ( ! function_exists( 'wpthemes_require_gutenberg_fse' ) ) { + /** + * Load the Gutenberg requirement. + * + * @return void + */ + function wpthemes_require_gutenberg_fse() { + + // Instantiate the object. + $init = new WPThemes_Require_Gutenberg(); + + // Run our actions. + $init->run(); + } +} + +// Run Gutenberg requirement. +wpthemes_require_gutenberg_fse(); diff --git a/twentynineteen-blocks/block-templates/singular.html b/twentynineteen-blocks/block-templates/singular.html index 878da927..779b3af0 100644 --- a/twentynineteen-blocks/block-templates/singular.html +++ b/twentynineteen-blocks/block-templates/singular.html @@ -3,7 +3,20 @@ -
+
+
+ + + +
+
+ + +
+
+ +
+
diff --git a/twentynineteen-blocks/style.css b/twentynineteen-blocks/style.css index b8ad5fa5..f8a4da51 100644 --- a/twentynineteen-blocks/style.css +++ b/twentynineteen-blocks/style.css @@ -99,13 +99,13 @@ Tags: one-column, flexible-header, accessibility-ready, custom-colors, custom-me /* Site content positioning */ -.wp-site-blocks .site-content > .wp-block-group__inner-container > *:not(.align-full):not(.align-wide) { +.wp-site-blocks .site-content > .wp-block-group__inner-container > *:not(.align-full):not(.align-wide):not(.comments-area) { max-width: calc(100% - (2 * 1rem)); margin: 0 1rem; } @media only screen and (min-width: 768px) { - .wp-site-blocks .site-content > .wp-block-group__inner-container > *:not(.align-full):not(.align-wide) { + .wp-site-blocks .site-content > .wp-block-group__inner-container > *:not(.align-full):not(.align-wide):not(.comments-area) { max-width: 80%; margin: 0 10%; padding: 0 60px; diff --git a/twentytwenty-blocks/functions.php b/twentytwenty-blocks/functions.php index e41f798e..7c32c877 100644 --- a/twentytwenty-blocks/functions.php +++ b/twentytwenty-blocks/functions.php @@ -232,7 +232,7 @@ function twentytwentyblocks_theme_support() { */ if ( function_exists( 'register_block_style' ) ) { function twentytwentyblocks_register_block_styles() { - + /** ** Register stylesheet **/ @@ -298,12 +298,16 @@ function twentytwentyblocks_register_styles() { } add_action( 'wp_enqueue_scripts', 'twentytwentyblocks_register_styles' ); -// Load styles in edit-site, -// which doesn't use the add_editor_styles registration mechanism -// so styles aren't wrapped by .editor-styles-wrapper. -function twentytwentyblocks_register_FSE_styles() { - $theme_version = wp_get_theme()->get( 'Version' ); - wp_register_style( 'custom_wp_admin_css', get_template_directory_uri() . '/twentytwenty-styles/editor-style-block.css', false, $theme_version ); - wp_enqueue_style( 'custom_wp_admin_css' ); +/** + * Register Block Patterns. + */ + +if ( function_exists( 'register_block_pattern' ) ) { + register_block_pattern ( + 'twentytwenty-blocks/exhibitions-pattern', + array ( + 'title' => __( 'Two columns of mixed content', 'twentytwenty' ), + 'content' => "\n
\n
\n
\"\"/
\n\n\n\n

Works and Days

\n\n\n\n

August 1 – December 1

\n\n\n\n\n
\n\n\n\n
\n
\"\"/
\n\n\n\n

The Life I Deserve

\n\n\n\n

August 1 – December 1

\n\n\n\n\n
\n
\n", + ) + ); } -add_action( 'admin_enqueue_scripts', 'twentytwentyblocks_register_FSE_styles' );