small fix for the generated description
This commit is contained in:
parent
417fad1009
commit
06c66ceef3
5
index.js
5
index.js
|
@ -174,7 +174,7 @@ function createFeed(items) {
|
||||||
return feed
|
return feed
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Generete the HTML page with the aggregated contents
|
* Generate the HTML page with the aggregated contents
|
||||||
* @param {*} items
|
* @param {*} items
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
|
@ -184,7 +184,8 @@ function createHTML(items, sources) {
|
||||||
let dateFormatter = new Intl.DateTimeFormat('pt-PT', { timeZone: 'UTC' })
|
let dateFormatter = new Intl.DateTimeFormat('pt-PT', { timeZone: 'UTC' })
|
||||||
|
|
||||||
for (let item of items) {
|
for (let item of items) {
|
||||||
item.description = striptags(item.content).substring(0, 250) + '[...]'
|
let shortdescription = striptags(item.content).substring(0, 250)
|
||||||
|
item.description = shortdescription ? shortdescription + ' [...]' : ""
|
||||||
item.formattedDate = item.pubDate
|
item.formattedDate = item.pubDate
|
||||||
? dateFormatter.format(new Date(item.pubDate))
|
? dateFormatter.format(new Date(item.pubDate))
|
||||||
: ''
|
: ''
|
||||||
|
|
Loading…
Reference in New Issue