Skip to content

Commit

Permalink
Merge pull request #206 from studiopress/develop
Browse files Browse the repository at this point in the history
Genesis Sample 2.9.0
  • Loading branch information
nickcernis authored Mar 14, 2019
2 parents 3755f6e + ed70b97 commit 452ab98
Show file tree
Hide file tree
Showing 37 changed files with 1,114 additions and 3,606 deletions.
31 changes: 31 additions & 0 deletions .scripts/md-to-txt.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env node

// This script renames the Markdown files in the generated zip file to use a
// .txt extension. This is useful to adhere to WordPress theme standards and
// to reduce support requests asking what an `.md` file is.

const chalk = require('chalk');
const admzip = require('adm-zip');

console.log(chalk`{cyan Renaming .md files to .txt files inside the zip}...`);

// Create a zip object to manipulate the existing zip file.
const zip = new admzip(`${process.env.npm_package_name}.zip`);
const newZip = new admzip(`${process.env.npm_package_name}.zip`);
const zipEntries = zip.getEntries();
const themeSlug = process.env.npm_package_name;

for (let entry of zipEntries) {
if (entry.entryName === `${themeSlug}/README.md`) {
newZip.addFile(`${themeSlug}/README.txt`, zip.readAsText(entry.entryName));
newZip.deleteFile(entry.entryName);
}
if (entry.entryName === `${themeSlug}/CHANGELOG.md`) {
newZip.addFile(`${themeSlug}/CHANGELOG.txt`, zip.readAsText(entry.entryName));
newZip.deleteFile(entry.entryName);
}
}

newZip.writeZip(); // Overwrites existing zip.

console.log(chalk`{cyan Done renaming .md files to .txt. Please test the new zip file}...`);
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Genesis Sample Theme Changelog

## [2.9.0] - 2019-03-14
Requires Genesis 2.9.0+.

* Added: Additional pages are created during One-Click Theme Setup.
* Added: A menu is set up during One-Click Theme Setup.
* Added: Install and activate WPForms Lite, Genesis eNews Extended, and Simple Social Icons during One-Click Theme Setup.
* Changed: Added Customizer colors to the Block Editor color palette.
* Changed: Use `theme-primary` and `theme-secondary` slugs for Block Editor color palette to prevent possible loss of styling when switching themes. We are now using this convention for new StudioPress theme releases and updates and encourage theme developers to do the same.
* Changed: Removed gray colors from the Block Editor color palette.
* Changed: Generate inline styles for the Block Editor from theme supports, reducing manual Block Editor CSS required. See `lib/gutenberg/inline-styles.php` and https://github.com/studiopress/genesis-sample/pull/198.
* Changed: The default button block color is now blue and not gray.
* Changed: Combined all Block Editor config into a single file at `config/block-editor-settings.php`.
* Changed: Removed the XML sample content file. You can import sample content via One-Click Theme Setup by visiting `/wp-admin/admin.php?page=genesis-getting-started` instead.
* Changed: CSS adjustments including button, blockquote, latest posts block, and WPForms styling.
* Changed: improvements to CSS and PHP coding standards.

## [2.8.0] - 2019-01-16
Requires Genesis 2.8.0+.

Expand Down
1 change: 1 addition & 0 deletions config/accessibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/**
* Genesis Sample child theme.
*
* @package Genesis Sample
* @author StudioPress
* @license GPL-2.0-or-later
* @link https://my.studiopress.com/themes/genesis-sample/
Expand Down
56 changes: 56 additions & 0 deletions config/block-editor-settings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php
/**
* Block Editor settings specific to Genesis Sample.
*
* @package Genesis Sample
* @author StudioPress
* @license GPL-2.0-or-later
* @link https://www.studiopress.com/
*/

$genesis_sample_link_color = get_theme_mod( 'genesis_sample_link_color', genesis_sample_customizer_get_default_link_color() );
$genesis_sample_link_color_contrast = genesis_sample_color_contrast( $genesis_sample_link_color );
$genesis_sample_link_color_brightness = genesis_sample_color_brightness( $genesis_sample_link_color, 35 );

return array(
'admin-fonts-url' => 'https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,700',
'content-width' => 1062,
'default-button-bg' => $genesis_sample_link_color,
'default-button-color' => $genesis_sample_link_color_contrast,
'default-button-outline-hover' => $genesis_sample_link_color_brightness,
'default-link-color' => $genesis_sample_link_color,
'editor-color-palette' => array(
array(
'name' => __( 'Custom color', 'genesis-sample' ), // Called “Link Color” in the Customizer options. Renamed because “Link Color” implies it can only be used for links.
'slug' => 'theme-primary',
'color' => get_theme_mod( 'genesis_sample_link_color', genesis_sample_customizer_get_default_link_color() ),
),
array(
'name' => __( 'Accent color', 'genesis-sample' ),
'slug' => 'theme-secondary',
'color' => get_theme_mod( 'genesis_sample_accent_color', genesis_sample_customizer_get_default_accent_color() ),
),
),
'editor-font-sizes' => array(
array(
'name' => __( 'Small', 'genesis-sample' ),
'size' => 12,
'slug' => 'small',
),
array(
'name' => __( 'Normal', 'genesis-sample' ),
'size' => 18,
'slug' => 'normal',
),
array(
'name' => __( 'Large', 'genesis-sample' ),
'size' => 20,
'slug' => 'large',
),
array(
'name' => __( 'Larger', 'genesis-sample' ),
'size' => 24,
'slug' => 'larger',
),
),
);
32 changes: 32 additions & 0 deletions config/child-theme-settings-genesis.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php
/**
* Genesis Sample settings specific to Genesis.
*
* Used in `config/child-theme-settings.php` and `lib/theme-defaults.php`.
*
* Can be removed when the Genesis Theme Settings page is removed from WP admin.
*
* @package Genesis Sample
* @author StudioPress
* @license GPL-2.0-or-later
* @link https://www.studiopress.com/
*/

