This commit is contained in:
dignajar 2015-09-21 20:37:04 -03:00
parent 4c62fdfcbc
commit 71864861fa
7 changed files with 75 additions and 50 deletions

View File

@ -152,10 +152,13 @@ define('HTML_PATH_THEME_JS', HTML_PATH_THEME.'js/');
define('HTML_PATH_THEME_IMG', HTML_PATH_THEME.'img/'); define('HTML_PATH_THEME_IMG', HTML_PATH_THEME.'img/');
define('HTML_PATH_ADMIN_THEME', HTML_PATH_ROOT.'admin/themes/'.$Site->adminTheme().'/'); define('HTML_PATH_ADMIN_THEME', HTML_PATH_ROOT.'admin/themes/'.$Site->adminTheme().'/');
define('HTML_PATH_ADMIN_THEME_JS', HTML_PATH_ADMIN_THEME.'js/');
define('HTML_PATH_ADMIN_ROOT', HTML_PATH_ROOT.'admin/'); define('HTML_PATH_ADMIN_ROOT', HTML_PATH_ROOT.'admin/');
define('HTML_PATH_UPLOADS', HTML_PATH_ROOT.'content/uploads/'); define('HTML_PATH_UPLOADS', HTML_PATH_ROOT.'content/uploads/');
define('HTML_PATH_PLUGINS', HTML_PATH_ROOT.'plugins/'); define('HTML_PATH_PLUGINS', HTML_PATH_ROOT.'plugins/');
define('JQUERY', HTML_PATH_ADMIN_THEME_JS.'jquery.min.js');
// PHP paths with dependency // PHP paths with dependency
define('PATH_THEME', PATH_ROOT.'themes/'.$Site->theme().'/'); define('PATH_THEME', PATH_ROOT.'themes/'.$Site->theme().'/');
define('PATH_THEME_PHP', PATH_THEME.'php'.DS); define('PATH_THEME_PHP', PATH_THEME.'php'.DS);

View File

@ -4,6 +4,17 @@ class Theme {
// NEW // NEW
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;
if($echo) {
echo $tmp;
}
return $tmp;
}
public static function css($files, $path=HTML_PATH_THEME_CSS, $echo=true) public static function css($files, $path=HTML_PATH_THEME_CSS, $echo=true)
{ {
if(!is_array($files)) { if(!is_array($files)) {
@ -109,6 +120,16 @@ class Theme {
} }
} }
public static function jquery($echo=true)
{
$tmp = '<script src="'.JQUERY.'"></script>'.PHP_EOL;
if($echo) {
echo $tmp;
}
return $tmp;
}
// OLD // OLD
@ -120,17 +141,8 @@ class Theme {
return BLOG_URL; return BLOG_URL;
} }
public static function jquery($path=JS_JQUERY)
{
$tmp = '<script src="'.$path.'"></script>'.PHP_EOL;
return $tmp;
}
public static function favicon()
{
return '<link rel="shortcut icon" href="'.HTML_THEME_CSS.'img/favicon.ico" type="image/x-icon">'.PHP_EOL;
}
public static function name() public static function name()
{ {

View File

@ -64,6 +64,10 @@ class Page extends fileContent
return $tags; return $tags;
} }
else { else {
if($tags==false) {
return false;
}
// Return string with tags separeted by comma. // Return string with tags separeted by comma.
return implode(', ', $tags); return implode(', ', $tags);
} }

View File

@ -126,6 +126,10 @@ class Post extends fileContent
return $tags; return $tags;
} }
else { else {
if($tags==false) {
return false;
}
// Return string with tags separeted by comma. // Return string with tags separeted by comma.
return implode(', ', $tags); return implode(', ', $tags);
} }

View File

