Started development on about page

This commit is contained in:
Esther 2020-06-22 20:36:41 +01:00
parent 7408ff69f1
commit 8ed1213eb2
No known key found for this signature in database
GPG Key ID: 162A307C5EBD40EA
3 changed files with 37 additions and 1 deletions

4
app.js
View File

@ -6,6 +6,7 @@ var logger = require('morgan');
var sassMiddleware = require('node-sass-middleware'); var sassMiddleware = require('node-sass-middleware');
var indexRouter = require('./routes/index'); var indexRouter = require('./routes/index');
var aboutRouter = require('./routes/about');
var app = express(); var app = express();
@ -13,7 +14,7 @@ var app = express();
app.set('views', path.join(__dirname, 'views')); app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'pug'); app.set('view engine', 'pug');
app.use(logger('dev')); app.use(logger('common'));
app.use(express.json()); app.use(express.json());
app.use(express.urlencoded({ extended: false })); app.use(express.urlencoded({ extended: false }));
app.use(cookieParser()); app.use(cookieParser());
@ -28,6 +29,7 @@ app.use(express.static(path.join(__dirname, 'public')));
app.disable('x-powered-by'); app.disable('x-powered-by');
app.use('/', indexRouter); app.use('/', indexRouter);
app.use('/about', aboutRouter);
// catch 404 and forward to error handler // catch 404 and forward to error handler
app.use(function(req, res, next) { app.use(function(req, res, next) {

9
routes/about.js Normal file
View File

@ -0,0 +1,9 @@
var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res, next) {
res.render('about', { title: 'About', description: "Who??? What??? AAAAaaa, about me." });
});
module.exports = router;

25
views/about.pug Normal file
View File

@ -0,0 +1,25 @@
extends layout
block nav-links
li.nav-item.active
a.nav-link(href='#')
span Home
li.nav-item
a.nav-link(href='#')
span About
li.nav-item
a.nav-link(href='#')
span CV
li.nav-item
a.nav-link(href='https://git.pastel.codes/Blankie')
span Projects
li.nav-item
a.nav-link(href='https://blog.pastel.codes')
span Blog
li.nav-item
a.nav-link(href='#')
span Contact
block content
.container
p In development