Cleanup of the code

This commit is contained in:
Bashy 2025-11-21 09:09:26 +01:00
parent 6074b9c152
commit 4f65db4bce
13 changed files with 120 additions and 146 deletions

View file

@ -1,29 +0,0 @@
<div class="post-page post">
<% if(page.photos && page.photos.length) { %>
<div class="post-cover">
<img class="gallery" src="<%- config.root %><%- page.photos[0] %>" alt="<%- page.title || "Untitled" %>">
</div>
<% } %>
<div class="post-text-wrapper">
<div class="post-text">
<div class="post-header">
<h1 class="article"><%= page.title || "Untitled" %></h1>
<span class="smoll"><%- include('date', { date: page.date.toISOString() }) %> by <%= page.author %></span>
<p><%= page.description %></p>
</div>
<div class="post-content">
<%- page.content %>
</div>
<div class="post-footer">
<div class="tags smoll">
<% if (page.tags) { %>
<% page.tags.data.forEach(function(tag) { %>
<a href="<%= url_for('/tags/' + tag.name) %>">#<%= tag.name %></a>
<% }); %>
<% } else {console.log(page)} %>
</div>
</div>
</div>
</div>
</div>

View file

@ -1,6 +1,6 @@
<div class="narrow_view"> <div>
<% page.posts.forEach(function(post) { %> <% page.posts.forEach(function(post) { %>
<%- include('post_feed', <%- include('post_preview',
{ post: post, { post: post,
source: "feed" source: "feed"
}) %> }) %>

View file

@ -1,23 +0,0 @@
<section id="feed_preview">
<div class="feed_preview">
<% 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 %>
<% } %>
<% } %>
<% }); %>
</div>
</section>

View file

@ -3,7 +3,7 @@
<% page.posts.forEach(function(post) { %> <% page.posts.forEach(function(post) { %>
<% post.tags.data.forEach(function(tag) { %> <% post.tags.data.forEach(function(tag) { %>
<% if ( (tag.name == "Events") && (counter != 0) ) { %> <% 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 %> <% counter = counter - 1 %>
<% } %> <% } %>
<% }); %> <% }); %>

View file

@ -0,0 +1,21 @@
<section id="minifeed">
<% 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 %>
<% } %>
<% } %>
<% }); %>
</section>

View file

@ -5,14 +5,10 @@
</div> </div>
<div class="partners"> <div class="partners">
<ul class="partners">
<% site.data.partners.forEach(function(partner) { %> <% site.data.partners.forEach(function(partner) { %>
<li>
<a href="<%= partner.url %>"> <a href="<%= partner.url %>">
<img src="<%= partner.logo %>" alt="<%= partner.name %>"> <img src="<%= partner.logo %>" alt="<%= partner.name %>">
</a> </a>
</li>
<% }); %> <% }); %>
</ul>
</div> </div>
</section> </section>

View file

@ -1,14 +1,5 @@
<div class="narrow_view"> <%- include("_partial/feed",
<% site.posts.sort('-date').forEach(function(post) { %> { item: page.posts.sort('-date'),
<%- include('_partial/post_feed',
{ post: post,
source: "archive" source: "archive"
}) %> }
<% }); %> )%>
<div class="pagination">
<% if (page.next) { %>
<a href="<%- url_for(page.next_link) %>"></a>
<% } %>
</div>
</div>

View file

@ -1 +1,5 @@
<%- include("_partial/feed", { item: page.posts.sort('-date') }) %> <%- include("_partial/feed",
{ item: page.posts.sort('-date'),
source: "category"
}
)%>

View file

@ -1,9 +1,11 @@
<%- include("_partial/index/main_event", { <div class="homepage">
item: site.posts.sort('-date') <%- include("_partial/index_event", {
}) %> item: site.posts.sort('-date')
}) %>
<%- include("_partial/index/feed_preview", { <%- include("_partial/index_minifeed", {
item: site.posts.sort('-date') item: site.posts.sort('-date')
}) %> }) %>
<%- include("_partial/index/partners") %> <%- include("_partial/index_partners") %>
</div>

View file

@ -1 +1,29 @@
<%- include("_partial/article", { page: page }) %> <div class="post-page post">
<% if(page.photos && page.photos.length) { %>
<div class="post-cover">
<img class="gallery" src="<%- config.root %><%- page.photos[0] %>" alt="<%- page.title || "Untitled" %>">
</div>
<% } %>
<div class="post-text-wrapper">
<div class="post-text">
<div class="post-header">
<h1 class="article"><%= page.title || "Untitled" %></h1>
<span class="smoll"><%- include('_partial/date', { date: page.date.toISOString() }) %> by <%= page.author %></span>
<p><%= page.description %></p>
</div>
<div class="post-content">
<%- page.content %>
</div>
<div class="post-footer">
<div class="tags smoll">
<% if (page.tags) { %>
<% page.tags.data.forEach(function(tag) { %>
<a href="<%= url_for('/tags/' + tag.name) %>">#<%= tag.name %></a>
<% }); %>
<% } else {console.log(page)} %>
</div>
</div>
</div>
</div>
</div>

