Themes updates

This commit is contained in:
dignajar 2016-02-14 13:34:25 -03:00
parent 225eaaf20a
commit aa2196f91f
5 changed files with 82 additions and 44 deletions

View File

@ -2,11 +2,14 @@
class Theme { class Theme {
// NEW public static function favicon($file='favicon.png', $path=HTML_PATH_THEME_IMG, $typeIcon=true, $echo=true)
public static function favicon($file='favicon.png', $path=HTML_PATH_THEME_IMG, $echo=true)
{ {
$tmp = '<link rel="shortcut icon" href="'.$path.$file.'" type="image/x-icon">'.PHP_EOL; $type = 'image/png';
if($typeIcon) {
$type = 'image/x-icon';
}
$tmp = '<link rel="shortcut icon" href="'.$path.$file.'" type="'.$type.'">'.PHP_EOL;
if($echo) { if($echo) {
echo $tmp; echo $tmp;
@ -51,9 +54,28 @@ class Theme {
return $tmp; return $tmp;
} }
public static function title($title, $echo=true) public static function title($title=false, $echo=true)
{ {
$tmp = '<title>'.$title.'</title>'.PHP_EOL; global $Url;
global $Post, $Page;
global $Site;
$tmp = $title;
if(empty($title))
{
if( $Url->whereAmI()=='post' ) {
$tmp = $Post->title().' - '.$Site->title();
}
elseif( $Url->whereAmI()=='page' ) {
$tmp = $Page->title().' - '.$Site->title();
}
else {
$tmp = $Site->title();
}
}
$tmp = '<title>'.$tmp.'</title>'.PHP_EOL;
if($echo) { if($echo) {
echo $tmp; echo $tmp;
@ -62,9 +84,28 @@ class Theme {
return $tmp; return $tmp;
} }
public static function description($description, $echo=true) public static function description($description=false, $echo=true)
{ {
$tmp = '<meta name="description" content="'.$description.'">'.PHP_EOL; global $Url;
global $Post, $Page;
global $Site;
$tmp = $description;
if(empty($description))
{
if( $Url->whereAmI()=='post' ) {
$tmp = $Post->description();
}
elseif( $Url->whereAmI()=='page' ) {
$tmp = $Page->description();
}
else {
$tmp = $Site->description();
}
}
$tmp = '<meta name="description" content="'.$tmp.'">'.PHP_EOL;
if($echo) { if($echo) {
echo $tmp; echo $tmp;

View File

@ -1,19 +1,22 @@
<title><?php echo $Site->title() ?></title> <?php
<meta charset="utf-8"> Theme::charset('utf-8');
<meta name="viewport" content="width=device-width, initial-scale=1"> Theme::viewport('width=device-width, initial-scale=1');
<meta name="description" content="<?php echo $Site->description() ?>">
Theme::title();
Theme::description();
Theme::favicon('favicon.png');
?>
<!--[if lte IE 8]><script src="<?php echo HTML_PATH_THEME ?>assets/js/ie/html5shiv.js"></script><![endif]--> <!--[if lte IE 8]><script src="<?php echo HTML_PATH_THEME ?>assets/js/ie/html5shiv.js"></script><![endif]-->
<link rel="stylesheet" href="<?php echo HTML_PATH_THEME ?>assets/css/main.css"> <link rel="stylesheet" href="<?php echo HTML_PATH_THEME ?>assets/css/main.css">
<!--[if lte IE 9]><link rel="stylesheet" href="<?php echo HTML_PATH_THEME ?>assets/css/ie9.css" /><![endif]--> <!--[if lte IE 9]><link rel="stylesheet" href="<?php echo HTML_PATH_THEME ?>assets/css/ie9.css" /><![endif]-->
<!--[if lte IE 8]><link rel="stylesheet" href="<?php echo HTML_PATH_THEME ?>assets/css/ie8.css" /><![endif]--> <!--[if lte IE 8]><link rel="stylesheet" href="<?php echo HTML_PATH_THEME ?>assets/css/ie8.css" /><![endif]-->
<link rel="stylesheet" href="<?php echo HTML_PATH_THEME ?>assets/css/bludit.css"> <link rel="stylesheet" href="<?php echo HTML_PATH_THEME ?>assets/css/bludit.css">
<link rel="shortcut icon" href="<?php echo HTML_PATH_THEME ?>img/favicon.png" type="image/png">
<?php <?php
// Add local Fonts Awesome
Theme::fontAwesome(); Theme::fontAwesome();
// Plugins for head // Plugins for head

View File

@ -1,10 +1,14 @@
<title><?php echo $Site->title() ?></title> <?php
<meta charset="utf-8"> Theme::charset('utf-8');
<meta name="viewport" content="width=device-width, initial-scale=1"> Theme::viewport('width=device-width, initial-scale=1');
<meta name="description" content="<?php echo $Site->description() ?>">
Theme::title();
Theme::description();
Theme::favicon('favicon.png');
?>
<!--[if lte IE 8]><script src="<?php echo HTML_PATH_THEME ?>assets/js/ie/html5shiv.js"></script><![endif]--> <!--[if lte IE 8]><script src="<?php echo HTML_PATH_THEME ?>assets/js/ie/html5shiv.js"></script><![endif]-->
<link rel="stylesheet" href="<?php echo HTML_PATH_THEME ?>assets/css/main.css"> <link rel="stylesheet" href="<?php echo HTML_PATH_THEME ?>assets/css/main.css">
<!--[if lte IE 9]><link rel="stylesheet" href="<?php echo HTML_PATH_THEME ?>assets/css/ie9.css" /><![endif]--> <!--[if lte IE 9]><link rel="stylesheet" href="<?php echo HTML_PATH_THEME ?>assets/css/ie9.css" /><![endif]-->
<!--[if lte IE 8]><link rel="stylesheet" href="<?php echo HTML_PATH_THEME ?>assets/css/ie8.css" /><![endif]--> <!--[if lte IE 8]><link rel="stylesheet" href="<?php echo HTML_PATH_THEME ?>assets/css/ie8.css" /><![endif]-->
@ -12,9 +16,10 @@
<?php <?php
// Add local Fonts Awesome
Theme::fontAwesome();
// Plugins for head // Plugins for head
Theme::plugins('siteHead'); Theme::plugins('siteHead');
Theme::fontAwesome();
?> ?>

View File

@ -1,4 +1,4 @@
<!doctype html> <!DOCTYPE HTML>
<html lang="<?php echo $Site->language() ?>"> <html lang="<?php echo $Site->language() ?>">
<head> <head>

View File

@ -1,9 +1,11 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?php echo $Site->title() ?></title>
<?php <?php
// CSS from theme/css/ Theme::charset('UTF-8');
Theme::viewport('width=device-width, initial-scale=1');
Theme::title();
Theme::description();
// CSS files
Theme::css(array( Theme::css(array(
'pure-min.css', 'pure-min.css',
'grids-responsive-min.css', 'grids-responsive-min.css',
@ -11,24 +13,11 @@
'rainbow.github.css' 'rainbow.github.css'
)); ));
// Javascript from theme/js/ // Javascript files
Theme::javascript('rainbow.min.js'); Theme::javascript('rainbow.min.js');
// Favicon from theme/img/ // Favicon
Theme::favicon('favicon.png'); Theme::favicon('favicon.png');
// <meta name="keywords" content="HTML,CSS,XML,JavaScript">
if( $Url->whereAmI()=='post' ) {
Theme::keywords( $Post->tags() );
Theme::description( $Post->description() );
}
elseif( $Url->whereAmI()=='page' ) {
Theme::keywords( $Page->tags() );
Theme::description( $Page->description() );
}
else {
Theme::description( $Site->description() );
}
?> ?>
<!-- Custom Fonts --> <!-- Custom Fonts -->