Browse Source

Merge pull request #62 (closes #57)

About page
pull/64/head
Jeffery Russell 5 years ago
committed by GitHub
parent
commit
b328f86192
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 143 additions and 41 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. +95
    -0
      templates/blog/about.html
  8. +1
    -1
      templates/blog/blogMain.html
  9. +6
    -6
      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) 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 -->
<footer class="text-center"> <footer class="text-center">
<div class="footer-above"> <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="navbar navbar-expand-lg navbar-dark fixed-top bg-primary" id="mainNav">
<div class="container"> <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" <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>
@ -60,10 +60,10 @@
<div class="collapse navbar-collapse" id="navbarSupportedContent"> <div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto"> <ul class="navbar-nav mr-auto">
<li class="nav-item active"> <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>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="https://jrtechs.net/contact/">Contact</a>
<a class="nav-link" href="/contact">Contact</a>
</li> </li>
</ul> </ul>
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
@ -79,8 +79,4 @@
</ul> </ul>
</div> </div>
</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) => 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="row">
<div class="col-md-6"> <div class="col-md-6">
<div class="blogPost"> <div class="blogPost">

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

@ -0,0 +1,95 @@
{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">
Computer Science, Researcher, Open Source
</span>
</div>
</div>
<br><br>
<div class="container">
<div class="row">
<div class="col-md-8 col-12">
<div class="card">
<div class="card-header">
<h3>
About Me
</h3>
</div>
<div class="card-body">
<p>
I am currently a third year Computer Science student at Rochester Institute of Technology.
I am a very outgoing person who loves collaborating and working with others.
Check out my <a href="https://github.com/jrtechs">GitHub</a>, blog posts, and project websites to see what I have been working on.
</p>
<p>
I am a self proclaimed geek; I have been programming since I salvaged parts to build a computer when I was in 6th grade.
Computers are my lifeblood. When I am not programming - or reading - I enjoy excising and riding my bike.
</p>
</div>
</div>
<br><br>
<div class="card">
<div class="card-header">
<h3>
This Site
</h3>
</div>
<div class="card-body">
<p>
JrTechs is a simple personal blog where I write articles on topics that I find interesting.
This blog covers everything from project write-ups to tutorials on complex machine learning algorithms.
</p>
<p>
This site was initially started as a simple HTML site back in 2014 when I was first learning about web development.
This website has gone through <b>a lot</b> of changes since it was initially created in 2014.
Currently the site is a custom <a href="https://expressjs.com/">Express</a> application which uses <a href="https://pandoc.org/">Pandoc</a> to render <a href="https://www.latex-project.org/">Latex</a>/Markdown files as HTML documents.
</p>
</div>
</div>
</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} {header}
<br><br><br><br><br>
<div class="container"> <div class="container">
<div class="row"> <div class="row">

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

@ -1,9 +1,8 @@
{header} {header}
<br><br><br><br><br>
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class='col-md-8'>
<div class='col-md-8 col-12'>
{if messageSent} {if messageSent}
<h1>Message Sent</h1> <h1>Message Sent</h1>
<p>I will try to get back to you within a week. Thank you for messaging me.</p> <p>I will try to get back to you within a week. Thank you for messaging me.</p>
@ -58,11 +57,12 @@
</div> </div>
</div> </div>
</form> </form>
<br>
<br>
{/if} {/if}
</div> </div>
<br>
<br>
<div class="col-md-4 col-4">
<div class="col-md-4 col-12">
{>sideBar} {>sideBar}
</div> </div>
</div> </div>

+ 16
- 0
utils/pageBuilder.js View File

@ -180,5 +180,21 @@ module.exports =
{ {
console.log("Blog cache cleared"); console.log("Blog cache cleared");
cache.clear(); 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