From 1bbe6c5eebc7b6b72c62f651cd313878ab1b38f1 Mon Sep 17 00:00:00 2001 From: aitzol Date: Sat, 24 Apr 2021 13:05:36 +0200 Subject: [PATCH] azkena --- .gitignore | 2 +- index.js | 1 + views/#layout.pug# | 33 --------------------------------- 3 files changed, 2 insertions(+), 34 deletions(-) delete mode 100644 views/#layout.pug# diff --git a/.gitignore b/.gitignore index 504afef..ccb2c80 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ node_modules/ -package-lock.json +package-lock.json \ No newline at end of file diff --git a/index.js b/index.js index f906f99..fad4049 100644 --- a/index.js +++ b/index.js @@ -7,6 +7,7 @@ const routes = require('./routes'); const api = require('./routes/api'); app.set('port', 8080); +app.set('views', __dirname + '/views'); app.set('view engine', 'pug'); app.use(express.static(path.join(__dirname, 'public'))); app.use(bodyParser.urlencoded({extended: true})); diff --git a/views/#layout.pug# b/views/#layout.pug# deleted file mode 100644 index f0671a1..0000000 --- a/views/#layout.pug# +++ /dev/null @@ -1,33 +0,0 @@ -doctype -html(lang='eu') - head - title Node.js Express.js Pug adibidea - meta(name='viewport', content='width=device-width, initial-scale=1.0') - base(href='/') - link(rel='stylesheet', href='css/styles.css') - link(rel='stylesheet', href='css/header.css') - link(rel='stylesheet', href='css/footer.css') - link(rel='shortcut icon', href='#') - - script. - window.onload = function () { - var logged = "#{logged}" - var path = window.location.pathname; - if(path != '/'){ - document.querySelector('.back').style.display = 'block'; - document.querySelector('.next').style.display = 'none'; - }else{ - document.querySelector('.back').style.display = 'none'; - if(logged) { - document.querySelector('.next').style.display = 'block'; - } - } - }; - - body - - block header - include header - block content - block footer - include footer \ No newline at end of file