Skip to content

Commit

Permalink
Merge pull request #48 from BlackbirdDigital/feature/humans-txt
Browse files Browse the repository at this point in the history
Feature/humans txt
  • Loading branch information
cr0ybot authored Oct 24, 2022
2 parents 20003ad + 004cb4c commit 7ef46f0
Show file tree
Hide file tree
Showing 55 changed files with 201 additions and 123 deletions.
2 changes: 1 addition & 1 deletion 404.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @link https://codex.wordpress.org/Creating_an_Error_404_Page
*
* @package theme-scaffold
* @package themescaffold
*/

get_header();
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ A theme scaffold that is theme.json-ready for WordPress 5.8+ and includes a buil
## Getting Started

1. Download this repository and place the folder into your local `wp-content/themes/` directory.
2. Rename the folder to your theme's slug
2. Rename the folder to your theme's slug.
3. Run a few search & replace actions:
1. Theme Scaffold: Theme name, title-case with spaces.
*It is recommended to ignore README.md and humans.txt*
1. WP Theme Scaffold: Theme name, title-case with spaces.
2. ThemeScaffold: Theme namespace, pascal-case (no spaces).
3. theme-scaffold: Theme slug, package name, text domain, and block namespace, lower-case with dashes.
3. themescaffold: Theme slug, package name, text domain, and block namespace, lower-case with dashes.
4. theme_scaffold: Function "namespace", lower-case with underscores.
4. Edit the `style.css` file to include your Author/URL information
5. Remove the scaffold info from the top portion of this README
4. Edit the `style.css` file to include your Author/URL information.
5. Edit the `humans.txt` file to include your team information.
6. Remove the scaffold info from the top portion of this README.

## Agency-focused Theme Scaffold

Expand Down
2 changes: 1 addition & 1 deletion archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package theme-scaffold
* @package themescaffold
*/

get_header();
Expand Down
8 changes: 4 additions & 4 deletions comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package theme-scaffold
* @package themescaffold
*/

/*
Expand All @@ -31,13 +31,13 @@
if ( '1' === $theme_scaffold_comment_count ) {
printf(
/* translators: 1: title. */
esc_html__( 'One thought on “%1$s”', 'theme-scaffold' ),
esc_html__( 'One thought on “%1$s”', 'themescaffold' ),
'<span>' . wp_kses_post( get_the_title() ) . '</span>'
);
} else {
printf(
/* translators: 1: comment count number, 2: title. */
esc_html( _nx( '%1$s thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', $theme_scaffold_comment_count, 'comments title', 'theme-scaffold' ) ),
esc_html( _nx( '%1$s thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', $theme_scaffold_comment_count, 'comments title', 'themescaffold' ) ),
number_format_i18n( $theme_scaffold_comment_count ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
'<span>' . wp_kses_post( get_the_title() ) . '</span>'
);
Expand All @@ -64,7 +64,7 @@
// If comments are closed and there are comments, let's leave a little note, shall we?
if ( ! comments_open() ) :
?>
<p class="comments__closed"><?php esc_html_e( 'Comments are closed.', 'theme-scaffold' ); ?></p>
<p class="comments__closed"><?php esc_html_e( 'Comments are closed.', 'themescaffold' ); ?></p>
<?php
endif;

Expand Down
4 changes: 2 additions & 2 deletions components/menu-toggle.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Component: menu-toggle.
*
* @package theme-scaffold
* @package themescaffold
*/

use function ThemeScaffold\Utilities\array_subset;
Expand All @@ -13,7 +13,7 @@
'id' => null,
'aria-controls' => '',
'aria-expanded' => false,
'aria-label' => esc_attr__( 'Toggle Menu', 'theme-scaffold' ),
'aria-label' => esc_attr__( 'Toggle Menu', 'themescaffold' ),
);

$args = wp_parse_args( $args, $defaults );
Expand Down
2 changes: 1 addition & 1 deletion footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package theme-scaffold
* @package themescaffold
*/

?>
Expand Down
2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package theme-scaffold
* @package themescaffold
*/

/**
Expand Down
4 changes: 2 additions & 2 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package theme-scaffold
* @package themescaffold
*/

?>
Expand All @@ -23,6 +23,6 @@
<body <?php body_class(); ?>>
<?php wp_body_open(); ?>
<div id="page" class="site">
<a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'theme-scaffold' ); ?></a>
<a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'themescaffold' ); ?></a>

