You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sessioncommunities.online/php/utils/site-generation.php

29 lines
759 B
PHTML

<?php
class SiteGeneration {
public static function getCanonicalPageURL() {
global $SITE_CANONICAL_URL;
return dirname($SITE_CANONICAL_URL.getenv('SSG_TARGET')) . '/';
}
public static function getAbsoluteSourceDocumentPath() {
return $_SERVER['SCRIPT_NAME'];
}
public static function getTargetDocumentPath() {
return getenv('SSG_TARGET');
}
public static function getTargetDocumentRoute() {
return dirname(SiteGeneration::getTargetDocumentPath());
}
public static function getOwnSubDocumentPath(string $identifier) {
$page = SiteGeneration::getAbsoluteSourceDocumentPath();
$sub_document = dirname($page) . '/+' . preg_replace('/[.]php$/', ".$identifier.php", basename($page));
return $sub_document;
}
}
?>