return array(
'blog_cat_num' => 6,
'breadcrumb_home' => 0,
'breadcrumb_front_page' => 0,
'breadcrumb_posts_page' => 0,
'breadcrumb_single' => 0,
'breadcrumb_page' => 0,
'breadcrumb_archive' => 0,
'breadcrumb_404' => 0,
'breadcrumb_attachment' => 0,
'content_archive' => 'full',
'content_archive_limit' => 0,
'content_archive_thumbnail' => 0,
'image_size' => '',
'image_alignment' => 'alignleft',
'posts_nav' => 'numeric',
'site_layout' => 'content-sidebar',
);
16 changes: 16 additions & 0 deletions config/child-theme-settings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
/**
* Genesis Sample theme settings.
*
* Genesis 2.9+ updates these settings when themes are activated.
*
* @package Genesis Sample
* @author StudioPress
* @license GPL-2.0-or-later
* @link https://www.studiopress.com/
*/

return array(
GENESIS_SETTINGS_FIELD => genesis_get_config( 'child-theme-settings-genesis' ),
'posts_per_page' => 6,
);
1 change: 1 addition & 0 deletions config/custom-logo.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/**
* Genesis Sample child theme.
*
* @package Genesis Sample
* @author StudioPress
* @license GPL-2.0-or-later
* @link https://my.studiopress.com/themes/genesis-sample/
Expand Down
29 changes: 0 additions & 29 deletions config/editor-color-palette.php

This file was deleted.

34 changes: 0 additions & 34 deletions config/editor-font-sizes.php

This file was deleted.

1 change: 1 addition & 0 deletions config/html5.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/**
* Genesis Sample child theme.
*
* @package Genesis Sample
* @author StudioPress
* @license GPL-2.0-or-later
* @link https://my.studiopress.com/themes/genesis-sample/
Expand Down
59 changes: 59 additions & 0 deletions config/import/content/about.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php
/**
* Genesis Sample.
*
* About page content optionally installed after theme activation.
*
* Visit `/wp-admin/admin.php?page=genesis-getting-started` to trigger import.
*
* @package Genesis Sample
* @author StudioPress
* @license GPL-2.0-or-later
* @link https://www.studiopress.com/
*/

// Photo by Fabrice Villard on Unsplash.
$genesis_sample_about_image_url = CHILD_URL . '/config/import/images/about.jpg';

return <<<CONTENT
<!-- wp:atomic-blocks/ab-spacer {"spacerHeight":70} -->
<div style="color:#ddd" class="wp-block-atomic-blocks-ab-spacer ab-block-spacer ab-divider-solid ab-divider-size-1"><hr style="height:70px"/></div>
<!-- /wp:atomic-blocks/ab-spacer -->
<!-- wp:image {"id":2141,"align":"center"} -->
<div class="wp-block-image"><figure class="aligncenter"><img src="$genesis_sample_about_image_url" alt="" class="wp-image-2141"/></figure></div>
<!-- /wp:image -->
<!-- wp:atomic-blocks/ab-spacer {"spacerHeight":29} -->
<div style="color:#ddd" class="wp-block-atomic-blocks-ab-spacer ab-block-spacer ab-divider-solid ab-divider-size-1"><hr style="height:29px"/></div>
<!-- /wp:atomic-blocks/ab-spacer -->
<!-- wp:columns -->
<div class="wp-block-columns has-2-columns"><!-- wp:column -->
<div class="wp-block-column"><!-- wp:heading {"level":1} -->
<h1>About Us</h1>
<!-- /wp:heading -->
<!-- wp:paragraph -->
<p>Hello! We are StudioPress, and we build themes with an emphasis on typography, white space, and mobile-optimized design to make your website look absolutely breathtaking. </p>
<!-- /wp:paragraph --></div>
<!-- /wp:column -->
<!-- wp:column -->
<div class="wp-block-column"><!-- wp:heading {"align":"right"} -->
<h2 style="text-align:right" id="mce_9">Contact Us</h2>
<!-- /wp:heading -->
<!-- wp:paragraph {"align":"right"} -->
<p style="text-align:right"> 555.555.5555</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph {"align":"right"} -->
<p style="text-align:right">
1234 Block Blvd.<br>San Francisco, CA 94120
</p>
<!-- /wp:paragraph --></div>
<!-- /wp:column --></div>
<!-- /wp:columns -->
CONTENT;
Loading

0 comments on commit 452ab98

Please sign in to comment.