PopEye theme updates

This commit is contained in:
Diego Najar 2021-04-20 23:21:44 +02:00
parent ee0adae2d9
commit 2de6b6a3b1
8 changed files with 92 additions and 49 deletions

View file

@ -16,7 +16,7 @@
*/ */
$content = array(); $content = array();
// Page filtered by the user, is a Page Object // Page filtered by the user, will be a Page Object
$page = false; $page = false;
// Array with static content, each item is a Page Object // Array with static content, each item is a Page Object
@ -29,7 +29,7 @@ $page = false;
N => Page Object N => Page Object
) )
*/ */
$staticContent = $staticPages = buildStaticPages(); $staticContent = buildStaticPages();
// ============================================================================ // ============================================================================
// Main // Main
@ -61,7 +61,7 @@ if ($site->homepage() && $url->whereAmI()==='home') {
// Build specific page // Build specific page
if ($url->whereAmI()==='page') { if ($url->whereAmI()==='page') {
$content[0] = $page = buildThePage(); $page = buildThePage();
} }
// Build content by tag // Build content by tag
elseif ($url->whereAmI()==='tag') { elseif ($url->whereAmI()==='tag') {
@ -73,14 +73,10 @@ elseif ($url->whereAmI()==='category') {
} }
// Build content for the homepage // Build content for the homepage
elseif ( ($url->whereAmI()==='home') || ($url->whereAmI()==='blog') ) { elseif ( ($url->whereAmI()==='home') || ($url->whereAmI()==='blog') ) {
$content = buildPagesForHome(); $content = buildPagesForHome();
}
if (isset($content[0])) {
$page = $content[0];
} }
// If set notFound, create the page 404 // If set notFound, create the page 404
if ($url->notFound()) { if ($url->notFound()) {
$content[0] = $page = buildErrorPage(); $page = buildErrorPage();
} }

View file

@ -0,0 +1,16 @@
/* HELPERs */
.color-blue {
color: #0a58ca;
}
.color-light {
color: #495057;
}
.bold {
font-weight: 600;
}
.italic {
font-style: italic;
}

View file

@ -9,9 +9,40 @@ a:hover {
color: #0a58ca; color: #0a58ca;
} }
.page-date { img {
max-width: 100%;
}
pre, code {
color: #f8f8f8;
background-color: #495057;
}
code {
display: inline-block;
padding: 0 0.5em;
line-height: 1.4em;
border-radius: 3px;
}
pre {
overflow-x: scroll;
padding: 1.6rem 2.2rem;
line-height: 1.5;
border-radius: 5px !important;
}
/* PAGE */
section.page h1.title {
font-size: 2rem;
}
section.page .description {
font-style: italic;
}
section.page a {
color: #0a58ca; color: #0a58ca;
font-weight: 600;
} }
/* VIDEO EMBED RESPONSIVE */ /* VIDEO EMBED RESPONSIVE */

View file

@ -21,7 +21,7 @@
<?php echo HTML::cssBootstrapIcons(); ?> <?php echo HTML::cssBootstrapIcons(); ?>
<!-- Include CSS Styles from this theme --> <!-- Include CSS Styles from this theme -->
<?php echo HTML::css('css/style.css'); ?> <?php echo HTML::css(array('css/style.css', 'css/helpers.css')); ?>
<!-- Execute Bludit plugins for the hook "Site head" --> <!-- Execute Bludit plugins for the hook "Site head" -->
<?php execPluginsByHook('siteHead'); ?> <?php execPluginsByHook('siteHead'); ?>

View file

@ -1,12 +1,12 @@
<footer class="bd-footer p-3 p-md-5 mt-5 bg-light text-center text-sm-start"> <footer class="bd-footer p-3 p-md-5 mt-5 bg-light text-center text-sm-start">
<div class="container"> <div class="container">
<ul class="bd-footer-links ps-0 mb-3"> <ul class="bd-footer-links ps-0 mb-3">
<li class="d-inline-block"><a href="#">GitHub</a></li> <?php foreach (HTML::socialNetworks() as $key => $name) {
<li class="d-inline-block ms-3"><a href="#">Twitter</a></li> echo '<li class="d-inline-block p-2"><i class="me-2 bi bi-' . $key . '"></i>' . $name . '</li>';
<li class="d-inline-block ms-3"><a href="#">Facebook</a></li> }
<li class="d-inline-block ms-3"><a href="#">About</a></li> ?>
</ul> </ul>
<p class="mb-0">Design for Bludit v4.0</p> <p class="mb-0">Design for Bludit v4.0</p>
<p class="mb-0">Running over Bludit CMS</p> <p class="mb-0">Running over Bludit CMS</p>
</div> </div>
</footer> </footer>

View file

@ -1,11 +1,11 @@
<!-- Site logo and description --> <header class="p-3">
<header class="bg-light p-3">
<div class="container text-center"> <div class="container text-center">
<!-- Site logo -->
<div class="site-logo"> <div class="site-logo">
<img class="img-thumbnail rounded mx-auto d-block" height="150px" width="150px" src="<?php echo ($site->logo()?$site->logo():HTML_PATH_THEME_IMG.'logo.svg') ?>" alt=""> <img class="img-thumbnail rounded mx-auto d-block" height="150px" width="150px" src="<?php echo ($site->logo()?$site->logo():HTML_PATH_THEME_IMG.'logo.svg') ?>" alt="">
</div> </div>
<!-- Site description -->
<?php if ($site->description()) : ?> <?php if ($site->description()) : ?>
<div class="site-description mt-2"> <div class="site-description mt-2">
<p><?php echo $site->description(); ?></p> <p><?php echo $site->description(); ?></p>
@ -28,19 +28,19 @@
<!-- Search input --> <!-- Search input -->
<form class="d-flex mb-4"> <form class="d-flex mb-4">
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search"> <input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success" type="submit">Search</button> <button class="btn btn-outline-primary" type="submit">Search</button>
</form> </form>
<!-- Pages --> <!-- Pages -->
<div class="list-group list-group-flush"> <div class="list-group list-group-flush">
<?php foreach ($content as $page) : ?> <?php foreach ($content as $tmp) : ?>
<div class="list-group-item pt-3 pb-3" aria-current="true"> <div class="list-group-item pt-3 pb-3" aria-current="true">
<div class="d-flex w-100 justify-content-between"> <div class="d-flex w-100 justify-content-between">
<!-- Print page's title --> <!-- Print page's title -->
<a href="<?php echo $page->url() ?>"> <a href="<?php echo $tmp->url() ?>">
<h5 class="mb-1"><?php echo $page->title() ?></h5> <h5 class="mb-1"><?php echo $tmp->title() ?></h5>
</a> </a>
<!-- Print page's date --> <!-- Print page's date -->
<small class="page-date"><?php echo $page->relativeTime() ?></small> <small class="color-blue bold"><?php echo $tmp->relativeTime() ?></small>
</div> </div>
<!-- Print page's description --> <!-- Print page's description -->
@ -48,10 +48,10 @@
<!-- Print page's tags --> <!-- Print page's tags -->
<?php <?php
$tmp = $page->tags(true); $tagsList = $tmp->tags(true);
if (!empty($tmp)) { if (!empty($tagsList)) {
echo '<small>'; echo '<small>';
foreach ($tmp as $tagKey => $tagName) { foreach ($tagsList as $tagKey => $tagName) {
echo '<a class="badge bg-light text-dark text-decoration-none" href="' . DOMAIN_TAGS . $tagKey . '">' . $tagName . '</a>'; echo '<a class="badge bg-light text-dark text-decoration-none" href="' . DOMAIN_TAGS . $tagKey . '">' . $tagName . '</a>';
} }
echo '</small>'; echo '</small>';

View file

@ -1,11 +1,12 @@
<nav class="navbar sticky-top navbar-light bg-light"> <nav class="navbar sticky-top">
<div class="container"> <div class="container">
<a class="navbar-brand" href="<?php echo $site->url() ?>"><?php echo $site->title() ?></a> <a class="navbar-brand" href="<?php echo $site->url() ?>"><?php echo $site->title() ?></a>
<div class="d-flex"> <div class="d-flex">
<?php foreach (HTML::socialNetworks() as $key=>$name) { <!-- Static pages -->
echo '<span class="p-2"><i class="me-2 bi bi-'.$key.'"></i>'.$name.'</span>'; <?php foreach ($staticContent as $tmp): ?>
} <a href="<?php echo $tmp->url(); ?>"><?php echo $tmp->title(); ?></a>
?> <?php endforeach ?>
</div> </div>
</div> </div>
</nav> </nav>

View file

@ -1,23 +1,22 @@
<section class="page"> <section class="page mt-4 mb-4">
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-lg-8 mx-auto"> <div class="col-lg-6 mx-auto">
<!-- Load Bludit Plugins: Page Begin --> <!-- Load Bludit Plugins: Page Begin -->
<?php execPluginsByHook('pageBegin'); ?> <?php execPluginsByHook('pageBegin'); ?>
<!-- Page information -->
<div class="page-information form-text">
<span><?php echo $page->date() ?></span>
<span class="ps-3"><?php echo $page->readingTime().' '.$L->g('read') ?></span>
</div>
<!-- Page title --> <!-- Page title -->
<h1 class="title"><?php echo $page->title(); ?></h1> <h1 class="title"><?php echo $page->title(); ?></h1>
<!-- Page description --> <!-- Page description -->
<?php if ($page->description()): ?> <?php if ($page->description()): ?>
<p class="page-description"><?php echo $page->description(); ?></p> <p class="italic mt-1 mb-3 color-light"><?php echo $page->description(); ?></p>
<?php endif ?>
<!-- Page cover image -->
<?php if ($page->coverImage()): ?>
<div class="page-cover-image py-6 mb-4" style="background-image: url('<?php echo $page->coverImage(); ?>');">
<div style="height: 300px;"></div>
</div>
<?php endif ?> <?php endif ?>
<!-- Page content --> <!-- Page content -->
@ -30,4 +29,4 @@
</div> </div>
</div> </div>
</div> </div>
</section> </section>