Skip to content
Open
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
15 changes: 15 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
* text=auto

*.css diff=css
*.html diff=html
*.md diff=markdown
*.php diff=php

/.github export-ignore
.composer.lock export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
CHANGELOG-* export-ignore
CODE_OF_CONDUCT.md export-ignore
CONTRIBUTING.md export-ignore
/docs export-ignore
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Handle

[Git Repo](https://github.com/adampatterson/handle)

Handle is a child theme of [Axe](https://github.com/adampatterson/Axe)

Opening `theme-helpers.php` and uncommenting the function
on [line 6](https://github.com/adampatterson/Handle/blob/master/lib/theme-helpers.php#L6) and allows the child theme to
serve all of your themes assets.

If you want to sue a custom data file then all you need to do is rename `/lib/data_rename_to_use.php`
to `/lib/data.php`.
If you want to sue a custom data file then all you need to do is rename `/lib/data.php.bak` to `/lib/data.php`.

To see Handle in action checkout [Blade](https://github.com/adampatterson/Blade)

Expand All @@ -25,7 +26,7 @@ To see Handle in action checkout [Blade](https://github.com/adampatterson/Blade)
│ └── vendor
├── lib/
│ └── ...
│ └── data_rename_to_use.php
│ └── data.php.bak
├── src/
│ └── ...
│ └── js
Expand Down
9 changes: 7 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,17 @@
"source": "https://github.com/adampatterson/Axe"
},
"require": {
"php": "^8.1, ^8.2",
"php": "^8.2|^8.3",
"composer/installers": "^2.0"
},
"autoload": {
"psr-4": {
"Handle\\": "lib"
"Axe\\Handle\\": "lib"
}
},
"config": {
"allow-plugins": {
"composer/installers": true
}
}
}
165 changes: 157 additions & 8 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@
if (class_exists('Handle\\Init')) :
Handle\Init::register_services();
endif;


2 changes: 1 addition & 1 deletion lib/Helpers.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
// Uncommenting this would require all assets to be loaded from the Child theme.
// It will also update the path to all of the parent asset helper functions.
// It will also update the path to all the parent asset helper functions.
/*
function __t($useParent = false)
{
Expand Down
11 changes: 6 additions & 5 deletions lib/Init.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,25 @@ class Init
* Store all the classes inside an array
* @return array Full list of classes
*/
public static function get_services()
public static function get_services(): array
{
return [
Init::class,
Custom\Media::class,
Models\Options::class,
Models\Content::class,
// Custom\Network::class, // Is this a network site?
// Is this a network site?
// Custom\Network::class,
Setup\Admin::class,
Custom::class
Custom::class,
];
}

/**
* Loop through the classes, initialize them, and call the register() method if it exists
* @return
*/
public static function register_services()
public static function register_services(): void
{
foreach (self::get_services() as $class) {
$service = self::instantiate($class);
Expand All @@ -39,7 +40,7 @@ public static function register_services()
/**
* Initialize the class
*
* @param class $class class from the services array
* @param class $class class from the services array
*
* @return class instance new instance of the class
*/
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions style.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*!
Theme Name: Handle
Template: Axe
Theme URI: https://github.com/adampatterson/Handle
GitHub Plugin URI: https://github.com/adampatterson/Handle
Theme URI: https://github.com/adampatterson/handle
GitHub Plugin URI: https://github.com/adampatterson/handle
Author: Adam Patterson
Author URI: https://adampatterson.ca
Update URI: false
Expand Down