<?php get_template_part( 'template-parts/site/header' ); ?>
42 changes: 42 additions & 0 deletions humans.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
_____ _ _ _ _ _ ____ _ _ _ _
| _ \ | __ _ ___| | _| |__ (_)_ __ __| | | _ \(_) __ _(_) |_ __ _| |
| _ / |/ _` |/ __| |/ / '_ \| | '__/ _` | | | \ \ |/ _` | | __/ _` | |
| |_) \ | (_| | (__| <| |_) | | | | (_| | | |_/ / | (_| | | || (_| | |
|_____/_|\__,_|\___|_|\_\_.__/|_|_| \__,_| |____/|_|\__, |_|\__\__,_|_|
|___/


/* TEAM */

Company: Blackbird Digital
Website: https://blackbird.digital/
Email: info@blackbird.digital
GitHub: https://github.com/BlackbirdDigital
Twitter: @Blackbird_DGTL @InTheLoop_WP
Facebook: https://www.facebook.com/blackbirdinteractive
Instagram: https://www.instagram.com/blackbird.digital/
Podcast: https://anchor.fm/blackbird-digital
Location: Cleveland, OH

Owner/CEO: Pat Walsh @patwalsh
Lead Developer: Cory Hughart @cr0ybot
Senior Developer: Phil Hoyt @philhoyt
Senior Designer: Jack Watson @jackwatson05


/* TOOLS */

This site was built with Blackbird Digital's WordPress Theme Scaffold:
https://github.com/BlackbirdDigital/wp-theme-scaffold


/* ABOUT */

Blackbird Digital is a small, versatile team of creatives making custom websites
and apps for our clients with WordPress and React Native.

Always chasing the cutting-edge, we are constantly honing our craft and
contributing back to the open-source projects that enable our success.


/* humanstxt.org */
2 changes: 1 addition & 1 deletion inc/acf-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @link https://www.advancedcustomfields.com/resources/acf_register_block_type/
*
* @package theme-scaffold
* @package themescaffold
*/

namespace ThemeScaffold\ACFBlocks;
Expand Down
8 changes: 4 additions & 4 deletions inc/block-patterns.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-patterns/
*
* @package theme-scaffold
* @package themescaffold
*/

namespace ThemeScaffold\BlockPatterns;
Expand All @@ -15,10 +15,10 @@
function register() {
/*
register_block_pattern(
'theme-scaffold/example-pattern',
'themescaffold/example-pattern',
array(
'title' => __( 'Example Pattern', 'theme-scaffold') ,
'description' => __( 'An example block pattern.', 'theme-scaffold' ),
'title' => __( 'Example Pattern', 'themescaffold') ,
'description' => __( 'An example block pattern.', 'themescaffold' ),
'content' => '<!-- wp:paragraph --><p>Hello world.</p><!-- /wp:paragraph -->',
)
);
Expand Down
6 changes: 3 additions & 3 deletions inc/block-styles.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Block style registrations.
*
* @package theme-scaffold
* @package themescaffold
*/

namespace ThemeScaffold\BlockStyles;
Expand All @@ -17,7 +17,7 @@ function register() {
array(
'name' => 'lead',
'label' => 'Lead Paragraph',
'style' => 'theme-scaffold-style',
'style' => 'themescaffold-style',
)
);

Expand All @@ -27,7 +27,7 @@ function register() {
array(
'name' => 'plain',
'label' => 'Plain',
'style' => 'theme-scaffold-style',
'style' => 'themescaffold-style',
)
);
}
Expand Down
2 changes: 1 addition & 1 deletion inc/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Block registrations.
*
* @package theme-scaffold
* @package themescaffold
*/

namespace ThemeScaffold\Blocks;
Expand Down
4 changes: 2 additions & 2 deletions inc/customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Theme Customizer
*
* @package theme-scaffold
* @package themescaffold
*/

namespace ThemeScaffold\Customizer;
Expand Down Expand Up @@ -59,6 +59,6 @@ function partial_blogdescription() {
*/
function preview_js() {
$customizerjs_asset = require get_template_directory() . '/dist/js/customizer.asset.php';
wp_enqueue_script( 'theme-scaffold-customizer', get_template_directory_uri() . '/js/customizer.js', array_merge( array( 'customize-preview' ), $customizerjs_asset['dependencies'] ), $customizerjs_asset['version'], true );
wp_enqueue_script( 'themescaffold-customizer', get_template_directory_uri() . '/js/customizer.js', array_merge( array( 'customize-preview' ), $customizerjs_asset['dependencies'] ), $customizerjs_asset['version'], true );
}
add_action( 'customize_preview_init', __NAMESPACE__ . '\\preview_js' );
25 changes: 24 additions & 1 deletion inc/hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Functions which enhance the theme by hooking into WordPress.
*
* @package theme-scaffold
* @package themescaffold
*/

namespace ThemeScaffold\Hooks;
Expand Down Expand Up @@ -59,3 +59,26 @@ function pingback_header() {
}
}
add_action( 'wp_head', __NAMESPACE__ . '\\pingback_header' );

/**
* Render humans.txt at /humans.txt URL.
*/
function render_humans_txt() {
if ( $_SERVER['REQUEST_URI'] === '/humans.txt' ) {
header( 'Content-Type: text/plain; charset=utf-8' );
include get_template_directory() . '/humans.txt';
exit();
}
}
add_action( 'parse_request', __NAMESPACE__ . '\\render_humans_txt' );

/**
* Add humans.txt link to head.
*/
function link_humans_txt() {
printf(
'<link rel="author" type="text/plain" href="%s" />',
esc_url( home_url( 'humans.txt' ) )
);
}
add_action( 'wp_head', __NAMESPACE__ . '\\link_humans_txt', 1 );
20 changes: 10 additions & 10 deletions inc/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Theme setup.
*
* @package theme-scaffold
* @package themescaffold
*/

namespace ThemeScaffold\Setup;
Expand All @@ -21,10 +21,10 @@ function setup() {
/**
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on theme-scaffold, use a find and replace
* to change 'theme-scaffold' to the name of your theme in all the template files.
* If you're building a theme based on themescaffold, use a find and replace
* to change 'themescaffold' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'theme-scaffold', get_template_directory() . '/languages' );
load_theme_textdomain( 'themescaffold', get_template_directory() . '/languages' );

// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
Expand Down Expand Up @@ -100,10 +100,10 @@ function setup() {
function menus() {
register_nav_menus(
array(
'primary' => esc_html__( 'Primary', 'theme-scaffold' ),
'secondary' => esc_html__( 'Secondary', 'theme-scaffold' ),
'primary-footer' => esc_html__( 'Footer Primary', 'theme-scaffold' ),
'secondary-footer' => esc_html__( 'Footer Secondary', 'theme-scaffold' ),
'primary' => esc_html__( 'Primary', 'themescaffold' ),
'secondary' => esc_html__( 'Secondary', 'themescaffold' ),
'primary-footer' => esc_html__( 'Footer Primary', 'themescaffold' ),
'secondary-footer' => esc_html__( 'Footer Secondary', 'themescaffold' ),
)
);
}
Expand All @@ -117,9 +117,9 @@ function menus() {
function widget_areas() {
register_sidebar(
array(
'name' => esc_html__( 'Footer', 'theme-scaffold' ),
'name' => esc_html__( 'Footer', 'themescaffold' ),
'id' => 'footer',
'description' => esc_html__( 'Footer blocks.', 'theme-scaffold' ),
'description' => esc_html__( 'Footer blocks.', 'themescaffold' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '<h2 class="widget-title">',
Expand Down
2 changes: 1 addition & 1 deletion inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Note: functions defined here are not namespaced!
*
* @package theme-scaffold
* @package themescaffold
*/

if ( ! function_exists( 'wp_body_open' ) ) :
Expand Down
4 changes: 2 additions & 2 deletions inc/utilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* use function ThemeScaffold\Utilities\debug;
* debug( $foo );
*
* @package theme-scaffold
* @package themescaffold
*/

namespace ThemeScaffold\Utilities;
Expand Down Expand Up @@ -69,7 +69,7 @@ function debug( $var ) {
* @param string $name Asset file name without extension.
*/
function get_asset_handle( string $name ) {
return 'theme-scaffold-' . $name;
return 'themescaffold-' . $name;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package theme-scaffold
* @package themescaffold
*/

get_header();
Expand Down
Loading

0 comments on commit 7ef46f0

Please sign in to comment.