Skip to content

PHP template framework for use with HTML5/AJAX.

License

Notifications You must be signed in to change notification settings

kyaulabs/aurora

Aurora

Repository Logo

https://kyaulabs.com/

Contributor Covenant   Conventional Commits   GitHub   Gitleaks
Semantic Versioning   Discord

About

Aurora is built for rapid deployment of sites built with AJAX content loading. It also attempts to use the most up-to-date HTML specifications / web standards in use today.

This has been created with personal use in mind and is highly tailored to the types of sites I create and run. That said, this could be easily adapted to anyones needs with a bit of work.

What's Included

  • Template-based HTML header
  • Resource preloading
  • Subresource Integrity (SRI) enabled
  • Performance Statistics
  • SQL Handler

Usage

To use Aurora, one needs to either use the default HTML header template or create your own. Once finished, move Aurora into a folder above the web root then create an index.php similar to the following:

# $KYAULabs: index.php,v 1.0.0 2024/07/22 22:51:26 -0700 kyau Exp $

$rus = getrusage();
require_once(__DIR__ . "/../../aurora/aurora.inc.php");

$site = new KYAULabs\Aurora("index.html", "/cdn", true, true);
$site->title = "Website Title";
$site->description = "Full website description for search engines.";
$site->dns = ["cdn.domain.com"];
$site->preload = [
    '/css/site.min.css' => 'style',
    '/javascript/jquery.min.js' => 'script',
    '/javascript/site.min.js' => 'script',
];
$site->css = [
    '../api/css/site.min.css' => '//api.domain.com/css/site.min.css',
];
$site->js = [
    '../api/javascript/jquery.min.js' => '//api.domain.com/javascript/jquery.min.js',
    '../api/javascript/site.min.js' => '//api.domain.com/javascript/site.min.js',
];
$site->htmlHeader();
// <content>
echo "\t<header></header>\n\t<main></main>\n\t<footer></footer>\n";
// </content>
$site->htmlFooter();
echo $site->comment($rus, $_SERVER['SCRIPT_FILENAME'], true);

Looking over the source code can give you more insights on how to utilize Aurora.