alternative theme improves

This commit is contained in:
Diego Najar 2018-01-27 20:34:26 +01:00
parent 6b827a7c8e
commit 05d916e333
7 changed files with 81 additions and 48 deletions

View File

@ -216,7 +216,7 @@ function buildStaticPages() {
global $dbPages;
$tmp = array();
$staticPages = $dbPages->getStaticDB($onlyKeys=true);
$staticPages = $dbPages->getStaticDB();
foreach ($staticPages as $pageKey) {
$staticPage = buildPage($pageKey);
array_push($tmp, $staticPage);

View File

@ -30,6 +30,11 @@ class Paginator {
return self::get('amountOfPages');
}
public static function currentPage()
{
return self::get('currentPage');
}
public static function nextPage()
{
return self::get('nextPage');

View File

@ -32,6 +32,10 @@ section.page:nth-child(even) {
background: #FAFAFA;
}
a.page-title {
color: #333;
}
.page-description {
font-size: 1.25rem;
font-weight: 300;
@ -40,3 +44,8 @@ section.page:nth-child(even) {
background-size: cover;
background-position: center;
}
.nav-link {
font-size: 0.8em;
text-transform: uppercase;
}

View File

@ -1,32 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<?php include(THEME_DIR_PHP.'head.php') ?>
</head>
<body id="page-top">
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<div class="container">
<a class="navbar-brand" href="#">
<span class="text-white">BLUDIT</span>
<span class="ml-1 text-muted">Surprise</span>
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item"><a class="nav-link" href="#">About</a></li>
<li class="nav-item"><a class="nav-link" href="#">Contact</a></li>
<li class="nav-item"><a class="nav-link" href="#">Impressum</a></li>
<li class="nav-item"><a class="nav-link" href="#">BLUDIT PRO</a></li>
</ul>
</div>
</div>
</nav>
<!-- Navbar -->
<?php
include(THEME_DIR_PHP.'navbar.php');
?>
<!-- Content -->
<?php

View File

@ -18,7 +18,9 @@
<div class="row">
<div class="col-lg-8 mx-auto">
<!-- Page title -->
<a class="page-title" href="<?php echo $page->permalink() ?>">
<h2 class="page-title"><?php echo $page->title() ?></h2>
</a>
<!-- Page content, until the pagebreak -->
<div class="page-content">
@ -36,16 +38,27 @@
<?php endforeach ?>
<!-- Pagination -->
<nav aria-label="Page navigation example">
<?php if (Paginator::amountOfPages()>1): ?>
<nav class="my-4" aria-label="Page navigation">
<ul class="pagination justify-content-center">
<li class="page-item disabled">
<a class="page-link" href="#" tabindex="-1">Previous</a>
<!-- Previuos button -->
<li class="page-item <?php if (Paginator::showNext()) echo 'disabled' ?>">
<a class="page-link" href="<?php echo Paginator::prevPageUrl() ?>" tabindex="-1">Previous</a>
</li>
<li class="page-item"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">3</a></li>
<li class="page-item">
<a class="page-link" href="#">Next</a>
<!-- List of pages -->
<?php for ($i = 1; $i <= Paginator::amountOfPages(); $i++): ?>
<li class="page-item <?php if ($i==Paginator::currentPage()) echo 'active' ?>">
<a class="page-link" href="<?php echo Paginator::numberUrl($i) ?>"><?php echo $i ?></a>
</li>
<?php endfor ?>
<!-- Next button -->
<li class="page-item <?php if (Paginator::showPrev()) echo 'disabled' ?>">
<a class="page-link" href="<?php echo Paginator::nextPageUrl() ?>">Next</a>
</li>
</ul>
</nav>
<?php endif ?>

View File

@ -0,0 +1,20 @@
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<div class="container">
<a class="navbar-brand" href="#">
<span class="text-white"><?php echo $site->title() ?></span>
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<?php foreach ($staticContent as $staticPage): ?>
<li class="nav-item">
<a class="nav-link" href="<?php echo $staticPage->permalink() ?>"><?php echo $staticPage->title() ?></a>
</li>
<?php endforeach ?>
</ul>
</div>
</div>
</nav>

View File

@ -1,5 +1,7 @@
<section class="page">
<div class="container">
<div class="row">
<div class="col-lg-8 mx-auto">
<!-- Page title -->
<h1 class="page-title"><?php echo $page->title() ?></h1>
@ -20,4 +22,6 @@
<?php echo $page->content() ?>
</div>
</div>
</div>
</div>
</section>