Browse Source

Created header for the about page.

pull/62/head
jrtechs 5 years ago
parent
commit
7315f23edc
10 changed files with 106 additions and 36 deletions
  1. +18
    -21
      includes/downloads.js
  2. +0
    -4
      includes/html/footer.html
  3. +4
    -8
      includes/html/header.html
  4. BIN
      includes/img/background_light.png
  5. +2
    -1
      routes/about.js
  6. +1
    -0
      templates/admin/adminHome.html
  7. +63
    -0
      templates/blog/about.html
  8. +1
    -1
      templates/blog/blogMain.html
  9. +1
    -1
      templates/blog/contact.html
  10. +16
    -0
      utils/pageBuilder.js

+ 18
- 21
includes/downloads.js View File

@ -21,29 +21,26 @@ module.exports=
*/
main: function(res, requestURL)
{
return new Promise(function(resolve, reject)
const urlSplit = requestURL.split("/");
if(urlSplit.length == 2 || urlSplit.length == 4)
{
const urlSplit = requestURL.split("/");
if(urlSplit.length == 2 || urlSplit.length == 4)
sql.getDownload(urlSplit[1]).then(function(result)
{
sql.getDownload(urlSplit[1]).then(function(result)
if(result.length == 1)
{
if(result.length == 1)
{
const file = './blogContent/downloads/' +
result[0].file;
res.download(file);
}
else
{
pageBuilder.print404(res);
}
});
}
else
{
pageBuilder.print404(res);
}
});
const file = './blogContent/downloads/' +
result[0].file;
res.download(file);
}
else
{
pageBuilder.print404(res);
}
});
}
else
{
pageBuilder.print404(res);
}
}
};

+ 0
- 4
includes/html/footer.html View File

@ -1,7 +1,3 @@
<!-- Close section -->
</div></div>
<!-- Footer -->
<footer class="text-center">
<div class="footer-above">

+ 4
- 8
includes/html/header.html View File

@ -51,7 +51,7 @@
<div class="navbar navbar-expand-lg navbar-dark fixed-top bg-primary" id="mainNav">
<div class="container">
<a class="navbar-brand" href="#">Jrtechs</a>
<a class="navbar-brand" href="/">JrTechs</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
@ -60,10 +60,10 @@
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="https://jrtechs.net">Home <span class="sr-only">(current)</span></a>
<a class="nav-link" href="/about">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://jrtechs.net/contact/">Contact</a>
<a class="nav-link" href="/contact">Contact</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
@ -79,8 +79,4 @@
</ul>
</div>
</div>
</div>
<br><br><br><br><br>
<div class="container">
<div class="row">
</div>

BIN
includes/img/background_light.png View File

Before After
Width: 1024  |  Height: 953  |  Size: 28 KiB

+ 2
- 1
routes/about.js View File

@ -4,7 +4,8 @@ const pageBuilder = require('../utils/pageBuilder');
routes.get('/', (request, result) =>
{
pageBuilder.buildPageWithTemplate(request, result,
(p1,p2,p3)=>{}, "blog/about.html");
});

+ 1
- 0
templates/admin/adminHome.html View File

@ -1,3 +1,4 @@
<br><br><br><br><br>
<div class="row">
<div class="col-md-6">
<div class="blogPost">

+ 63
- 0
templates/blog/about.html View File

@ -0,0 +1,63 @@
{header}
<style>
.centered
{
position: absolute;
top: 25%;
left: 35%;
transform: translate(-25%, -25%);
}
.centered .tagLine
{
font-size:2vw;
font-weight: 200;
}
.banner
{
height: 50vh !important;
width:100%;
min-height: 350px;
background: transparent;
background: url("/includes/img/background_light.png") center center fixed;
color: #fff;
}
.banner .name
{
font-family: 'Montserrat', 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size:5vw;
font-weight: 700;
display: block;
text-transform: uppercase;
}
</style>
<div class="banner">
<div class="centered name text-center">Jeffery's Blog<br>
<span class="tagLine">
<center>
Computer Science, Researcher, Open Source
</center>
</span>
</div>
</div>
<br><br>
<div class="container">
<div class="row">
<div class="col-md-8 col-12">
</div>
<div class="col-md-4 col-12">
{>sideBar}
</div>
</div>
</div>
{footer}

+ 1
- 1
templates/blog/blogMain.html View File

@ -1,5 +1,5 @@
{header}
<br><br><br><br><br>
<div class="container">
<div class="row">

+ 1
- 1
templates/blog/contact.html View File

@ -1,5 +1,5 @@
{header}
<br><br><br><br><br>
<div class="container">
<div class="row">

+ 16
- 0
utils/pageBuilder.js View File

@ -180,5 +180,21 @@ module.exports =
{
console.log("Blog cache cleared");
cache.clear();
},
buildPageWithTemplate: function(request, result, templateFiller, templateFile)
{
var templateContext = Object();
Promise.all([includes.include("templates/" + templateFile),
includes.printHeader(templateContext),
includes.printFooter(templateContext),
require("../blog/sidebar.js").main(templateContext)])
.then(function (content)
{
const html = whiskers.render(content[0], templateContext);
result.write(html);
result.end();
})
}
};

Loading…
Cancel
Save