From 4f65db4bce954f49618e657349e11dcdfec8f016 Mon Sep 17 00:00:00 2001 From: Bashynx Date: Fri, 21 Nov 2025 09:09:26 +0100 Subject: [PATCH] Cleanup of the code --- themes/openalt/layout/_partial/article.ejs | 29 ----- themes/openalt/layout/_partial/feed.ejs | 4 +- .../layout/_partial/index/feed_preview.ejs | 23 ---- .../{index/main_event.ejs => index_event.ejs} | 2 +- .../layout/_partial/index_minifeed.ejs | 21 ++++ .../partners.ejs => index_partners.ejs} | 4 - .../{post_feed.ejs => post_preview.ejs} | 0 themes/openalt/layout/archive.ejs | 17 +-- themes/openalt/layout/category.ejs | 6 +- themes/openalt/layout/index.ejs | 16 +-- themes/openalt/layout/post.ejs | 30 ++++- themes/openalt/layout/tag.ejs | 6 +- themes/openalt/source/css/style.css | 108 +++++++----------- 13 files changed, 120 insertions(+), 146 deletions(-) delete mode 100644 themes/openalt/layout/_partial/article.ejs delete mode 100644 themes/openalt/layout/_partial/index/feed_preview.ejs rename themes/openalt/layout/_partial/{index/main_event.ejs => index_event.ejs} (76%) create mode 100644 themes/openalt/layout/_partial/index_minifeed.ejs rename themes/openalt/layout/_partial/{index/partners.ejs => index_partners.ejs} (83%) rename themes/openalt/layout/_partial/{post_feed.ejs => post_preview.ejs} (100%) diff --git a/themes/openalt/layout/_partial/article.ejs b/themes/openalt/layout/_partial/article.ejs deleted file mode 100644 index 88cdacc..0000000 --- a/themes/openalt/layout/_partial/article.ejs +++ /dev/null @@ -1,29 +0,0 @@ -
- <% if(page.photos && page.photos.length) { %> -
- <%- page.title || "> -
- <% } %> - -
-
-
-

<%= page.title || "Untitled" %>

- <%- include('date', { date: page.date.toISOString() }) %> by <%= page.author %> -

<%= page.description %>

