pug

Nodejs Pagination

杀马特。学长 韩版系。学妹 提交于 2020-08-11 00:14:09
问题 I want to make a pagination with Nodejs and Mongoose. I can limit the posts but I couldn't handle the connection of front-end to back-end. this is app.js: app.get('/', function (req, res) { var perPage = 2 var page = req.params.page || 1 Metin .find({}) .skip((perPage * page) - perPage) .limit(perPage) .exec(function(err, metins) { Metin.count().exec(function(err, count) { if (err) return next(err) res.render('index', { metins: metins, current: page, pages: Math.ceil(count / perPage) }) }) })

How to pass a Node.js variable to the inside of a Pug script tag?

不想你离开。 提交于 2020-07-28 00:18:28
问题 I am trying to take a variable I've sent to my Pug page from Node.js and place it inside a javascript variable inside of a pug script tag. (Sorry if that is confusing) My node.js code is as follows: app.get('/profile', function (req, res) { var session = req.session; res.render('./login.pug', { username: session.uniqueID }); }); When I use the variable in my pug page code like this input(type='text', id='username', value=username) it works fine. The value will be changed to the username that

How to pass a Node.js variable to the inside of a Pug script tag?

孤人 提交于 2020-07-28 00:14:48
问题 I am trying to take a variable I've sent to my Pug page from Node.js and place it inside a javascript variable inside of a pug script tag. (Sorry if that is confusing) My node.js code is as follows: app.get('/profile', function (req, res) { var session = req.session; res.render('./login.pug', { username: session.uniqueID }); }); When I use the variable in my pug page code like this input(type='text', id='username', value=username) it works fine. The value will be changed to the username that

How to pass a Node.js variable to the inside of a Pug script tag?

半城伤御伤魂 提交于 2020-07-28 00:14:08
问题 I am trying to take a variable I've sent to my Pug page from Node.js and place it inside a javascript variable inside of a pug script tag. (Sorry if that is confusing) My node.js code is as follows: app.get('/profile', function (req, res) { var session = req.session; res.render('./login.pug', { username: session.uniqueID }); }); When I use the variable in my pug page code like this input(type='text', id='username', value=username) it works fine. The value will be changed to the username that

Pug image as a link

∥☆過路亽.° 提交于 2020-07-08 06:25:30
问题 how do you make an image a link in Pug I've tried a(href='https://github.com/LouieAdamian') img(src="/img/GitHub.png") and img(src="/img/GitHub.png") a(href='https://github.com/LouieAdamian') and a(href='https://github.com/LouieAdamian') img(src="/img/GitHub.png") none of these worked I ether ended up with the text img(src="/img/GitHub.png") as the link or no link at all. 回答1: This way (the indent is necessary) : a(href='https://github.com/LouieAdamian') img(src="/img/GitHub.png") 来源: https:/

Pug image as a link

為{幸葍}努か 提交于 2020-07-08 06:25:07
问题 how do you make an image a link in Pug I've tried a(href='https://github.com/LouieAdamian') img(src="/img/GitHub.png") and img(src="/img/GitHub.png") a(href='https://github.com/LouieAdamian') and a(href='https://github.com/LouieAdamian') img(src="/img/GitHub.png") none of these worked I ether ended up with the text img(src="/img/GitHub.png") as the link or no link at all. 回答1: This way (the indent is necessary) : a(href='https://github.com/LouieAdamian') img(src="/img/GitHub.png") 来源: https:/

Pug image as a link

柔情痞子 提交于 2020-07-08 06:24:09
问题 how do you make an image a link in Pug I've tried a(href='https://github.com/LouieAdamian') img(src="/img/GitHub.png") and img(src="/img/GitHub.png") a(href='https://github.com/LouieAdamian') and a(href='https://github.com/LouieAdamian') img(src="/img/GitHub.png") none of these worked I ether ended up with the text img(src="/img/GitHub.png") as the link or no link at all. 回答1: This way (the indent is necessary) : a(href='https://github.com/LouieAdamian') img(src="/img/GitHub.png") 来源: https:/

CSS text ending indentation

耗尽温柔 提交于 2020-07-03 03:23:09
问题 I'm trying to achieve the red highlighted effect with CSS. The first row to be the longest, the second shorter and so on. https://codepen.io/make96/pen/QmMJyx I'm using Jade and SASS and below is my code: #section min-height: auto width: 100vw background: black .content margin: 0 auto padding: 7vh 0 width: 52vw //border: 1px solid white position: relative h1,h2 color: #c9d0d4 font-family: 'Helvetica Neue', sans-serif font-size: 1.2em font-weight: 100 letter-spacing: 1px padding: 0 margin