From ab691dadc93510a1ae83221148e2e679fa4533db Mon Sep 17 00:00:00 2001 From: Faisal N Date: Tue, 10 Oct 2023 18:08:37 -0400 Subject: [PATCH] bug fixes, force shorter description, image popups --- frontend/pages/article.ejs | 4 ++-- frontend/pages/articles.ejs | 2 +- frontend/pages/index.ejs | 2 +- frontend/pages/search.ejs | 2 +- frontend/pages/tag.ejs | 2 +- frontend/partials/foot.ejs | 3 ++- frontend/partials/footer.ejs | 1 + frontend/partials/head.ejs | 3 ++- frontend/partials/suggested.ejs | 2 +- frontend/public/css/styles.css | 18 +++++++++++++++++- 10 files changed, 29 insertions(+), 10 deletions(-) diff --git a/frontend/pages/article.ejs b/frontend/pages/article.ejs index 6615cc7..fd65a5c 100644 --- a/frontend/pages/article.ejs +++ b/frontend/pages/article.ejs @@ -21,7 +21,7 @@

<%= article.title %>

- <% if (article.description != null) { %>

<%= article.description.slice(0, 97) %>...

<% } %> + <% if (article.description != null) { %>

<%= article.description.slice(0, 50) %>...

<% } %>
<%= pageviews %> Views
<% if (article.tags != null) { %>

Tags: <% for (tag of article.tags) { %><%= toTitleCase(tag) %> <% } %>

<% } %>
@@ -43,7 +43,7 @@ <% if (article.images[0] != null) { %>
<% for (image of article.images) { %> -
<% if (image.description != "") { %>

<%= image.description %>

<% } %>
+ data-title="<%= image.description %>"<% } %>><% if (image.description != "") { %>

<%= image.description %>

<% } %>
<% } %>
<% } %> diff --git a/frontend/pages/articles.ejs b/frontend/pages/articles.ejs index 3eb56d7..77711ab 100644 --- a/frontend/pages/articles.ejs +++ b/frontend/pages/articles.ejs @@ -24,7 +24,7 @@

<%= article.title %>

- <% if (article.description != null) { %>

<%= article.description.slice(0, 97) %>...

<% } %> + <% if (article.description != null) { %>

<%= article.description.slice(0, 50) %>...

<% } %>

<% if (article.tags != null) { %><%= article.tags[0] %> / <% } %><% 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 %><% } %>

diff --git a/frontend/pages/index.ejs b/frontend/pages/index.ejs index 988cd0b..2796965 100644 --- a/frontend/pages/index.ejs +++ b/frontend/pages/index.ejs @@ -43,7 +43,7 @@

<%= article.title %>

- <% if (article.description != null) { %>

<%= article.description.slice(0, 97) %>...

<% } %> + <% if (article.description != null) { %>

<%= article.description.slice(0, 50) %>...

<% } %>

<% if (article.tags != null) { %><%= article.tags[0] %> / <% } %><% 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 %><% } %>

diff --git a/frontend/pages/search.ejs b/frontend/pages/search.ejs index 417eee7..b5220ac 100644 --- a/frontend/pages/search.ejs +++ b/frontend/pages/search.ejs @@ -60,7 +60,7 @@

Article: <%= article.title %>

- <% if (article.description != null) { %>

<%= article.description.slice(0, 97) %>...

<% } %> + <% if (article.description != null) { %>

<%= article.description.slice(0, 50) %>...

<% } %>

<% if (tags != null) { %><%= article.tags[0] %> / <% } %><% 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 %><% } %>

diff --git a/frontend/pages/tag.ejs b/frontend/pages/tag.ejs index 39b6513..78b05ed 100644 --- a/frontend/pages/tag.ejs +++ b/frontend/pages/tag.ejs @@ -31,7 +31,7 @@

<%= article.title %>

-

<%= article.description.slice(0, 97) %>...

+

<%= article.description.slice(0, 50) %>...

<% if (article.tags != null) { %><%= article.tags[0] %> / <% } %><% 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' }) %><% } %>

diff --git a/frontend/partials/foot.ejs b/frontend/partials/foot.ejs index 54c83a7..9b8a2c2 100644 --- a/frontend/partials/foot.ejs +++ b/frontend/partials/foot.ejs @@ -2,4 +2,5 @@ var domain = "<%- vars.domain %>"; var page = window.location.toString().split(`${domain}`)[1].split("?")[0]; - \ No newline at end of file + + \ No newline at end of file diff --git a/frontend/partials/footer.ejs b/frontend/partials/footer.ejs index 8ac7110..ecb4be9 100644 --- a/frontend/partials/footer.ejs +++ b/frontend/partials/footer.ejs @@ -9,6 +9,7 @@ <%- include('socials.ejs') %>

© <%= cms.siteDetails[0].title %> <%= cms.siteDetails[0].est %> - <%= new Date().getFullYear() %> | Admin (Host) | <%- vars.environment.replace(/\w\S*/g, function(txt) { return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase() }) %> Version | <%= pageviews %> Views

We use cookies for analytics and security.

+ diff --git a/frontend/partials/head.ejs b/frontend/partials/head.ejs index 5cd92a3..8b7103f 100644 --- a/frontend/partials/head.ejs +++ b/frontend/partials/head.ejs @@ -28,4 +28,5 @@ gtag('js', new Date()); gtag('config', 'G-VB8PCR81YJ'); - \ No newline at end of file + + \ No newline at end of file diff --git a/frontend/partials/suggested.ejs b/frontend/partials/suggested.ejs index 4fe6c5d..95f7d98 100644 --- a/frontend/partials/suggested.ejs +++ b/frontend/partials/suggested.ejs @@ -13,7 +13,7 @@ function ifYesterday(date) {

<%= article.title %>

- <% if (article.description != null) { %>

<%= article.description.slice(0, 97) %>...

<% } %> + <% if (article.description != null) { %>

<%= article.description.slice(0, 50) %>...

<% } %>

<% if (article.tags != null) { %><%= article.tags[0] %> / <% } %><% 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 %><% } %>

diff --git a/frontend/public/css/styles.css b/frontend/public/css/styles.css index f8a3dda..1bef2fe 100644 --- a/frontend/public/css/styles.css +++ b/frontend/public/css/styles.css @@ -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; @@ -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; @@ -596,6 +599,10 @@ header .main .search form input::placeholder { text-decoration: underline; } +.article-i .content img { + width: 100%; +} + .article-i object { height: 100vh; } @@ -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; } \ No newline at end of file