Initial commit

This commit is contained in:
Bashy 2026-03-27 16:47:50 +01:00
commit 52ae011cb6
16 changed files with 798 additions and 0 deletions

19
layout/_partial/date.ejs Normal file
View file

@ -0,0 +1,19 @@
<% {
const posted = new Date(date);
const now = new Date();
const day = ((d => {
if (d > 3 && d < 21) return d + 'th';
switch (d % 10) {
case 1: return d + 'st';
case 2: return d + 'nd';
case 3: return d + 'rd';
default: return d + 'th';
}
})(posted.getDate()));
const options = now.getFullYear() === posted.getFullYear()
? { month: 'long', hour: 'numeric', minute: 'numeric', hour12: true }
: { year: 'numeric', month: 'long'};
%>
<%= day %> <%= posted.toLocaleString('en-US', options).replace(/^(\d+)\s/, '') %>
<% } %>

12
layout/_partial/feed.ejs Normal file
View file

@ -0,0 +1,12 @@
<!-- Default number of columns is two. If 3 is defined, then third column is added-->
<div id="masonry">
<% page.posts.forEach(function(post) { %>
<%- include('post_feed', { post: post }) %>
<% }); %>
</div>
<div class="pagination">
<% if (page.next) { %>
<a href="<%- url_for(page.next_link) %>"></a>
<% } %>
</div>

View file

@ -0,0 +1,32 @@
<!-- This is the template for the post. It is used to display the posts in the feeds. -->
<% if(post.photos && post.photos.length) { %>
<% classTag = "post-with-image" %>
<% } else { %>
<% classTag = "post-without-image" %>
<% } %>
<div class="post-feed border">
<a href='<%= url_for(post.path) %>'><h1><%= post.title || "Untitled" %></h1>
<div class="<%= classTag %>">
<% if(post.photos && post.photos.length) { %>
<a href='<%= url_for(post.path) %>'>
<img class="border" src="<%- config.root %><%- post.photos[0] %>" alt="<%- post.title || 'Untitled' %>">
</a>
<% } %>
<div>
<div class="date smoll">
<a href='<%= url_for(post.path) %>'><%- include('date', { date: post.date.toISOString() }) %></a>
</div>
<p class="post_description"><%= post.description %></p>
<a href='<%= url_for(post.path) %>'><p>Read More...</p></a>
<div class="tags smoll">
<% post.tags.data.forEach(function(tag) { %>
<a href="<%= url_for('/tags/' + tag.slug || tag.name.replace(/\s+/g, '-')) %>">#<%= tag.name %></a>
<% }); %>
</div>
</div>

View file

@ -0,0 +1,17 @@
<div class="scarves">
<% theme.scarf.forEach(function(scarf, index) { %>
<% if (scarf.enable) { %>
<a href="<%= scarf.url %>">
<div class="scarf" title="<%= scarf.alt %>" style="right: <%= index * 30 %>px;
margin-top:-<%= ( (index % 5) * 10) + 40 %>px;
background-color:<%= scarf.color ? scarf.color : theme.primary_color %>;">
<% if(scarf.image) { %>
<img class= "logo" src="<%= url_for(scarf.image) %>" alt="<%= scarf.alt %>">
<% } else if(scarf.icon) { %>
<i class='logo <%= scarf.icon %>'></i>
<% } else%>
</div>
</a>
<% } %>
<% }); %>
</div>

9
layout/archive.ejs Normal file
View file

@ -0,0 +1,9 @@
<% site.tags.forEach(function(tag) { %>
<h2><%= tag.name %></h2>
<ul>
<% tag.posts.forEach(function(post) { %>
<li><a href="<%= post.url %>"><%= post.title %></a></li>
<% }); %>
</ul>
<% }); %>

1
layout/category.ejs Normal file
View file

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

1
layout/index.ejs Normal file
View file

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

133
layout/layout.ejs Normal file
View file

