Browse Source

Fixed image width issue on single post pages.

pull/4/head
jrtechs 6 years ago
parent
commit
9e8ae921fd
1 changed files with 8 additions and 8 deletions
  1. +8
    -8
      posts/singlePost.js

+ 8
- 8
posts/singlePost.js View File

@ -114,23 +114,23 @@ module.exports=
{ {
return new Promise(function (resolve, reject) return new Promise(function (resolve, reject)
{ {
var html = "<div class=\"blogPost\">";
var htmlHead = "<div class=\"blogPost\">";
//image //image
if(!(post.picture_url === "n/a")) if(!(post.picture_url === "n/a"))
{ {
html +="<img src=\"/img/posts/" + post.picture_url +
htmlHead +="<img src=\"/img/posts/" + post.picture_url +
"\" alt=\"\" style=\"width:100%; height:10%\">"; "\" alt=\"\" style=\"width:100%; height:10%\">";
} }
html += "<div class=\"p-4\"><div class=\"\">";
htmlHead += "<div class=\"p-4\"><div class=\"\">";
//title //title
html += "<h3><b>" + post.name + "</b></h3>";
htmlHead += "<h3><b>" + post.name + "</b></h3>";
//date //date
html += "<h5><span class=\"w3-opacity\">" +
htmlHead += "<h5><span class=\"w3-opacity\">" +
post.published.toDateString() + "</span></h5>"; post.published.toDateString() + "</span></h5>";
html +="</div>";
htmlHead +="</div>";
html += "<div class=\"\">";
var html = "<div class=\"\">";
try try
{ {
sql.getCategory(post.category_id).then(function(category) sql.getCategory(post.category_id).then(function(category)
@ -146,7 +146,7 @@ module.exports=
html = html.split("<code>").join("<code class='hljs cpp'>"); html = html.split("<code>").join("<code class='hljs cpp'>");
html += "</div></div></div><br><br>"; html += "</div></div></div><br><br>";
resolve(html);
resolve(htmlHead + html);
}); });
} }
catch(ex) catch(ex)

Loading…
Cancel
Save