GeniXCMS

Site Class

categoryAPI edit_calendar31 Mar 2026

Global Website & SEO Class


The Site class is the primary data container and orchestration engine for your website's global identity. It manages core site properties, automated SEO metadata generation, structured data (JSON-LD), and on-the-fly asset optimization, ensuring your frontend remains search-engine optimized and high-performing.


⚡ Core Identity Properties

The class provides static, global access to your site's foundational data.

Property Access Description
Site::$name static The primary Website Name.
Site::$url static The absolute Base URL (e.g., https://site.com/).
Site::$desc static Global Meta Description for the homepage.
Site::$slogan static Catchy marketing slogan or tagline.
Site::$email static Administrative contact email address.

🌎 Automated SEO Engine

GeniXCMS 2.0.0 features an intelligent metadata aggregator that handles complex head-section logic.

Site::meta(array $data)

Generates a comprehensive suite of SEO and social metadata tags.

  • Standard Tags: Charset, Generator, and Viewport.
  • SEO Optimization: Automated Page Titles, Meta Keywords, and Canonical URLs.
  • Social Graph: Generates Open Graph (Facebook) and Twitter Cards metadata based on post featured images and excerpts.
{* In your theme's header.php *}
{Site::meta($data)|noescape}

🏗️ Semantic Structured Data

Site::jsonLD(array $data)

Automatically generates Schema.org compliant JSON-LD scripts for search engine rich results.

  • BlogPosting: Injected on single post pages for improved article discovery.
  • WebPage: Injected on static pages for structural clarity.
  • Organization: Global schema for corporate/site identity.

🎨 Branding & Visual Assets

Site::logo(int $w, int $h, string $class)

Retrieves the site's primary logo with automated sizing and responsive class support.

// Render a 150px wide logo with a custom class
echo Site::logo(150, 0, 'navbar-brand-img');

🚀 Performance & Optimization

The Site class includes a high-performance Minification Engine for on-the-fly resource compression.

Method Role Logic
minifyHTML($html) Compression Strips redundant whitespace and comments from the final rendered page.
minifyCSS($css) Optimization Compresses raw CSS strings for faster transmission.
minifyJS($js) Optimization Compresses JavaScript code for improved load times.

lightbulb
TipSEO Performance: The Site::title() helper automatically appends your site name to the page title (e.g., Blog Post | My Site) to ensure consistent branding across all search engine results.

See Also