Initial commit

This commit is contained in:
2025-05-05 16:37:15 -07:00
parent 374c77fece
commit a305d8f795
24 changed files with 7227 additions and 0 deletions

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 Open Function Computers, LLC
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

46
README.md Normal file
View File

@@ -0,0 +1,46 @@
# Starter Theme
<a href="https://github.com/open-function-computers-llc/rad-theme-engine">
<img width="250" align="right" src="images/RADLogos/RAD-Logo-2-OFCO.png">
</a>
This repository contains the files that `composer create` will download into your new __[rad-theme-engine](https://github.com/open-function-computers-llc/rad-theme-engine)__ theme.
📦 &nbsp;[View on Packagist](https://packagist.org/packages/open-function-computers-llc/rad-theme-engine) <br>
📃 &nbsp;[Read the Docs](https://rad-theme-engine.ofco.cloud/)
<br>
## Usage
Inside of your site's `wp-content/themes`, run the following command:
```
composer create-project open-function-computers-llc/wp-theme <theme-name>
```
Then enter your new theme's directory and get dependancies:
```
cd <theme-name>
npm install
```
And that's it! Read about what to do next on [the docs](https://rad-theme-engine.ofco.cloud/).
<br>
## Security notes
The /vendor directory is blocked from public access by Apache by the included .htaccess file.
If you're using NGINX, you can add this to your virtual host
```
location ^~ /vendor/ {
deny all;
return 403;
}
```
## License
Licensed under the MIT license, see [LICENSE](https://github.com/open-function-computers-llc/wp-theme/blob/main/LICENSE).

0
acf-json/.gitkeep Normal file
View File

0
assets/.gitkeep Normal file
View File

15
composer.json Normal file
View File

@@ -0,0 +1,15 @@
{
"name": "open-function-computers-llc/wp-theme",
"description": "A starting point to make working with rad-theme-engine easier",
"require": {
"open-function-computers-llc/rad-theme-engine": "^1.0"
},
"autoload": {
"psr-4": {
"Helpers\\": "helpers/"
}
},
"license": "MIT",
"keywords": ["wordpress", "handlebars", "theme"],
"minimum-stability": "stable"
}

169
composer.lock generated Normal file
View File

@@ -0,0 +1,169 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "3607194100d6f07e79a6cf21cb37ba8f",
"packages": [
{
"name": "jjgrainger/posttypes",
"version": "v2.2.1",
"source": {
"type": "git",
"url": "https://github.com/jjgrainger/PostTypes.git",
"reference": "2f20f628ec44404960df4b1ae5d623397a66aec1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/jjgrainger/PostTypes/zipball/2f20f628ec44404960df4b1ae5d623397a66aec1",
"reference": "2f20f628ec44404960df4b1ae5d623397a66aec1",
"shasum": ""
},
"require": {
"php": ">=7.2"
},
"require-dev": {
"phpunit/phpunit": "^9.6",
"squizlabs/php_codesniffer": "3.*"
},
"type": "library",
"autoload": {
"psr-4": {
"PostTypes\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Joe Grainger",
"homepage": "https://jjgrainger.co.uk"
}
],
"description": "Simple WordPress custom post types.",
"homepage": "https://posttypes.jjgrainger.co.uk",
"keywords": [
"post-types",
"wordpress"
],
"support": {
"issues": "https://github.com/jjgrainger/posttypes/issues",
"source": "https://github.com/jjgrainger/posttypes"
},
"time": "2024-10-13T17:23:48+00:00"
},
{
"name": "open-function-computers-llc/rad-theme-engine",
"version": "v1.0.25",
"source": {
"type": "git",
"url": "https://github.com/open-function-computers-llc/rad-theme-engine.git",
"reference": "59e337a405555e2eff7aca8de1da9714077aab96"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/open-function-computers-llc/rad-theme-engine/zipball/59e337a405555e2eff7aca8de1da9714077aab96",
"reference": "59e337a405555e2eff7aca8de1da9714077aab96",
"shasum": ""
},
"require": {
"jjgrainger/posttypes": "^2.1",
"php": ">=7.4",
"salesforce/handlebars-php": "^2.3"
},
"require-dev": {
"phpunit/phpunit": "^9.5"
},
"type": "library",
"autoload": {
"psr-4": {
"ofc\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "A suite of classes to make WordPress theme development cleaner",
"keywords": [
"handlebars",
"theme",
"wordpress"
],
"support": {
"issues": "https://github.com/open-function-computers-llc/rad-theme-engine/issues",
"source": "https://github.com/open-function-computers-llc/rad-theme-engine/tree/v1.0.25"
},
"time": "2024-01-25T19:02:08+00:00"
},
{
"name": "salesforce/handlebars-php",
"version": "2.3.0",
"source": {
"type": "git",
"url": "https://github.com/salesforce/handlebars-php.git",
"reference": "59fc47c7b2701659cb483d0f3461c4f712693b2b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/salesforce/handlebars-php/zipball/59fc47c7b2701659cb483d0f3461c4f712693b2b",
"reference": "59fc47c7b2701659cb483d0f3461c4f712693b2b",
"shasum": ""
},
"require": {
"php": ">=5.4.0"
},
"require-dev": {
"phpunit/phpunit": "^4"
},
"type": "library",
"autoload": {
"psr-0": {
"Handlebars": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "fzerorubigd",
"email": "fzerorubigd@gmail.com"
},
{
"name": "Behrooz Shabani (everplays)",
"email": "everplays@gmail.com"
},
{
"name": "Mardix",
"homepage": "https://github.com/mardix"
}
],
"description": "Handlebars processor for php",
"homepage": "http://www.github.com/salesforce/handlebars-php",
"keywords": [
"handlebars",
"mustache",
"templating"
],
"support": {
"issues": "https://github.com/salesforce/handlebars-php/issues",
"source": "https://github.com/salesforce/handlebars-php/tree/2.3.0"
},
"time": "2020-06-08T17:23:52+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
"plugin-api-version": "2.6.0"
}

74
config.php Normal file
View File

@@ -0,0 +1,74 @@
<?php
return [
/**
* excerpt-length
*
* how many words should the wordpress excerpt be
*/
"excerpt-length" => 100,
/**
* guest-class
*
* if you want wordpress to automatically append a class to the body_class
* list when users are not authenticated, put that class name here. it
* defaults to "guest"
*/
"guest-class" => "guest",
/**
* menu-locations
*
* register your individual menu locations here
*/
"menu-locations" => [
"main-nav" => "Main Navigation",
],
/**
* custom-post-types
*
* here is where you can define your custom post types easily
*/
"custom-post-types" => [],
/**
* handlebars
*
* We use handlebars templating extensivly in this theme and code pattern.
* You can adjust the defaults for many attributes here.
*
* Set this to `false` to disable handlebars functionality completely
*/
"handlebars" => [
"additional-helpers" => [
"formatDate" => \Helpers\DateFormatter::monthDayYear(),
],
],
/**
* enable
*
* enable individual wordpress features here
*/
"enable" => [
"post-thumbnails",
"menus",
],
/**
* disable
*
* disable individual wordpress features here
*/
"disable" => [
"editor",
],
];

11
footer.php Normal file
View File

@@ -0,0 +1,11 @@
<?php
// This file should close out the <body> tag and will be used by WordPress
// at the end of each page render. Make sure your handlebars template includes
// the helper {{#wp-footer}} otherwise you should call wp_footer() here in the
// php file.
echo site()->render("footer", [
"powered-by" => "ofco-rad-theme-engine",
"powered-by-url" => "https://github.com/open-function-computers-llc/rad-theme-engine",
"year" => date("Y"),
]);

16
functions.php Normal file
View File

@@ -0,0 +1,16 @@
<?php
# Imports all Composer packages
require __DIR__ . '/vendor/autoload.php';
use ofc\Site;
# Declare a new Site object
$site = new Site();
# Allow the Site object to be accessed in other files
function site()
{
global $site;
return $site;
}

8
header.php Normal file
View File

@@ -0,0 +1,8 @@
<?php
// This file will build the HTML <head> section like a typical custom WordPress
// theme. It will also include the opening body tag, and all expected function
// calls are handled for you by the custom Handlerbar helpers that come with
// RAD. Check out the docs here:
// https://rad-theme-engine.ofco.cloud/docs/guides/helpers/
echo site()->render("header");

15
helpers/DateFormatter.php Normal file
View File

@@ -0,0 +1,15 @@
<?php
namespace Helpers;
class DateFormatter
{
public static function monthDayYear()
{
return function ($template, $context, $args, $source) {
$dateString = strtotime($context->get($args));
return date("M d, Y", $dateString);
};
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

15
index.php Normal file
View File

@@ -0,0 +1,15 @@
<?php
// First, render the page header. You'll likely do this on every custom theme
// php file.
get_header();
// Next, gather any data that you want, and pass it to the render method to bind
// your data to a template file. In the example below, the ./tpl/index.tpl file
// will be given the current page content, and today's timestamp.
echo site()->render("index", [
"post" => site()->getCurrentPost(["content", "title", "published_at"]),
"now" => date("Y-m-d H:i:s"),
]);
// ...and finally, make sure you close out your page render the WordPress way!
get_footer();

6643
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

22
package.json Normal file
View File

@@ -0,0 +1,22 @@
{
"name": "ofc-wp-theme",
"version": "1.0.0",
"description": "Laravel Mix Asset Bundler for open-function-computers-llc/rad-theme-engine",
"dependencies": {
"bootstrap": "^5.0.1",
"jquery": "^3.6.0",
"laravel-mix": "^6.0.19",
"postcss": "^8.2.15",
"resolve-url-loader": "^3.1.3",
"sass": "^1.32.13",
"sass-loader": "^11.1.1",
"slick-carousel": "^1.8.1",
"vue": "^2.6.12",
"vue-loader": "^15.9.7",
"vue-template-compiler": "^2.6.12",
"vue2-google-maps": "^0.10.7"
},
"devDependencies": {},
"author": "",
"license": "MIT"
}

BIN
screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

0
src/js/app.js Normal file
View File

2
src/scss/app.scss Normal file
View File

@@ -0,0 +1,2 @@
// dependancies - bootstrap
@import "../../node_modules/bootstrap/scss/bootstrap";

54
style.css Normal file
View File

@@ -0,0 +1,54 @@
/*
Theme Name: OFC Rad Theme Engine
Author: Open Function Computers, LLC
Author URI: https://openfunctioncomputers.com
Description: Custom theme starting point
Requires at least: 5.7
Requires PHP: 7.4
Version: 1.0
Text Domain: ofc
*/
@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&family=Roboto:ital,wght@0,300;0,400;0,500;0,700;1,400;1,500&display=swap");
.title-logo {
max-width: 350px;
width: 100%;
}
body{
text-align: center;
background-color: #212529;
}
p{
font-family:"Roboto", sans-serif;
color:lightgray;
}
h1{
font-family:"Roboto", sans-serif;
color:#ee0099;
font-style: italic;
text-decoration: none;
font-size:3em;
}
h2{
font-family:"Roboto", sans-serif;
color:lightgray;
}
#rad-tag{
font-family:"Roboto", sans-serif;
font-weight: bold;
/* font-style: italic; */
color: lightgray;
}
a {
text-decoration: none;
}
.bottom-link{
color: #ee0099;
}
hr {
border-color: #343a40;
}

0
tpl/.gitkeep Normal file
View File

10
tpl/footer.tpl Normal file
View File

@@ -0,0 +1,10 @@
{{#wp-footer}}
<footer class="site-footer mt-5">
<div class="container">
<p class="text-center">&copy; {{ year }}. Powered by <a id="bottom-link" href="{{ powered-by-url }}" target="_blank">{{ powered-by }}</a></p>
</div>
</footer>
</body>
</html>

61
tpl/header.tpl Normal file
View File

@@ -0,0 +1,61 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{#wp-title}}</title>
<!-- the following CSS is included for a fancy pants intro page. Feel free
to delete it! -->
<link rel="preconnect" href="https://fonts.bunny.net">
<link href="https://fonts.bunny.net/css?family=montserrat:400,400i,700,700i" rel="stylesheet" />
<style>
* {
font-family: 'Montserrat', sans-serif;
}
body, html {
background-color: #212529;
color: #dee2e6;
font-size: 1.1rem;
line-height: 1.5;
}
.container {
max-width: 900px;
padding: 0 1rem;
display: block;
margin: 0 auto;
}
a {
color: #f472b6;
text-decoration: none;
}
.text-center {
text-align: center;
}
.m-0 {
margin: 0;
}
.mb-4 {
margin-bottom: 1.25rem;
}
code {
font-family: monospace;
color: white;
background-color: black;
display: inline-block;
line-height: 1.1;
font-size: 1rem;
padding: 2px 4px;
}
.outro h2 {
font-size: 1.2rem;
}
footer {
font-size: .8rem;
}
</style>
{{#wp-header}}
</head>
<body {{#body-classes}}>

39
tpl/index.tpl Normal file
View File

@@ -0,0 +1,39 @@
<section class="intro">
<div class="container">
<h1 class="text-center">
<a href = "https://rad-theme-engine.ofco.cloud/" target = "_blank">Welcome to Rad Theme Engine!</a>
</h1>
<div class="col-lg-12 text-center mb-4">
<a href = "https://rad-theme-engine.ofco.cloud/" target = "_blank">
<h1>
<img class="title-logo" src="https://rad-theme-engine.ofco.cloud/images/rebrand/Rad%20Logo%201%20OF-TOP.png" alt="Check out the RAD Theme Engine Docs">
</h1>
</a>
</div>
<p id="get-started">Get started by editing these template files to build out your site layouts and content.</p>
<p id="description">All template files need to be valid <a href="https://rad-theme-engine.ofco.cloud/docs/guides/handlebars/" target="_blank">handlebars</a> files, with tags that look like this: <code>{{#raw}}{{#formatDate now}}{{/raw}}</code>. Note: the <code>now</code> variable got its value passed by the PHP file to this template, and the <code>#formatDate</code> prefix is a <a href="https://rad-theme-engine.ofco.cloud/docs/guides/helpers/" target="_blank">handlebars helper</a>. You can write your own helpers very easily, and RAD comes preloaded with a bunch of really useful ones!</p>
<p>That tag is rendered into this: <code>{{#formatDate now }}</code></p>
<hr/>
</div>
</section>
<section>
<div class="container">
<p>We also passed the WordPress saved content to this template, asking specifically for the content, title, and published_at date. Here is a quick example of how to use that data:</p>
<p class="m-0">Title: {{ post.title }}</p>
<p class="m-0">Published: {{ post.published_at }}</p>
<p class="m-0">Content:</p>
{{{ post.content }}}
<hr/>
</div>
</section>
<section class="outro">
<h2 class="text-center">
For more help getting started on your new <em>RAD</em> project, visit the <br />
<a class="bottom-link" href="https://rad-theme-engine.ofco.cloud" target="_blank">RAD Theme Engine Docs</a>
</h2>
</section>

6
webpack.mix.js Normal file
View File

@@ -0,0 +1,6 @@
let mix = require('laravel-mix');
mix.js('src/js/app.js', 'dist').vue({ version: 2 })
.sass('src/scss/app.scss', 'app.css')
.setPublicPath('dist')
.version();