Skip to content

Commit

Permalink
bug fixes, force shorter description, image popups
Browse files Browse the repository at this point in the history
  • Loading branch information
Faisal N committed Oct 10, 2023
1 parent d294b18 commit ab691da
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 10 deletions.
4 changes: 2 additions & 2 deletions frontend/pages/article.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<div class="left">
<div class="info">
<h1><%= article.title %></h1>
<% if (article.description != null) { %><h3><%= article.description.slice(0, 97) %>...</h3><% } %>
<% if (article.description != null) { %><h3><%= article.description.slice(0, 50) %>...</h3><% } %>
<h5><%= pageviews %> Views</h5>
<% if (article.tags != null) { %><p>Tags: <% for (tag of article.tags) { %><a href="<%- vars.domain %>/tags/<%= tag %>"><%= toTitleCase(tag) %></a> <% } %></p><% } %>
</div>
Expand All @@ -43,7 +43,7 @@
<% if (article.images[0] != null) { %>
<div class="images">
<% for (image of article.images) { %>
<div class="image" style="background-image: url('<%- vars.asset_prefix %><%= image.path %>');<% if ((image.height / image.width) >= 1.25) { %> width: <%= image.width %>px;<% } %>"><% if (image.description != "") { %><h2><%= image.description %></h2><% } %></div>
<a class="image" style="background-image: url('<%- vars.asset_prefix %><%= image.path %>');<% if ((image.height / image.width) >= 1.25) { %> width: <%= image.width %>px;<% } %>" href="<%- vars.asset_prefix %><%= image.path %>" data-lightbox="<%= image._id %>"<% if (image.description != "") { %> data-title="<%= image.description %>"<% } %>><% if (image.description != "") { %><h2><%= image.description %></h2><% } %></a>
<% } %>
</div>
<% } %>
Expand Down
2 changes: 1 addition & 1 deletion frontend/pages/articles.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<a href="<%- vars.domain %>/articles/<%= new Date(article.date).getFullYear() %>/<%= article.slug %>">
<h3><%= article.title %></h3>
</a>
<% if (article.description != null) { %><h4><%= article.description.slice(0, 97) %>...</h4><% } %>
<% if (article.description != null) { %><h4><%= article.description.slice(0, 50) %>...</h4><% } %>
<p><% if (article.tags != null) { %><a href="<%- vars.domain %>/tags/<%= article.tags[0].toLowerCase() %>"><%= article.tags[0] %></a> / <% } %><% 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>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/pages/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<a href="<%- vars.domain %>/articles/<%= new Date(article.date).getFullYear() %>/<%= article.slug %>">
<h3><%= article.title %></h3>
</a>
<% if (article.description != null) { %><h4><%= article.description.slice(0, 97) %>...</h4><% } %>
<% if (article.description != null) { %><h4><%= article.description.slice(0, 50) %>...</h4><% } %>
<p><% if (article.tags != null) { %><a href="<%- vars.domain %>/tags/<%= article.tags[0].toLowerCase() %>"><%= article.tags[0] %></a> / <% } %><% 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>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/pages/search.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<a href="<%- vars.domain %>/articles/<%= new Date(article.date).getFullYear() %>/<%= article.slug %>">
<h3>Article: <%= article.title %></h3>
</a>
<% if (article.description != null) { %><h4><%= article.description.slice(0, 97) %>...</h4><% } %>
<% if (article.description != null) { %><h4><%= article.description.slice(0, 50) %>...</h4><% } %>
<p><% if (tags != null) { %><a href="<%- vars.domain %>/tags/<%= article.tags[0].toLowerCase() %>"><%= article.tags[0] %></a> / <% } %><% 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>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/pages/tag.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<a href="<%- vars.domain %>/articles/<%= new Date(article.date).getFullYear() %>/<%= article.slug %>">
<h3><%= article.title %></h3>
</a>
<h4><%= article.description.slice(0, 97) %>...</h4>
<h4><%= article.description.slice(0, 50) %>...</h4>
<p><% if (article.tags != null) { %><a href="<%- vars.domain %>/tags/<%= article.tags[0].toLowerCase() %>"><%= article.tags[0] %></a> / <% } %><% var date = new Date(article._created * 1000); if (date.isToday()) { %>Today<% } else if (ifYesterday(date)) { %>Yesterday<% } else { %><%= date.toLocaleDateString('en-US', { month: 'long', day: 'numeric', year: 'numeric' }) %><% } %></p>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion frontend/partials/foot.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
var domain = "<%- vars.domain %>";
var page = window.location.toString().split(`${domain}`)[1].split("?")[0];
</script>
<script src="<%- vars.domain %>/js/scripts.js"></script>
<script src="<%- vars.domain %>/js/scripts.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lightbox2/2.11.4/js/lightbox-plus-jquery.min.js" integrity="sha512-U9dKDqsXAE11UA9kZ0XKFyZ2gQCj+3AwZdBMni7yXSvWqLFEj8C1s7wRmWl9iyij8d5zb4wm56j4z/JVEwS77g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
1 change: 1 addition & 0 deletions frontend/partials/footer.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<%- include('socials.ejs') %>
<p>&copy; <%= cms.siteDetails[0].title %> <%= cms.siteDetails[0].est %> - <%= new Date().getFullYear() %> | <a href="<%- vars.domain %>/admin">Admin<a href="https://dangoweb.com/?from=<%= cms.siteDetails[0].title.toLowerCase().replaceAll(' ', '-') %>" style="display: none;"> (Host)</a></a> | <%- vars.environment.replace(/\w\S*/g, function(txt) { return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase() }) %> Version | <%= pageviews %> Views</p>
<p>We use cookies for analytics and security.</p>
<!-- We use "Lightbox2" by -->
</div>
</div>
</footer>
Expand Down
3 changes: 2 additions & 1 deletion frontend/partials/head.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@
gtag('js', new Date());
gtag('config', 'G-VB8PCR81YJ');
</script>
</script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/lightbox2/2.11.4/css/lightbox.css" integrity="sha512-Woz+DqWYJ51bpVk5Fv0yES/edIMXjj3Ynda+KWTIkGoynAMHrqTcDUQltbipuiaD5ymEo9520lyoVOo9jCQOCA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
2 changes: 1 addition & 1 deletion frontend/partials/suggested.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function ifYesterday(date) {
<a href="<%- vars.domain %>/articles/<%= new Date(article.date).getFullYear() %>/<%= article.slug %>">
<h3><%= article.title %></h3>
</a>
<% if (article.description != null) { %><h4><%= article.description.slice(0, 97) %>...</h4><% } %>
<% if (article.description != null) { %><h4><%= article.description.slice(0, 50) %>...</h4><% } %>
<p><% if (article.tags != null) { %><a href="<%- vars.domain %>/tags/<%= article.tags[0].toLowerCase() %>"><%= article.tags[0] %></a> / <% } %><% 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>
</div>
</div>
Expand Down
18 changes: 17 additions & 1 deletion frontend/public/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,8 @@ header .main .search form input::placeholder {
justify-content: flex-end;
background-color: var(--background);
background-size: cover;
background-position: bottom;
background-position-x: center;
background-position-y: -100px;
border-bottom: 4px solid #ececec;
transition: 0.25s;
padding-top: 150px;
Expand Down Expand Up @@ -558,6 +559,8 @@ header .main .search form input::placeholder {

.article-i .image:first-of-type {
height: 60vh;
background-size: contain;
background-repeat: no-repeat;
grid-column-start: 1;
grid-column-end: 3;
display: flex;
Expand Down Expand Up @@ -596,6 +599,10 @@ header .main .search form input::placeholder {
text-decoration: underline;
}

.article-i .content img {
width: 100%;
}

.article-i object {
height: 100vh;
}
Expand Down Expand Up @@ -810,4 +817,13 @@ footer .inner .bottom a {
.articles.searchResults .grid .article .inner {
width: 100%;
gap: 0px;
}

.lb-outerContainer {
width: 90vw !important;
}

.lightbox .lb-image {
width: 100% !important;
height: unset !important;
}

0 comments on commit ab691da

Please sign in to comment.