View file

@ -1 +1,5 @@
<%- include("_partial/feed", { item: page.posts.sort('-date') }) %> <%- include("_partial/feed",
{ item: page.posts.sort('-date'),
source: "tag"
}
)%>

View file

@ -3,6 +3,8 @@ body {
margin: auto; margin: auto;
font-size: 14px; font-size: 14px;
background-color: #0D1117; background-color: #0D1117;
color: #dcdcdf;
position: relative;
} }
.body { .body {
@ -15,6 +17,10 @@ h1, h2, h3, h4 {
padding: 0; padding: 0;
margin: 0; margin: 0;
font-weight: lighter; font-weight: lighter;
}
.post h2,
.post {
color: #0D1117; color: #0D1117;
} }
@ -22,6 +28,7 @@ h1 {
font-size: 25px; font-size: 25px;
line-height: 30px; line-height: 30px;
text-align: center; text-align: center;
margin: 20px auto;
} }
h2 { h2 {
@ -40,6 +47,13 @@ h4 {
font-style: italic; font-style: italic;
} }
.homepage h1 {
font-size: 35px !important;
line-height: 40px !important;
padding-bottom: 15px;
color: #dcdcdf;
}
a { a {
text-decoration: none; text-decoration: none;
color: #31486b; color: #31486b;
@ -172,10 +186,6 @@ img {
color:#0D1117; color:#0D1117;
} }
.post {
margin-bottom: 20px;
}
.date { .date {
color: #0D1117; color: #0D1117;
font-style: italic; font-style: italic;
@ -188,42 +198,28 @@ iframe {
} }
/* Post - Top section */ /* Post - Top section */
.post-page{ .post{
width: 80%; width: 80%;
margin: 0 auto; margin: 0 auto;
margin-bottom: 20px;
} }
.post-page img{ .post img{
border-radius: 5px; border-radius: 5px;
} }
.post-page .post-text-wrapper{ .post .post-text-wrapper{
border-radius: 5px; border-radius: 5px;
background-color: #becadd; background-color: #becadd;
margin-top: 10px; margin-top: 10px;
} }
.post-page .post-text{ .post .post-text{
width: 80%; width: 80%;
margin: 0 auto; margin: 0 auto;
padding: 40px 0; 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 */ /* Post - Tags */
.tags { .tags {
text-align: right; text-align: right;
@ -245,57 +241,49 @@ section {
margin-bottom: 20px; margin-bottom: 20px;
} }
.section-title h1{ /* Events */
color: #dcdcdf; .event{
margin: 20px auto; display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
} }
/* Events */
.event-wrapper { .event-wrapper {
text-align: center; text-align: center;
margin: 0 auto; margin: 0 auto;
min-height: calc(100vh - 63px); min-height: calc(100vh - 63px);
display: block;
} }
.event-spacer{ .event-spacer{
margin: 10px 0; margin: 10px 0;
} }
.event .event-wrapper h1, .event-wrapper img{
.event .event-wrapper h2, vertical-align: middle;
.event .event-wrapper h3, margin: auto;
.event .event-wrapper h4, min-width: 400px;
.event .event-wrapper p { min-height: 400px;
color: #dcdcdf; }
.event .event-wrapper {
padding-bottom: 5px; padding-bottom: 5px;
} }
.event .event-wrapper a { .event .event-wrapper a {
color: #fcd116; 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 */
.feed_preview { #minifeed {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 1.25%; gap: 1.25%;
} }
.feed_preview .post { #minifeed .post {
width: 32.5%; width: 32.5%;
} }
@ -310,7 +298,7 @@ section {
margin: 0 auto; margin: 0 auto;
} }
.partners li { .partners a {
width: 200px; width: 200px;
text-align: center; text-align: center;
margin: auto; margin: auto;
@ -339,33 +327,34 @@ section {
display: flex !important; display: flex !important;
flex-wrap: nowrap !important; flex-wrap: nowrap !important;
align-items: center; align-items: center;
gap: 5%; gap: 5px;
margin-top: 50px; margin-top: 50px;
width: 500px;
margin: 0 auto; margin: 0 auto;
} }
.member-wrapper{ .member-wrapper{
width: 80%; width: 500px;
margin: 0 auto;
} }
.member .page-img img { .member .page-img img {
border-radius: 250px; border-radius: 250px;
border: 2px solid #ce1126; border: 2px solid #ce1126;
width: auto; width: 125px;
height: auto; height: auto;
max-width: 90%;
margin: auto; margin: auto;
display: block; display: block;
} }
.member .page-img { .member .page-img {
flex: 0 0 25%; flex: 0 0 125px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.member .page-text { .member .page-text {
flex: 0 0 70%; flex: 0 0 370px;
border-radius: 5px; border-radius: 5px;
margin: 0 auto; margin: 0 auto;
padding: 25px; padding: 25px;
@ -379,13 +368,4 @@ section {
.page{ .page{
width: 50%; width: 50%;
margin: 0 auto; margin: 0 auto;
}
.page,
.page h1,
.page h2,
.member,
.member h1,
.member h2{
color: #dcdcdf;
} }