-
-
- <%- page.content %> -
- -
-
-
\ No newline at end of file diff --git a/themes/openalt/layout/_partial/feed.ejs b/themes/openalt/layout/_partial/feed.ejs index 7d8dee5..573fc4d 100644 --- a/themes/openalt/layout/_partial/feed.ejs +++ b/themes/openalt/layout/_partial/feed.ejs @@ -1,6 +1,6 @@ -
+
<% page.posts.forEach(function(post) { %> - <%- include('post_feed', + <%- include('post_preview', { post: post, source: "feed" }) %> diff --git a/themes/openalt/layout/_partial/index/feed_preview.ejs b/themes/openalt/layout/_partial/index/feed_preview.ejs deleted file mode 100644 index dae1bea..0000000 --- a/themes/openalt/layout/_partial/index/feed_preview.ejs +++ /dev/null @@ -1,23 +0,0 @@ -
-
- <% counter = 3 %> - <% page.posts.forEach(function(post) { %> - <% if (counter != 0) { %> - <% isEvent = false %> - <% post.tags.data.forEach(function(tag) { %> - <% if (tag.name == "Events") { %> - <% isEvent = true %> - <% } %> - <% }); %> - - <% if (isEvent == false) { %> - <%- include('./../post_feed', - { post: post, - source: "index" - }) %> - <% counter = counter - 1 %> - <% } %> - <% } %> - <% }); %> -
-
\ No newline at end of file diff --git a/themes/openalt/layout/_partial/index/main_event.ejs b/themes/openalt/layout/_partial/index_event.ejs similarity index 76% rename from themes/openalt/layout/_partial/index/main_event.ejs rename to themes/openalt/layout/_partial/index_event.ejs index 6bba3e2..4106567 100644 --- a/themes/openalt/layout/_partial/index/main_event.ejs +++ b/themes/openalt/layout/_partial/index_event.ejs @@ -3,7 +3,7 @@ <% page.posts.forEach(function(post) { %> <% post.tags.data.forEach(function(tag) { %> <% if ( (tag.name == "Events") && (counter != 0) ) { %> - <%- include('./../post_feed', { post: post, source: "index", event: counter }) %> + <%- include('post_preview', { post: post, source: "index", event: counter }) %> <% counter = counter - 1 %> <% } %> <% }); %> diff --git a/themes/openalt/layout/_partial/index_minifeed.ejs b/themes/openalt/layout/_partial/index_minifeed.ejs new file mode 100644 index 0000000..d5af294 --- /dev/null +++ b/themes/openalt/layout/_partial/index_minifeed.ejs @@ -0,0 +1,21 @@ +
+ <% counter = 3 %> + <% page.posts.forEach(function(post) { %> + <% if (counter != 0) { %> + <% isEvent = false %> + <% post.tags.data.forEach(function(tag) { %> + <% if (tag.name == "Events") { %> + <% isEvent = true %> + <% } %> + <% }); %> + + <% if (isEvent == false) { %> + <%- include('post_preview', + { post: post, + source: "index" + }) %> + <% counter = counter - 1 %> + <% } %> + <% } %> + <% }); %> +
\ No newline at end of file diff --git a/themes/openalt/layout/_partial/index/partners.ejs b/themes/openalt/layout/_partial/index_partners.ejs similarity index 83% rename from themes/openalt/layout/_partial/index/partners.ejs rename to themes/openalt/layout/_partial/index_partners.ejs index fe257a5..7b21d30 100644 --- a/themes/openalt/layout/_partial/index/partners.ejs +++ b/themes/openalt/layout/_partial/index_partners.ejs @@ -5,14 +5,10 @@
-
    <% site.data.partners.forEach(function(partner) { %> -
  • <%= partner.name %> -
  • <% }); %> -
\ No newline at end of file diff --git a/themes/openalt/layout/_partial/post_feed.ejs b/themes/openalt/layout/_partial/post_preview.ejs similarity index 100% rename from themes/openalt/layout/_partial/post_feed.ejs rename to themes/openalt/layout/_partial/post_preview.ejs diff --git a/themes/openalt/layout/archive.ejs b/themes/openalt/layout/archive.ejs index 29d9508..875a1ad 100644 --- a/themes/openalt/layout/archive.ejs +++ b/themes/openalt/layout/archive.ejs @@ -1,14 +1,5 @@ -
- <% site.posts.sort('-date').forEach(function(post) { %> - <%- include('_partial/post_feed', - { post: post, +<%- include("_partial/feed", + { item: page.posts.sort('-date'), source: "archive" - }) %> - <% }); %> - - -
\ No newline at end of file + } +)%> \ No newline at end of file diff --git a/themes/openalt/layout/category.ejs b/themes/openalt/layout/category.ejs index 5a7de68..aef090b 100644 --- a/themes/openalt/layout/category.ejs +++ b/themes/openalt/layout/category.ejs @@ -1 +1,5 @@ -<%- include("_partial/feed", { item: page.posts.sort('-date') }) %> \ No newline at end of file +<%- include("_partial/feed", + { item: page.posts.sort('-date'), + source: "category" + } +)%> \ No newline at end of file diff --git a/themes/openalt/layout/index.ejs b/themes/openalt/layout/index.ejs index c8d9e16..687499c 100644 --- a/themes/openalt/layout/index.ejs +++ b/themes/openalt/layout/index.ejs @@ -1,9 +1,11 @@ -<%- include("_partial/index/main_event", { - item: site.posts.sort('-date') -}) %> +
+ <%- include("_partial/index_event", { + item: site.posts.sort('-date') + }) %> -<%- include("_partial/index/feed_preview", { - item: site.posts.sort('-date') -}) %> + <%- include("_partial/index_minifeed", { + item: site.posts.sort('-date') + }) %> -<%- include("_partial/index/partners") %> \ No newline at end of file + <%- include("_partial/index_partners") %> +
\ No newline at end of file diff --git a/themes/openalt/layout/post.ejs b/themes/openalt/layout/post.ejs index 0b8fd7f..b622273 100644 --- a/themes/openalt/layout/post.ejs +++ b/themes/openalt/layout/post.ejs @@ -1 +1,29 @@ -<%- include("_partial/article", { page: page }) %> \ No newline at end of file +
+ <% if(page.photos && page.photos.length) { %> +
+ <%- page.title || "> +
+ <% } %> + +
+
+
+

<%= page.title || "Untitled" %>

+ <%- include('_partial/date', { date: page.date.toISOString() }) %> by <%= page.author %> +

<%= page.description %>

+
+
+ <%- page.content %> +
+ +
+
+
\ No newline at end of file diff --git a/themes/openalt/layout/tag.ejs b/themes/openalt/layout/tag.ejs index 5a7de68..4ab5974 100644 --- a/themes/openalt/layout/tag.ejs +++ b/themes/openalt/layout/tag.ejs @@ -1 +1,5 @@ -<%- include("_partial/feed", { item: page.posts.sort('-date') }) %> \ No newline at end of file +<%- include("_partial/feed", + { item: page.posts.sort('-date'), + source: "tag" + } +)%> \ No newline at end of file diff --git a/themes/openalt/source/css/style.css b/themes/openalt/source/css/style.css index 607d1bd..f8edeb3 100644 --- a/themes/openalt/source/css/style.css +++ b/themes/openalt/source/css/style.css @@ -3,6 +3,8 @@ body { margin: auto; font-size: 14px; background-color: #0D1117; + color: #dcdcdf; + position: relative; } .body { @@ -15,6 +17,10 @@ h1, h2, h3, h4 { padding: 0; margin: 0; font-weight: lighter; +} + +.post h2, +.post { color: #0D1117; } @@ -22,6 +28,7 @@ h1 { font-size: 25px; line-height: 30px; text-align: center; + margin: 20px auto; } h2 { @@ -40,6 +47,13 @@ h4 { font-style: italic; } +.homepage h1 { + font-size: 35px !important; + line-height: 40px !important; + padding-bottom: 15px; + color: #dcdcdf; +} + a { text-decoration: none; color: #31486b; @@ -172,10 +186,6 @@ img { color:#0D1117; } -.post { - margin-bottom: 20px; -} - .date { color: #0D1117; font-style: italic; @@ -188,42 +198,28 @@ iframe { } /* Post - Top section */ -.post-page{ +.post{ width: 80%; margin: 0 auto; + margin-bottom: 20px; } -.post-page img{ +.post img{ border-radius: 5px; } -.post-page .post-text-wrapper{ +.post .post-text-wrapper{ border-radius: 5px; background-color: #becadd; margin-top: 10px; } -.post-page .post-text{ +.post .post-text{ width: 80%; margin: 0 auto; padding: 40px 0; } -.article { - font-size: 35px !important; - line-height: 40px !important; - padding-bottom: 15px; -} - -.page-date{ - text-align: right !important; -} - -.page-divider { - margin-top: 1em; - border-top: 1px solid #0D1117; -} - /* Post - Tags */ .tags { text-align: right; @@ -245,57 +241,49 @@ section { margin-bottom: 20px; } -.section-title h1{ - color: #dcdcdf; - margin: 20px auto; +/* Events */ +.event{ + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; } -/* Events */ .event-wrapper { text-align: center; margin: 0 auto; min-height: calc(100vh - 63px); + display: block; } .event-spacer{ margin: 10px 0; } -.event .event-wrapper h1, -.event .event-wrapper h2, -.event .event-wrapper h3, -.event .event-wrapper h4, -.event .event-wrapper p { - color: #dcdcdf; +.event-wrapper img{ + vertical-align: middle; + margin: auto; + min-width: 400px; + min-height: 400px; +} + +.event .event-wrapper { padding-bottom: 5px; } .event .event-wrapper a { color: #fcd116; - padding-bottom: 5px; } -.event-wrapper h1{ - font-size: 35px; - line-height: 40px; - font-style: normal; -} - -.event-wrapper img{ - vertical-align: middle; - margin:50px auto; - min-width: 400px; - min-height: 400px; -} /* Feed Preview */ -.feed_preview { +#minifeed { display: flex; flex-wrap: wrap; gap: 1.25%; } -.feed_preview .post { +#minifeed .post { width: 32.5%; } @@ -310,7 +298,7 @@ section { margin: 0 auto; } -.partners li { +.partners a { width: 200px; text-align: center; margin: auto; @@ -339,33 +327,34 @@ section { display: flex !important; flex-wrap: nowrap !important; align-items: center; - gap: 5%; + gap: 5px; margin-top: 50px; + width: 500px; margin: 0 auto; } .member-wrapper{ - width: 80%; + width: 500px; + margin: 0 auto; } .member .page-img img { border-radius: 250px; border: 2px solid #ce1126; - width: auto; + width: 125px; height: auto; - max-width: 90%; margin: auto; display: block; } .member .page-img { - flex: 0 0 25%; + flex: 0 0 125px; display: flex; align-items: center; justify-content: center; } .member .page-text { - flex: 0 0 70%; + flex: 0 0 370px; border-radius: 5px; margin: 0 auto; padding: 25px; @@ -379,13 +368,4 @@ section { .page{ width: 50%; margin: 0 auto; -} - -.page, -.page h1, -.page h2, -.member, -.member h1, -.member h2{ - color: #dcdcdf; } \ No newline at end of file