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) { %>
<%- include('post_feed',
<%- include('post_preview',
{ post: post,
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) { %>
<% 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 %>
<% } %>
<% }); %>

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 class="partners">
<ul class="partners">
<% site.data.partners.forEach(function(partner) { %>
<li>
<a href="<%= partner.url %>">
<img src="<%= partner.logo %>" alt="<%= partner.name %>">
</a>
</li>
<% }); %>
</ul>
</div>
</section>

View file

@ -1,14 +1,5 @@
<div class="narrow_view">
<% site.posts.sort('-date').forEach(function(post) { %>
<%- include('_partial/post_feed',
{ post: post,
<%- include("_partial/feed",
{ item: page.posts.sort('-date'),
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">
<%- include("_partial/index_event", {
item: site.posts.sort('-date')
}) %>
<%- include("_partial/index/feed_preview", {
<%- include("_partial/index_minifeed", {
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;
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;
@ -380,12 +369,3 @@ section {
width: 50%;
margin: 0 auto;
}
.page,
.page h1,
.page h2,
.member,
.member h1,
.member h2{
color: #dcdcdf;
}