Refactoring theme to avoid use of partials, since their content cannot be updated through AJAX requests.

This commit is contained in:
JayWll 2020-05-16 15:08:54 -06:00
parent 48a9226a81
commit 997498cef1
4 changed files with 75 additions and 91 deletions

View File

@ -1,4 +1,6 @@
description = "Default Layout"
[CurrentInfo]
==
<!doctype html>
<html lang="en">
@ -16,21 +18,47 @@ description = "Default Layout"
</head>
<body class="d-flex flex-column">
<div id="page-content">
{% partial 'header' %}
<header>
<nav class="navbar navbar-expand-lg navbar-light">
<a class="navbar-brand" href="/"><span class="d-none d-sm-inline-block">Jason Williams</span></a></a>
{% partial 'mainmenu' %}
</nav>
</header>
<main>
<div class="container-fluid">
{% page %}
</div>
</main>
<main>
<div class="container-fluid">
{% page %}
</div>
</main>
</div>
{% partial 'footer' %}
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<footer class="footer mt-auto py-3 static-bottom">
<div class="container-fluid">
<div class="row">
<div class="col-md-4">
<p>©2020 Jason Williams</p>
<ul class="d-none d-md-block">
<li><a href="/">Home</a></li>
<li><a href="/resume">Résumé</a></li>
<li><a href="/feed">Feed</a></li>
<li><a href="/contact">Contact Me</a></li>
</ul>
{% component 'CurrentInfo' %}
<p>Made with 💖 in #YYC<br><a href="https://www.madeinyyc.com/"><img src="{{ 'assets/images/madeinyyc.png'|theme }}"></a></p>
</div>
<div class="col-md-4">
<p>Recent Projects</p>
</div>
<div class="col-md-4">
<p>Recent Blog Posts</p>
</div>
</div>
</footer>
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
{% framework extras %}
{% scripts %}
</body>
</html>

View File

@ -1,24 +0,0 @@
description = "Site Footer"
==
<footer class="footer mt-auto py-3 static-bottom">
<div class="container-fluid">
<div class="row">
<div class="col-md-4">
<p>©2020 Jason Williams</p>
<ul class="d-none d-md-block">
<li><a href="/">Home</a></li>
<li><a href="/resume">Résumé</a></li>
<li><a href="/feed">Feed</a></li>
<li><a href="/contact">Contact Me</a></li>
</ul>
<p>Weather info goes here!</p>
<p>Made with 💖 in #YYC<br><a href="https://www.madeinyyc.com/"><img src="{{ 'assets/images/madeinyyc.png'|theme }}"></a></p>
</div>
<div class="col-md-4">
<p>Recent Projects</p>
</div>
<div class="col-md-4">
<p>Recent Blog Posts</p>
</div>
</div>
</footer>

View File

@ -1,56 +0,0 @@
description = "Site Header"
==
<?php
function onStart()
{
// Determine the acive section of the site in order to customize the navigation
$this['activeSection'] = explode('/', $_SERVER['REQUEST_URI'])[1];
}
?>
==
<header>
<nav class="navbar navbar-expand-lg navbar-light">
<a class="navbar-brand" href="/"><span class="d-none d-sm-inline-block">Jason Williams</span></a></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 {% if activeSection == '' %}active{% endif %}">
<a class="nav-link" href="/">Home {% if activeSection == '' %}<span class="sr-only">(current)</span>{% endif %}</a>
</li>
<li class="nav-item {% if activeSection == 'feed' %}active{% endif %}">
<a class="nav-link" href="/feed">Feed {% if activeSection == 'feed' %}<span class="sr-only">(current)</span>{% endif %}</a>
</li>
{% if activeSection != 'resume' %}
<li class="nav-item">
<a class="nav-link" href="/resume">Résumé</a>
</li>
{% else %}
<li class="nav-item active d-none d-lg-inline-block">
<a class="nav-link" href="/resume">Résumé</a>
</li>
<li class="nav-item dropdown active d-lg-none show">
<a class="nav-link dropdown-toggle" href="/resume" id="resumeDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">Résumé</a>
<!--<div class="dropdown-menu" aria-labelledby="resumeDropdown">
<a class="dropdown-item" href="#">Summary</a>
<a class="dropdown-item" href="#">Skills &amp; Expertise</a>
<a class="dropdown-item" href="#">Experience</a>
<a class="dropdown-item" href="#">Education</a>
<a class="dropdown-item" href="#">Certifications</a>
</div>-->
<ul class="navbar-nav" aria-labelledby="resumeDropdown">
<li class="nav-item"><a class="dropdown-item" href="#">Summary</a></li>
<li class="nav-item"><a class="dropdown-item" href="#">Skills &amp; Expertise</a></li>
<li class="nav-item"><a class="dropdown-item" href="#">Experience</a></li>
<li class="nav-item"><a class="dropdown-item" href="#">Education</a></li>
<li class="nav-item"><a class="dropdown-item" href="#">Certifications</a></li>
</ul>
</li>
{% endif %}
</ul>
</div>
</nav>
</header>

View File

@ -0,0 +1,36 @@
description = "Main Site Menu"
==
<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 {% if activeSection == '' %}active{% endif %}">
<a class="nav-link" href="/">Home {% if activeSection == '' %}<span class="sr-only">(current)</span>{% endif %}</a>
</li>
<li class="nav-item {% if activeSection == 'feed' %}active{% endif %}">
<a class="nav-link" href="/feed">Feed {% if activeSection == 'feed' %}<span class="sr-only">(current)</span>{% endif %}</a>
</li>
{% if activeSection != 'resume' %}
<li class="nav-item">
<a class="nav-link" href="/resume">Résumé</a>
</li>
{% else %}
<li class="nav-item active d-none d-lg-inline-block">
<a class="nav-link" href="/resume">Résumé</a>
</li>
<li class="nav-item dropdown active d-lg-none show">
<a class="nav-link dropdown-toggle" href="/resume" id="resumeDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">Résumé</a>
<ul class="navbar-nav" aria-labelledby="resumeDropdown">
<li class="nav-item"><a class="dropdown-item" href="#">Summary</a></li>
<li class="nav-item"><a class="dropdown-item" href="#">Skills &amp; Expertise</a></li>
<li class="nav-item"><a class="dropdown-item" href="#">Experience</a></li>
<li class="nav-item"><a class="dropdown-item" href="#">Education</a></li>
<li class="nav-item"><a class="dropdown-item" href="#">Certifications</a></li>
</ul>
</li>
{% endif %}
</ul>
</div>