add logic to truncate long headlines fetched from websites
parent
ca52ab2b9b
commit
526d874d1b
|
@ -295,7 +295,7 @@ module.exports = {
|
|||
var metaImage = $("meta[property='og:image']");
|
||||
var urlImage = metaImage.attr('content') ? metaImage.attr('content') : '';
|
||||
var description = metaDescription.attr('content') ? metaDescription.attr('content') : '';
|
||||
result.title = $('title').text();
|
||||
result.title = $('title').text().length < 141 ? $('title').text() : $('title').text().slice(0, 137) + " ...";
|
||||
result.image = urlImage;
|
||||
result.description = description;
|
||||
callback(null, result);
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
"<div class='col-xs-12'>" +
|
||||
"<span>" +
|
||||
"<a class='btn btn-no-shadow btn-primary btn-xs btn-primary-ghost' href='/stories/" + linkedName + "'>discuss</a> · " +
|
||||
"<button class='btn btn-no-shadow btn-primary btn-xs btn-primary-ghost' id='#upvote'>upvote</a></button> · " +
|
||||
rank + (rank > 1 ? " points" : " point") + " · posted " +
|
||||
moment(data[i].timePosted).fromNow() +
|
||||
" by <a href='/" + data[i].author.username + "'>@" + data[i].author.username + "</a> " +"</a> " +
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
.col-xs-12.col-md-1
|
||||
label.control-label.control-label-story-submission(for='name') Title
|
||||
.col-xs-12.col-md-11
|
||||
input#story-title.form-control(placeholder='Type a headline for your link here', name='Title', maxlength='140' autofocus)
|
||||
input#story-title.form-control(placeholder='Type a headline for your link here', name='Title', maxlength='90' autofocus)
|
||||
.form-group
|
||||
.col-xs-12.col-md-1
|
||||
label.control-label.control-label-story-submission(for='name') Description
|
||||
|
|
Loading…
Reference in New Issue