Skip to content

Commit

Permalink
start bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalnjs committed Oct 17, 2023
1 parent b74662e commit 300a087
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions frontend/pages/newspaper.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@
<% if (newspaper.articles.length != 0) { %>
<div class="content">
<% for (article of newspaper.articles) { article = cms.articles.find(a => a._id === article._id); if (article) { %>
<h2><%= article.title %></h2>
<style>.article-i .content:before { content: '(<% if ((article.author != "") && (article.author != null)) { %><%- article.author %><% } else { %><%= cms.siteDetails[0].title %> Writers<% } %>) — ' }</style>
<%- article.content.replaceAll('/.spaces/', vars.asset_url) %>
<div class="article <%= article._id %>">
<h2><%= article.title %></h2>
<style>.article-i .content .<%= article._id %>:before { content: '(<% if ((article.author != "") && (article.author != null)) { %><%- article.author %><% } else { %><%= cms.siteDetails[0].title %> Writers<% } %>) — ' }</style>
<%- article.content.replaceAll('/.spaces/', vars.asset_url) %>
</div>
<br />
<% } } %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/partials/suggested.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<% const articles = cms.articles.filter(a => a.slug !== (article || []).slug).sort(() => Math.random() - 0.5).slice(0, 3); for (let i = 0; i < 3; i++) { const article = articles[i]; %>
<a class="article<% if (i % 3 === 0) { %> left<% } else if (i === 1 || (i - 1) % 3 === 0) { %> middle<% } else if ((i - 2) % 3 === 0) { %> right<% } %>" href="<%- vars.domain %>/articles/<%= new Date(article.date).getFullYear() %>/<%= article.slug %>" title="<%= article.title %>">
<div class="inner">
<img src="<% if (article.images[0] != null) { %><%- vars.asset_prefix %><%= article.images[0].path %>" <% if (article.images[0].width < article.images[0].height) { %>style="width: min-content;" <% } } else { %> "<% } %><% if (article.images[0].description != "") { %>alt="<%= article.images[0].description %>"<% } %> />
<img src="<% if (article.images[0] != null) { %><%- vars.asset_prefix %><%= article.images[0].path %>" <% if (article.images[0].width < article.images[0].height) { %>style="width: min-content;" <% if (article.images[0].description != "") { %>alt="<%= article.images[0].description %>"<% } %><% } } else { %> "<% } %> />
<h3><%= article.title %></h3>
<% if (article.description != null) { %><h4><%= article.description.slice(0, 50) %>...</h4><% } %>
<p><% var date = new Date(article.date); if (date.isToday()) { %>Today<% } else if (ifYesterday(date)) { %>Yesterday<% } else { %><%= date.toLocaleDateString('en-US', { month: 'long', day: 'numeric', year: 'numeric' }) %><% } %><% if ((article.author != "") && (article.author != null)) { %> / <%= article.author %><% } %></p>
Expand Down

0 comments on commit 300a087

Please sign in to comment.