@ -54,6 +54,10 @@ pre, code {
white-space: pre-wrap !important; white-space: pre-wrap !important;
} }
blockquote {
border-left: 10px solid #f0f2f4;
padding-left: 10px;
}
/* ------------------------ /* ------------------------
Content / Main Content / Main
@ -139,15 +143,20 @@ margin: 0;
.post-title a .post-title a
{ {
color: #555; color: #555;
border-bottom: 5px solid #ccc;
display: inline-block; display: inline-block;
} }
.page a.read-more, .page a.read-more,
.post a.read-more{ .post a.read-more{
display: block; border: 1px solid #ccc;
text-align: center; display: inline-block;
padding: 2px 5px; margin-top: 10px;
padding: 2px 20px;
}
.page a.read-more:hover,
.post a.read-more:hover{
background: #f1f1f1;
} }

View File

@ -3,7 +3,7 @@
<head> <head>
<!-- Meta tags --> <!-- Meta tags -->
<?php include('php/head.php') ?> <?php include(PATH_THEME_PHP.'head.php') ?>
</head> </head>
<body> <body>
@ -16,7 +16,7 @@
<!-- Sidebar --> <!-- Sidebar -->
<div class="sidebar pure-u-1 pure-u-md-1-4"> <div class="sidebar pure-u-1 pure-u-md-1-4">
<?php include('php/sidebar.php') ?> <?php include(PATH_THEME_PHP.'sidebar.php') ?>
</div> </div>
<!-- Main --> <!-- Main -->
@ -26,15 +26,15 @@
<?php <?php
if( ($Url->whereAmI()=='home') || ($Url->whereAmI()=='tag') ) if( ($Url->whereAmI()=='home') || ($Url->whereAmI()=='tag') )
{ {
include('php/home.php'); include(PATH_THEME_PHP.'home.php');
} }
elseif($Url->whereAmI()=='post') elseif($Url->whereAmI()=='post')
{ {
include('php/post.php'); include(PATH_THEME_PHP.'post.php');
} }
elseif($Url->whereAmI()=='page') elseif($Url->whereAmI()=='page')
{ {
include('php/page.php'); include(PATH_THEME_PHP.'page.php');
} }
?> ?>

View File

@ -1,13 +1,23 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="<?php echo $Site->description() ?>">
<title><?php echo $Site->title() ?></title>
<?php <?php
Theme::charset('UTF-8'); // CSS from theme/css/
Theme::css(array(
'pure-min.css',
'grids-responsive-min.css',
'blog.css',
'rainbow.github.css'
));
Theme::viewport(); // Javascript from theme/js/
Theme::javascript('rainbow.min.js');
// <title>Site title</title> // Favicon from theme/img/
Theme::title( $Site->title() ); Theme::favicon('favicon.png');
// <meta name="description" content="Site description">
Theme::description( $Site->description() );
// <meta name="keywords" content="HTML,CSS,XML,JavaScript"> // <meta name="keywords" content="HTML,CSS,XML,JavaScript">
if( $Url->whereAmI()=='post' ) { if( $Url->whereAmI()=='post' ) {
@ -16,35 +26,18 @@
elseif( $Url->whereAmI()=='page' ) { elseif( $Url->whereAmI()=='page' ) {
Theme::keywords( $Page->tags() ); Theme::keywords( $Page->tags() );
} }
// <link rel="stylesheet" type="text/css" href="pure-min.css">
// <link rel="stylesheet" type="text/css" href="grids-responsive-min.css">
// <link rel="stylesheet" type="text/css" href="blog.css">
// <link rel="stylesheet" type="text/css" href="rainbow.github.css">
Theme::css(array(
'pure-min.css',
'grids-responsive-min.css',
'blog.css',
'rainbow.github.css'
));
Theme::css(array(
'http://fonts.googleapis.com/css?family=Open+Sans:400,300,600&subset=latin,cyrillic-ext,greek-ext,greek,vietnamese,cyrillic,latin-ext'
), '');
// <script src="rainbow.min.js"></script>
Theme::javascript(array(
'rainbow.min.js'
));
?> ?>
<!-- Custom Fonts -->
<link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600&subset=latin,cyrillic-ext,greek-ext,greek,vietnamese,cyrillic,latin-ext" rel="stylesheet" type="text/css">
<!-- Pure and Google Fonts --> <!-- Pure and Google Fonts -->
<style> <style>
html, button, input, select, textarea, html, button, input, select, textarea,
.pure-g [class *= "pure-u"] { .pure-g [class *= "pure-u"] {
font-family: 'Open Sans', sans-serif; font-family: 'Open Sans', sans-serif;
} }
</style> </style>
<!-- Plugins Site Head --> <!-- Plugins Site Head -->
<?php Theme::plugins('siteHead') ?> <?php Theme::plugins('siteHead') ?>