All Questions
190
questions
0
votes
0
answers
46
views
How do I add structured data json script to Pug JS
I am trying to add in a script of json that is structured data for SEO into my Pug JS file. I am doing it the same way I do JavaScript with type="text/javascript", but it does not compile ...
0
votes
1
answer
880
views
Is there a way to add hyperlinks from within JSON data?
I am trying to implement a proof of concept for a personal project which is a hypertextual blog. The project is built using expressjs and I am storing the blog data in a JSON file. Part of the ...
1
vote
1
answer
276
views
How to output results in a table from a pug file with a select dropdown to another pug file
So, i made one page that has a select dropdown with a bunch of book titles from a json file. When you choose a book and click submit it like this it should then render you to another page called /...
0
votes
1
answer
115
views
How to read an array inside another array in an " Json object" -> Jade/PUG.js
I'm trying to "create" a template using "Json" in Pug, but there is a point where I need to put much Information. But the problem for me becomes where I need to read an element ...
0
votes
1
answer
88
views
link images not loading from Json to pug
I'm doing a products page using express with pug as a template and storing the data in a JSON file, but on the products page the images are not loading, I just receive the links back.
let me know if ...
0
votes
1
answer
83
views
How te read Object in Jade Pug?
I have this JSON that I send to the PUG page from router.get with the name of prices
[{"space2":{"actualPrice":"$ 99.990","oldPrice":"$
129.990",&...
0
votes
0
answers
88
views
Get encoded content from javascript object and display it on pug, how?
I got an XML which contained tag <content:encoded> which I have processed to this form.
There are several tag and I am currently struggle at this particular tag.
Example :
{
title: [
'the ...
0
votes
1
answer
30
views
PugJS not interpolating numbers from json [duplicate]
I'm trying to render a list of interfaces I get from my router API. It is formatted as JSON. Pug is only rendering the strings and not the numbers.
Output (it renders properly in html):
em1 192.168.0....
0
votes
1
answer
131
views
Pug.js accessing json keys with spacebar or whitespaces in for each loop
I have a problem accessing json keys with whitespaces or spacebars inside in pug for each loops. Backticks, single and double quotes didn't work for me so I had to fall back to this.
.pug file
for ...
0
votes
1
answer
43
views
Showing static JSON file content in html using express
im trying to show the content of my JSON file in html using express what I have is this
const data = require("./data.json");
const express = require("express");
const morgan = ...
-2
votes
1
answer
43
views
Json Object Property
I wanna parse just title. I used express, body-parse and pug. this is my code:
router.get('/', async (req, res) => {
try {
const posts = await Post.find()
res.render('post', {...
1
vote
2
answers
455
views
Trying to iterate over JSON in Pug but keep getting length error
I am using express and pug.
here is the index.js file :
app.get('/', function(req, res) {
var bookStore = [
{
title: "Templating with Pug",
author: "...
1
vote
1
answer
502
views
How can I get a value from index.html and use it to render a second template after parsing JSON file?
I'm trying to wrap my head around gulp and modern JavaScript bundling.
The application is pretty simple:
A html page is displayed to the user, where he must check a few radio buttons.
User then ...
4
votes
1
answer
9k
views
New Line \n Does Not Work in MongoDB Atlas
I've stored a document with a string field in MongoDB Atlas that I use to populate to an HTML (pug) element. I want to indicate a new line in the text using the escape \n. However, the character does ...
0
votes
1
answer
129
views
in pug do an iteration and give it a limit
I want to limit a function (for)
to recycle the same database from a json file
- for (var i = 0; i < datos.length; ++i) {
a.contenido_a(href="/pelicula/"+datos[i].titulo)
img.card-...