mirror of
https://gitlab.com/OpenAlt/OpenAltRO/openalt_ro.git
synced 2026-11-23 15:19:15 +00:00
Add the theme
This commit is contained in:
parent
cff7000285
commit
142a478a6a
21 changed files with 663 additions and 1 deletions
26
themes/openalt/layout/_partial/article.ejs
Normal file
26
themes/openalt/layout/_partial/article.ejs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<div class="narrow_view">
|
||||
<div class="post">
|
||||
<div class="post-header">
|
||||
<h1 class="article"><%= page.title || "Untitled" %></h1>
|
||||
<% if(page.photos && page.photos.length) { %>
|
||||
<div class="cover">
|
||||
<img class="gallery" src="<%- config.root %><%- page.photos[0] %>" alt="<%- page.title || "Untitled" %>">
|
||||
</div>
|
||||
<% } %>
|
||||
<p><%= page.description %></p>
|
||||
<a href='<%= url_for(page.path) %>' class="page-date"><%- include('date', { date: page.date.toISOString() }) %></a>
|
||||
</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>
|
||||
11
themes/openalt/layout/_partial/date.ejs
Normal file
11
themes/openalt/layout/_partial/date.ejs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<div class="date smoll">
|
||||
<%
|
||||
const posted = new Date(date);
|
||||
const now = new Date();
|
||||
const year = 365 * 24 * 60 * 60 * 1000;
|
||||
const format = (now - posted) < year ?
|
||||
{ day: 'numeric', month: 'long', hour: 'numeric', minute: 'numeric', hour12: true } :
|
||||
{ day: 'numeric', month: 'long', year: 'numeric', hour: 'numeric', minute: 'numeric', hour12: true };
|
||||
%>
|
||||
<%= posted.toLocaleString('en-US', format ) %>
|
||||
</div>
|
||||
11
themes/openalt/layout/_partial/feed.ejs
Normal file
11
themes/openalt/layout/_partial/feed.ejs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<div class="narrow_view">
|
||||
<% page.posts.forEach(function(post) { %>
|
||||
<%- include('post_feed', { post: post }) %>
|
||||
<% }); %>
|
||||
|
||||
<div class="pagination">
|
||||
<% if (page.next) { %>
|
||||
<a href="<%- url_for(page.next_link) %>"></a>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
22
themes/openalt/layout/_partial/index/feed_preview.ejs
Normal file
22
themes/openalt/layout/_partial/index/feed_preview.ejs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<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 }) %>
|
||||
<% counter = counter - 1 %>
|
||||
<% } %>
|
||||
<% } %>
|
||||
<% }); %>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
13
themes/openalt/layout/_partial/index/main_event.ejs
Normal file
13
themes/openalt/layout/_partial/index/main_event.ejs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<section class="event">
|
||||
|
||||
<% counter = false %>
|
||||
<% page.posts.forEach(function(post) { %>
|
||||
<% post.tags.data.forEach(function(tag) { %>
|
||||
<% if ( (tag.name == "Events") && (counter == false) ) { %>
|
||||
<%- include('./../post_event', { post: post }) %>
|
||||
<% counter = true %>
|
||||
<% } %>
|
||||
<% }); %>
|
||||
<% }); %>
|
||||
|
||||
</section>
|
||||
18
themes/openalt/layout/_partial/index/partners.ejs
Normal file
18
themes/openalt/layout/_partial/index/partners.ejs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<section id="partners">
|
||||
|
||||
<div class="section-title">
|
||||
<h1>Brought to you by:</h1>
|
||||
</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>
|
||||
9
themes/openalt/layout/_partial/post_event.ejs
Normal file
9
themes/openalt/layout/_partial/post_event.ejs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<div class="event-wrapper">
|
||||
<img src="/images/assets/OpenAltRomania.svg" alt="<%= post.title || "Untitled" %>" style="max-height: 250px" width="300px" />
|
||||
|
||||
<a href='<%= url_for(post.path) %>'><h1><%= post.title || "Untitled" %></h1></a>
|
||||
|
||||
<div class="post-content">
|
||||
<%- post.content %>
|
||||
</div>
|
||||
</div>
|
||||
20
themes/openalt/layout/_partial/post_feed.ejs
Normal file
20
themes/openalt/layout/_partial/post_feed.ejs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<!-- This is the template for the post. It is used to display the posts in the feeds. -->
|
||||
<div class="post post-feed">
|
||||
<% if(post.photos && post.photos.length) { %>
|
||||
<div class="cover">
|
||||
<a href='<%= url_for(post.path) %>'>
|
||||
<img class="gallery" src="<%- config.root %>thumbnails/<%- post.photos[0].replace(/^images\//, '') %>" alt="<%- post.title || 'Untitled' %>">
|
||||
</a>
|
||||
</div>
|
||||
<% } %>
|
||||
<div class="post-header">
|
||||
<a href='<%= url_for(post.path) %>'><h2><%= post.title || "Untitled" %></h2>
|
||||
<%- include('date', { date: post.date.toISOString() }) %></a>
|
||||
<p class="post_description"><%= post.description %></p>
|
||||
<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>
|
||||
</div>
|
||||
11
themes/openalt/layout/archive.ejs
Normal file
11
themes/openalt/layout/archive.ejs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<div class="narrow_view">
|
||||
<% site.posts.sort('-date').forEach(function(post) { %>
|
||||
<%- include('_partial/post_feed', { post: post }) %>
|
||||
<% }); %>
|
||||
|
||||
<div class="pagination">
|
||||
<% if (page.next) { %>
|
||||
<a href="<%- url_for(page.next_link) %>"></a>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
1
themes/openalt/layout/category.ejs
Normal file
1
themes/openalt/layout/category.ejs
Normal file
|
|
@ -0,0 +1 @@
|
|||
<%- include("_partial/feed", { item: page.posts.sort('-date') }) %>
|
||||
5
themes/openalt/layout/index.ejs
Normal file
5
themes/openalt/layout/index.ejs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<%- include("_partial/index/main_event", { item: site.posts.sort('-date') }) %>
|
||||
|
||||
<%- include("_partial/index/feed_preview", { item: site.posts.sort('-date') }) %>
|
||||
|
||||
<%- include("_partial/index/partners") %>
|
||||
90
themes/openalt/layout/layout.ejs
Normal file
90
themes/openalt/layout/layout.ejs
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
<!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 %>">
|
||||
|
||||
<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:hover {
|
||||
color: <%= theme.primary_color %>;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<header class="topbar">
|
||||
<nav>
|
||||
<!-- Avatar -->
|
||||
<a href="/">
|
||||
<div class="topbar-header">
|
||||
<img src="<%= url_for(theme.banner) %>" alt="<%= config.author %>">
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<!-- Topbar Menu -->
|
||||
<% theme.topbar_menu.forEach(function(menu) { %>
|
||||
<% if (menu.enable) { %>
|
||||
<a href="<%= menu.url %>">
|
||||
<%= menu.name %>
|
||||
</a>
|
||||
<% } %>
|
||||
<% }); %>
|
||||
|
||||
<span class="social">
|
||||
<% theme.social.forEach(function(social) { %>
|
||||
<% if (social.enable) { %>
|
||||
<span class="social-icon">
|
||||
<a href="<%= social.url %>" target="_blank">
|
||||
<% if (theme.fontawesome) { %>
|
||||
<i class="<%= social.icon %>"></i>
|
||||
<% } else { %>
|
||||
<img src='<%= url_for(theme.avatar) %>'></img>
|
||||
<% } %>
|
||||
</a>
|
||||
</span>
|
||||
<% } %>
|
||||
<% }); %>
|
||||
</span>
|
||||
|
||||
</nav>
|
||||
</header>
|
||||
<main>
|
||||
<!-- BODY -->
|
||||
<div class="content">
|
||||
<%- body %>
|
||||
</div>
|
||||
|
||||
<!-- Footer -->
|
||||
<div class="footer smoll">
|
||||
<% if (theme.hexo) { %>
|
||||
<div class="hexo footer">
|
||||
Powered by Hexo, theme <a href="https://openalt.ro" target="_blank">OpenAlt</a><br>
|
||||
</div>
|
||||
<% } %>
|
||||
<% if (theme.copyright) { %>
|
||||
<div class="copy footer">
|
||||
© <%= theme.copy_year %> <%= config.author %>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
1
themes/openalt/layout/page.ejs
Normal file
1
themes/openalt/layout/page.ejs
Normal file
|
|
@ -0,0 +1 @@
|
|||
<%- include("_partial/article", { page: page }) %>
|
||||
1
themes/openalt/layout/post.ejs
Normal file
1
themes/openalt/layout/post.ejs
Normal file
|
|
@ -0,0 +1 @@
|
|||
<%- include("_partial/article", { page: page }) %>
|
||||
1
themes/openalt/layout/tag.ejs
Normal file
1
themes/openalt/layout/tag.ejs
Normal file
|
|
@ -0,0 +1 @@
|
|||
<%- include("_partial/feed", { item: page.posts.sort('-date') }) %>
|
||||
Loading…
Add table
Add a link
Reference in a new issue