@ -0,0 +1,133 @@
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Metadata -->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="<%= config.description %>">
<meta name="author" content="<%= config.author %>">
<meta name="title" content="<%= config.title %> - <%= config.subtitle %>">
<meta name="theme-color" content="<%= theme.primary_color %>">
<!-- Open Graph Meta Tags -->
<meta property="og:title" content="<%= config.title %>">
<meta property="og:description" content="<%= config.description %>">
<meta property="og:image" content="<%= url_for(theme.banner) %>">
<meta property="og:type" content="website">
<meta property="og:url" content="<%= config.url %>">
<script data-goatcounter="https://bashynx.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>
<link rel="icon" href="<%= url_for(theme.favicon) %>">
<script src="<%= url_for(theme.fontawesome) %>" crossorigin="anonymous"></script>
<title><%= config.title %></title>
<link rel="stylesheet" href="<%= url_for('/css/style.css') %>">
<style>
a {
color: <%= theme.secondary_color %>;
}
a:hover {
color: <%= theme.primary_color %>;
}
.page a,
.post-feed a {
color: <%= theme.primary_color %>;
}
.page a:hover,
.post-feed a:hover {
color: <%= theme.secondary_color %>;
}
.avatar img {
border: 2px solid <%= theme.primary_color %>;
}
.tags a {
color: #6c6f72 !important;
}
</style>
</head>
<body>
<main>
<% if (theme.scarves) { %>
<%- include('_partial/scarves') %>
<% } %>
<% if (theme.sidebar) { %>
<div class="sidebar">
<!-- Banner -->
<a href="/">
<div class="banner">
<img src="<%= url_for(theme.banner) %>" alt="<%= config.author %>">
</div>
</a>
<!-- Sidebar Content -->
<div class="sidebar-content">
<!-- Avatar -->
<div class="avatar">
<img src="<%= url_for(theme.avatar) %>" alt="<%= config.author %>">
</div>
<% if (config.description) { %>
<p><%= config.description %></p>
<% } %>
<!-- Sidebar Menu -->
<nav>
<% theme.sidebar_menu.forEach(function(menu) { %>
<% if (menu.enable) { %>
<a href="<%= menu.url %>">
<%= menu.name %>
</a>
<% } %>
<% }); %>
</nav>
<div class="social">
<% theme.social.forEach(function(social) { %>
<% if (social.enable) { %>
<span class="social-icon">
<% if (social.relme) { %>
<a rel="me" href="<%= social.url %>" target="_blank">
<% } else { %>
<a href="<%= social.url %>" target="_blank">
<% } %>
<% if (theme.fontawesome) { %>
<i class="<%= social.icon %>"></i>
<% } else { %>
<img src='<%= url_for(theme.avatar) %>'></img>
<% } %>
</a>
</span>
<% } %>
<% }); %>
</div>
</div>
<!-- Sidebar Footer -->
<div class="footer smoll">
<% if (theme.hexo) { %>
<div class="hexo footer">
Powered by Hexo, theme <a href="https://tapestry.demo.bashynx.dev" target="_blank">Tapestry Code (WIP)</a><br>
</div>
<% } %>
<% if (theme.copyright) { %>
<div class="copy footer">
&copy; <%= theme.copy_year %> <%= config.author %>
</div>
<% } %>
</div>
</div>
<% } %>
<div class="content">
<%- body %>
</div>
</main>
</body>
</html>

15
layout/page.ejs Normal file
View file

@ -0,0 +1,15 @@
<!-- This is the template for the page -->
<div class="pp page border">
<div class="post-header">
<h1><%= page.title || "Untitled" %></h1>
<% if(page.photos && page.photos.length) { %>
<div>
<img class="border" src="<%- config.root %><%- page.photos[0] %>" alt="<%- page.title || "Untitled" %>">
</div>
<% } %>
<p><%= page.description %></p>
</div>
<div class="post-content">
<%- page.content %>
</div>
</div>

27
layout/post.ejs Normal file
View file

@ -0,0 +1,27 @@
<!-- This is the template for the post -->
<div class="pp post border">
<div class="post-header">
<h1><%= page.title || "Untitled" %></h1>
<% if(page.photos && page.photos.length) { %>
<div>
<img class="border" src="<%- config.root %><%- page.photos[0] %>" alt="<%- page.title || "Untitled" %>">
</div>
<% } %>
<p><%= page.description %></p>
<div class="date smoll">
<a href='<%= url_for(page.path) %>'><%- include('_partial/date', { date: page.date.toISOString() }) %></a>
</div>
</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>

1
layout/tag.ejs Normal file
View file

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