Skip to content

Commit

Permalink
Merge branch 'trunk' into release-please--branches--trunk--components…
Browse files Browse the repository at this point in the history
…--linchpin-ash
  • Loading branch information
aaronware authored Jun 2, 2023
2 parents d9fc144 + fd26637 commit 5d16b26
Show file tree
Hide file tree
Showing 28 changed files with 2,064 additions and 1,610 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ With its clean, minimal design and powerful feature set, Ash enables agencies to

Download the latest stable release: [ash.zip](https://github.com/linchpin/ash/releases/)


## Requirements

- WordPress 6.2+
Expand All @@ -18,8 +17,8 @@ Download the latest stable release: [ash.zip](https://github.com/linchpin/ash/re
## Dependencies

| Dependency | Version | License | Notes |
|------------|---------|----------------|-----------------------------------------------|
| Frost | 1.0.2 | GPLv2 or later | The base theme Ash was forked from |
| ---------- | ------- | -------------- | --------------------------------------------- |
| Frost | 1.0.3 | GPLv2 or later | The base theme Ash was forked from |
| Husky | 7.0.2 | MIT | Used for commit linting for linchpin projects |

## Getting Started
Expand Down
124 changes: 77 additions & 47 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@
define( 'ASH_THEME_VERSION', '1.0.6' ); // Version number is bumped automatically by release please
// x-release-please-end

define( 'ASH_THEME_NAME', esc_html__( 'Ash', 'Ash' ) );
define( 'ASH_THEME_INC', get_stylesheet_directory() . '/includes/' );
define( 'ASH_THEME_DEBUG', false );
define('ASH_THEME_NAME', esc_html__('Ash', 'Ash'));
define('ASH_THEME_INC', get_stylesheet_directory() . '/includes/');
define('ASH_THEME_DEBUG', false);

if ( ! defined( 'SCRIPT_DEBUG' ) ) {
define( 'SCRIPT_DEBUG', true ); // Enable script debug by default. Should be disabled in production.
if (!defined('SCRIPT_DEBUG')) {
define('SCRIPT_DEBUG', true); // Enable script debug by default. Should be disabled in production.
}

// Define our includes
require_once ASH_THEME_INC . 'utilities.php';
require_once ASH_THEME_INC . 'navigation.php';
require_once ASH_THEME_INC . 'core.php';

if ( ! function_exists( 'ash_setup' ) ) {
if (!function_exists('ash_setup')) {

/**
* Sets up theme defaults and registers support for various WordPress features.
Expand All @@ -41,9 +41,10 @@
*
* @return void
*/
function ash_setup() {
function ash_setup()
{
// Make theme available for translation.
load_theme_textdomain( 'ash', get_template_directory() . '/languages' );
load_theme_textdomain('ash', get_template_directory() . '/languages');

// Enqueue editor styles and fonts.
add_editor_style(
Expand All @@ -53,110 +54,139 @@ function ash_setup() {
);

// Remove core block patterns.
remove_theme_support( 'core-block-patterns' );
remove_theme_support('core-block-patterns');
}
}



add_action( 'after_setup_theme', 'ash_setup' );
add_action('after_setup_theme', 'ash_setup');

// Enqueue style sheet.
add_action( 'wp_enqueue_scripts', 'ash_enqueue_style_sheet' );
add_action('wp_enqueue_scripts', 'ash_enqueue_style_sheet');

function ash_enqueue_style_sheet() {
wp_enqueue_style( 'ash', get_template_directory_uri() . '/css/ash.css', array(), wp_get_theme()->get( 'Version' ) );
function ash_enqueue_style_sheet()
{
wp_enqueue_style('ash', get_template_directory_uri() . '/css/ash.css', array(), wp_get_theme()->get('Version'));
}

/**
* Register block styles.
*
* @since 0.9.2
*/
function ash_register_block_styles() {
function ash_register_block_styles()
{
$block_styles = array(
'core/button' => array(
'fill-base' => __( 'Fill Base', 'ash' ),
'outline-base' => __( 'Outline Base', 'ash' ),
'fill-base' => __('Fill Base', 'ash'),
'outline-base' => __('Outline Base', 'ash'),
),
'core/columns' => array(
'columns-reverse' => __( 'Reverse', 'ash' ),
'columns-reverse' => __('Reverse', 'ash'),
),
'core/group' => array(
'shadow' => __( 'Shadow', 'ash' ),
'shadow-solid' => __( 'Shadow Solid', 'ash' ),
'shadow' => __('Shadow', 'ash'),
'shadow-solid' => __('Solid', 'ash'),
),
'core/list' => array(
'no-disc' => __( 'No Disc', 'ash' ),
'core/image' => array(
'shadow-light' => __('Shadow', 'ash'),
'shadow-solid' => __('Solid', 'ash'),
),
'core/list' => array(
'no-disc' => __('No Disc', 'ash'),
),
'core/navigation-link' => array(
'outline' => __( 'Outline', 'ash' ),
'outline' => __('Outline', 'ash'),
),
'core/social-links' => array(
'outline' => __( 'Outline', 'ash' ),
'outline' => __('Outline', 'ash'),
),
);
}

// Require Composer autoloader if it exists.
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
require_once __DIR__ . '/vendor/autoload.php';
}
add_action( 'init', 'ash_register_block_styles' );
add_action('init', 'ash_register_block_styles');

/**
* Registers block categories, and type.
*
* @since 0.9.2
*/
function ash_register_block_pattern_categories() {
function ash_register_block_pattern_categories()
{
/* Functionality specific to the Block Pattern Explorer plugin. */
if ( function_exists( 'register_block_pattern_category_type' ) ) {
register_block_pattern_category_type( 'ash', array( 'label' => __( 'Ash', 'ash' ) ) );
if (function_exists('register_block_pattern_category_type')) {
register_block_pattern_category_type('ash', array('label' => __('Ash', 'ash')));
}

register_block_pattern_category(
'page',
array(
'label' => __('Page', 'frost'),
'description' => __('Create a full page with multiple patterns that are grouped together.', 'frost'),
)
);
register_block_pattern_category(
'pricing',
array(
'label' => __('Pricing', 'frost'),
'description' => __('Compare features for your digital products or service plans.', 'frost'),
)
);

$block_pattern_categories = array(
'ash-footer' => array(
'label' => __( 'Footer', 'ash' ),
'categoryTypes' => array( 'ash' ),
'label' => __('Footer', 'ash'),
'categoryTypes' => array('ash'),
),
'ash-general' => array(
'label' => __( 'General', 'ash' ),
'categoryTypes' => array( 'ash' ),
'label' => __('General', 'ash'),
'categoryTypes' => array('ash'),
),
'ash-header' => array(
'label' => __( 'Header', 'ash' ),
'categoryTypes' => array( 'ash' ),
'label' => __('Header', 'ash'),
'categoryTypes' => array('ash'),
),
'ash-page' => array(
'label' => __( 'Page', 'ash' ),
'categoryTypes' => array( 'ash' ),
'label' => __('Page', 'ash'),
'categoryTypes' => array('ash'),
),
'ash-query' => array(
'label' => __( 'Query', 'ash' ),
'categoryTypes' => array( 'ash' ),
'label' => __('Query', 'ash'),
'categoryTypes' => array('ash'),
),
'ash-proposals' => array(
'label' => __( 'Proposals', 'ash' ),
'categoryTypes' => array( 'ash' ),
'label' => __('Proposals', 'ash'),
'categoryTypes' => array('ash'),
),
'core/quote' => array(
'shadow-light' => __('Shadow', 'frost'),
'shadow-solid' => __('Solid', 'frost'),
),
'core/social-links' => array(
'outline' => __('Outline', 'frost'),
),
);

foreach ( $block_pattern_categories as $name => $properties ) {
register_block_pattern_category( $name, $properties );
foreach ($block_pattern_categories as $name => $properties) {
register_block_pattern_category($name, $properties);
}
}

add_action( 'init', 'ash_register_block_pattern_categories', 9 );
add_action('init', 'ash_register_block_pattern_categories', 9);

if ( ! function_exists( 'wp_body_open' ) ) {
do_action( 'wp_body_open' );
if (!function_exists('wp_body_open')) {
do_action('wp_body_open');
}

// Kick everything off when plugins are loaded.
try {
Ash\Core\setup();
Ash\Blocks\setup();
} catch ( Exception $e ) {
wp_die( esc_html( $e->getMessage() ) );
} catch (Exception $e) {
wp_die(esc_html($e->getMessage()));
}
17 changes: 17 additions & 0 deletions patterns/general-author-box-contrast-background.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
/**
* Title: Box with image, text, social icons.
* Slug: frost/general-author-box-contrast-background
* Categories: call-to-action
*/
?>
<!-- wp:group {"style":{"spacing":{"padding":{"top":"var:preset|spacing|small","right":"var:preset|spacing|small","bottom":"var:preset|spacing|small","left":"var:preset|spacing|small"},"blockGap":"var:preset|spacing|x-small"},"elements":{"link":{"color":{"text":"var:preset|color|base"}}}},"backgroundColor":"contrast","textColor":"base","layout":{"type":"constrained"}} -->
<div class="wp-block-group has-base-color has-contrast-background-color has-text-color has-background has-link-color" style="padding-top:var(--wp--preset--spacing--small);padding-right:var(--wp--preset--spacing--small);padding-bottom:var(--wp--preset--spacing--small);padding-left:var(--wp--preset--spacing--small)"><!-- wp:avatar {"size":100,"align":"center","style":{"border":{"radius":"50px"}}} /-->
<!-- wp:post-author-name {"textAlign":"center","style":{"typography":{"fontStyle":"normal","fontWeight":"500"},"spacing":{"margin":{"top":"10px"}}},"fontSize":"large"} /-->
<!-- wp:post-author-biography {"textAlign":"center","style":{"spacing":{"margin":{"top":"0px"}},"typography":{"lineHeight":"1.5"}}} /-->
<!-- wp:social-links {"iconColor":"contrast","iconColorValue":"#000000","iconBackgroundColor":"base","iconBackgroundColorValue":"#ffffff","align":"center"} -->
<ul class="wp-block-social-links aligncenter has-icon-color has-icon-background-color"><!-- wp:social-link {"url":"#","service":"twitter"} /-->
<!-- wp:social-link {"url":"#","service":"instagram"} /-->
<!-- wp:social-link {"url":"#","service":"linkedin"} /--></ul>
<!-- /wp:social-links --></div>
<!-- /wp:group -->
17 changes: 17 additions & 0 deletions patterns/general-author-box.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
/**
* Title: Box with image, text, social icons.
* Slug: frost/general-author-box
* Categories: call-to-action
*/
?>
<!-- wp:group {"style":{"border":{"width":"1px"},"spacing":{"padding":{"top":"var:preset|spacing|small","right":"var:preset|spacing|small","bottom":"var:preset|spacing|small","left":"var:preset|spacing|small"},"blockGap":"var:preset|spacing|x-small"}},"borderColor":"contrast","layout":{"type":"constrained"}} -->
<div class="wp-block-group has-border-color has-contrast-border-color" style="border-width:1px;padding-top:var(--wp--preset--spacing--small);padding-right:var(--wp--preset--spacing--small);padding-bottom:var(--wp--preset--spacing--small);padding-left:var(--wp--preset--spacing--small)"><!-- wp:avatar {"size":100,"align":"center","style":{"border":{"radius":"50px"}}} /-->
<!-- wp:post-author-name {"textAlign":"center","style":{"typography":{"fontStyle":"normal","fontWeight":"500"},"spacing":{"margin":{"top":"10px"}}},"fontSize":"large"} /-->
<!-- wp:post-author-biography {"textAlign":"center","style":{"spacing":{"margin":{"top":"0px"}},"typography":{"lineHeight":"1.5"}}} /-->
<!-- wp:social-links {"iconBackgroundColor":"contrast","iconBackgroundColorValue":"#000000","align":"center"} -->
<ul class="wp-block-social-links aligncenter has-icon-background-color"><!-- wp:social-link {"url":"#","service":"twitter"} /-->
<!-- wp:social-link {"url":"#","service":"instagram"} /-->
<!-- wp:social-link {"url":"#","service":"linkedin"} /--></ul>
<!-- /wp:social-links --></div>
<!-- /wp:group -->
Loading

0 comments on commit 5d16b26

Please sign in to comment.