🎉 Init the new default theme

This commit is contained in:
Kazhnuz 2025-07-13 15:42:08 +02:00
parent ff09b33098
commit 9937c0a9f9
12 changed files with 815 additions and 1 deletions

568
bl-themes/default/css/style.css Executable file
View file

@ -0,0 +1,568 @@
:root {
--font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Cantarell, Roboto, Oxygen, Ubuntu, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
--font-family-monospace: Consolas, Menlo, Monaco, Andale Mono WT, Andale Mono, Lucida Console, Lucida Sans Typewriter, DejaVu Sans Mono, Bitstream Vera Sans Mono, Liberation Mono, Nimbus Mono L, Courier New, Courier, monospace;
--accent-color-dark: #1971c2;
--accent-color-dark-hover: #1864ab;
--accent-color-light: #d0ebff;
--accent-color-light-hover: #e7f5ff;
--text-color: #212529;
--border-color: rgba(0, 0, 0, 0.15);
--hover-color: rgba(0, 0, 0, 0.05);
--navbar-color: #212529;
--background-color: #f8f9fa;
--well-color: #e9ecef;
--accent-color: var(--accent-color-dark);
--accent-color-back: var(--accent-color-light);
--accent-color-hover: var(--accent-color-dark-hover);
--border-radius: 6px
}
@media(prefers-color-scheme: dark) {
:root {
--text-color: #e9ecef;
--background-color: #212529;
--well-color: #343a40;
--accent-color: var(--accent-color-light);
--accent-color-back: var(--accent-color-dark);
--accent-color-hover: var(--accent-color-light-hover);
--border-color: rgba(255, 255, 255, 0.2);
--hover-color: rgba(255, 255, 255, 0.1);
--navbar-color: #343a40;
}
}
header#main-header {
border-radius: 16px;
background-color:var(--accent-color-dark);
color: white;
padding:0;
overflow: hidden;
grid-area: header;
nav {
background-color: var(--navbar-color);
padding:4px;
ul {
margin:0px;
padding:8px;
a {
color:white!important;
border-radius: var(--border-radius);
padding:8px;
}
a:hover {
background-color: rgba(255,255,255,0.2);
}
}
}
hgroup {
margin: auto;
padding: 4rem;
p, h1 {
text-align: center;
}
}
}
footer {
text-align: center;
font-style: italic;
line-height: 1rem;
grid-area: footer;
}
html {
font-family: var(--font-family);
text-align: left;
font-size: 14px;
background-color: var(--background-color);
accent-color: var(--accent-color);
line-height: 1.6rem;
background-color:var(--well-color);
padding: 3rem;
}
body {
background-color:var(--background-color);
border-radius: 32px;
box-shadow: 0px 1px 4px 0px rgba(0,0,0,0.3);
color: var(--text-color);
font-weight: 400;
max-width: 1000px;
border-radius: 32px;
padding: 16px;
margin: auto;
display: grid;
grid-template-columns: 1fr 250px;
grid-template-rows: auto;
gap: 16px;
grid-template-areas:
"header header"
"main sidebar"
"footer footer";
}
main {
grid-area: main;
}
aside {
grid-area: sidebar;
border-radius: 16px;
background-color: var(--well-color);
padding: 16px;
h2 {
font-size: 1rem;
margin-bottom: 0.5rem;
}
.plugin {
margin-bottom: 1rem;
}
}
nav ul {
display: flex;
flex-wrap: wrap;
padding: .5rem 0;
}
nav ul li {
list-style-type: none;
margin: 0
}
nav ul li a,
nav ul li span {
padding: .5rem
}
nav ul li.separator {
margin-right: auto
}
nav ul li.separator-left {
margin-left: auto
}
p,
h1,
h2,
h3,
h4,
h5,
h6,
ul,
ol,
hr,
table,
details main,
.p,
.article-body,
input,
textarea,
select,
hgroup,
article {
padding: 0;
margin: 0 0 1rem 0
}
p:last-child {
margin-bottom: 0
}
a {
color: var(--accent-color);
text-decoration: none;
border-radius: 3px;
padding: 1px
}
a:hover {
background-color: var(--hover-color)
}
:is(ul, ol)>:is(ul, ol) {
margin-bottom: 0
}
li {
margin-left: 1rem
}
::selection,
::-moz-selection {
background: var(--accent-color-back);
color: var(--text-color)
}
hr {
border: 0;
border-bottom: 1px solid var(--border-color)
}
code,
mark {
background-color: var(--well-color);
padding: 5px;
border-radius: 3px
}
mark {
background-color: var(--accent-color-back);
color: currentColor
}
pre,
code {
font-family: var(--font-family-monospace)
}
p>img:only-child {
display: block;
max-width: 100%;
margin: auto
}
hgroup>:is(h1, h2, h3, h4, h5, h6) {
margin-bottom: 0
}
hgroup {
font-weight: 700
}
h1,
h2,
h3,
h4,
h5,
h6 {
text-align: left;
line-height: 1;
font-weight: 700
}
h1 {
font-size: 3rem
}
h2 {
font-size: 2.33rem
}
h3 {
font-size: 1.75rem
}
h4 {
font-size: 1.5rem
}
h5 {
font-size: 1.25rem
}
h6 {
font-size: 1rem;
font-weight: 800
}
blockquote,
pre,
details {
border: 0;
border-radius: 6px;
margin: 0 0 1rem 0;
padding: .75rem;
max-width: 100%;
background-color: var(--well-color);
border: 0;
border-left: 6px solid var(--accent-color)
}
.card {
border-radius: 6px;
background-color: var(--well-color);
border: 0;
margin: 0 0 1rem 0;
padding: 1rem;
}
pre code {
padding: 0
}
pre {
overflow: scroll
}
summary {
font-weight: 700;
font-size: .9em
}
summary:hover {
background-color: var(--hover-color)
}
a,
button,
input {
outline-color: var(--accent-color);
outline-style: none;
outline-width: 2px
}
a:focus-visible,
button:focus-visible,
input:focus-visible {
outline-style: dashed
}
input,
textarea,
select {
display: block;
background-color: var(--background-color);
border-radius: var(--border-radius);
border: 1px solid var(--border-color);
outline-offset: 2px;
padding: .5rem;
color: var(--text-color);
max-width: 100%;
overflow: scroll
}
input:hover,
textarea:hover,
select:hover {
background-color: var(--hover-color)
}
label {
font-size: .9rem;
font-weight: bolder
}
textarea {
width: 100%;
box-sizing: border-box;
margin-bottom: 1rem
}
input[type=checkbox],
input[type=radio] {
display: inline-block;
appearance: none;
aspect-ratio: 1;
font-size: 1rem;
height: 1em;
width: 1em;
box-sizing: border-box;
line-height: 1;
padding: 0;
margin: 0 .25em;
border-radius: 3px;
border: 1px solid var(--border-color);
content: "";
position: relative;
top: .2rem
}
input[type=checkbox]:checked,
input[type=radio]:checked {
background-color: var(--accent-color);
box-shadow: inset 0px 0px 0px 3px var(--background-color)
}
input[type=checkbox]:checked:hover,
input[type=radio]:checked:hover {
background-color: var(--accent-color-hover);
box-shadow: inset 0px 0px 0px 3px color-mix(in srgb, var(--background-color) 90%, currentColor)
}
input[type=radio] {
border-radius: 9999px
}
button,
.button,
.pill,
input[type=submit],
input[type=reset],
input[type=button] {
background-color: var(--accent-color);
color: var(--background-color);
border: none;
padding: .5rem 1rem;
border-radius: var(--border-radius);
outline-offset: 2px;
display: inline-block;
}
.button-link {
padding: .5rem 1rem;
border-radius: var(--border-radius);
outline-offset: 2px;
display: inline-block;
border: none;
}
.pill {
padding: 0rem .5rem;
font-size: 0.8rem;
vertical-align: bottom;
}
button:hover,
.button:hover,
a.pill:hover,
input[type=submit]:hover,
input[type=reset]:hover,
input[type=button]:hover {
background-color: var(--accent-color-hover)
}
.responsive-table {
width: 100%;
overflow: scroll
}
table {
border-collapse: separate;
width: 100%;
border: 0;
border-spacing: 3px
}
caption {
font-weight: bolder
}
table.centered th,
table.centered td,
.center {
text-align: center
}
tr,
th,
td {
border: 0
}
th,
td {
background-color: var(--well-color);
padding: .33rem .66rem
}
table:not(:has(thead)) tr:first-child td:first-child,
table:not(:has(thead)) tr:first-child th:first-child,
table>tr:first-child td:first-child,
table>tr:first-child th:first-child,
table thead tr:first-child td:first-child,
table thead tr:first-child th:first-child {
border-top-left-radius: var(--border-radius)
}
table:not(:has(thead)) tr:first-child td:last-child,
table:not(:has(thead)) tr:first-child th:last-child,
table>tr:first-child td:last-child,
table>tr:first-child th:last-child,
table thead tr:first-child td:last-child,
table thead tr:first-child th:last-child {
border-top-right-radius: var(--border-radius)
}
table>tr:last-child td:first-child,
table>tr:last-child th:first-child,
table tbody tr:last-child td:first-child,
table tbody tr:last-child th:first-child {
border-bottom-left-radius: var(--border-radius)
}
table>tr:last-child td:last-child,
table>tr:last-child th:last-child,
table tbody tr:last-child td:last-child,
table tbody tr:last-child th:last-child {
border-bottom-right-radius: var(--border-radius)
}
.article-list > article {
margin-bottom: 2rem;
}
.flex {
display: flex;
flex-wrap: wrap;
justify-content: space-between
}
.cover-image {
max-width: 100%;
border-radius: 16px;
height: auto;
}
.article-metadata {
font-style: italic;
}
.author-identity {
display: flex;
align-items: center;
margin-bottom: 1rem;
}
ul.author-links {
list-style: none;
margin: 0;
text-align: center;
li {
display: inline-block;
padding: 0;
margin: 0;
}
li:not(:first-child)::before {
content:" ⋅ "
}
}
.avatar {
border-radius: 9999px;
margin-right: 1rem;
}
.flat-list li {
display: inline-block;
margin: 0;
margin-right: 0.33rem;
}
#paginator {
ul {
list-style: none;
display: flex;
a,
.current-page {
padding: .5rem .5rem;
border: none;
border-radius: var(--border-radius);
outline-offset: 2px;
}
.current-page {
background-color: var(--accent-color);
color: var(--background-color);
}
}
}

43
bl-themes/default/index.php Executable file
View file

@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="<?php echo Theme::lang() ?>">
<head>
<?php include(THEME_DIR_PHP.'head.php'); ?>
</head>
<body>
<!-- Load Koblog Plugins: Site Body Begin -->
<?php Theme::plugins('siteBodyBegin'); ?>
<!-- Navbar -->
<?php include(THEME_DIR_PHP.'header.php'); ?>
<!-- Content -->
<main class="container">
<?php
// Koblog content are pages
// But if you order the content by date
// These pages works as posts
// $WHERE_AM_I variable detect where the user is browsing
// If the user is watching a particular page/post the variable takes the value "page"
// If the user is watching the frontpage the variable takes the value "home"
if ($WHERE_AM_I == 'page') {
include(THEME_DIR_PHP.'page.php');
} else {
include(THEME_DIR_PHP.'home.php');
}
?>
</main>
<aside>
<?php include(THEME_DIR_PHP.'sidebar.php'); ?>
</aside>
<!-- Footer -->
<?php include(THEME_DIR_PHP.'footer.php'); ?>
<!-- Load Koblog Plugins: Site Body End -->
<?php Theme::plugins('siteBodyEnd'); ?>
</body>
</html>

View file

@ -0,0 +1,7 @@
{
"theme-data":
{
"name": "Default",
"description": "A basic theme for koblog, inspired by the old default wordpress theme."
}
}

View file

@ -0,0 +1,7 @@
{
"theme-data":
{
"name": "Default",
"description": "Le theme par défaut de koblog, inspiré par l'ancien de wordpress"
}
}

View file

@ -0,0 +1,11 @@
{
"author": "Koblog",
"email": "",
"website": "https://koblog.kobold.cafe",
"version": "kb_0.0.1",
"releaseDate": "2024-08-23",
"license": "MIT",
"compatible": "kb_0.0.1",
"notes": "",
"supports": ["sidebar"]
}

View file

@ -0,0 +1,6 @@
<footer id="main-footer">
<p class="m-0 text-center text-white text-uppercase">
<?php echo $site->footer(); ?> -
<span><?php echo $L->get('Powered by'); ?> <a target="_blank" class="text-white" href="https://git.kobold.cafe/kazhnuz/koblog">KOBLOG</a></span>
</p>
</footer>

View file

@ -0,0 +1,18 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="generator" content="Koblog">
<!-- Dynamic title tag -->
<?php echo Theme::metaTags('title'); ?>
<!-- Dynamic description tag -->
<?php echo Theme::metaTags('description'); ?>
<!-- Include Favicon -->
<?php echo Theme::favicon('img/favicon.png'); ?>
<!-- Include CSS Styles from this theme -->
<?php echo Theme::css('css/style.css'); ?>
<!-- Load Koblog Plugins: Site head -->
<?php Theme::plugins('siteHead'); ?>

View file

@ -0,0 +1,26 @@
<header id="main-header">
<nav>
<ul>
<li><a href="<?php echo Theme::siteUrl() ?>"><?php echo $L->get('Home'); ?></a></li>
<!-- Static pages -->
<?php foreach ($staticContent as $staticPage) : ?>
<li><a href="<?php echo $staticPage->permalink() ?>"><?php echo $staticPage->title() ?></a></li>
<?php endforeach ?>
<li class="separator-left"><a href="<?php echo Theme::siteUrl() ?>rss.xml">RSS</a></li>
</ul>
</nav>
<hgroup id="title-container">
<h1><?php echo $site->title() ?></h1>
<p><?php echo $site->description() ?></p>
</hgroup>
<nav>
<ul>
<?php foreach (getCategories() as $category) : ?>
<?php if (count($category->pages())>0) : ?>
<li><a href="<?php echo $category->permalink(); ?>"><?php echo $category->name(); ?> </a></li>
<?php endif ?>
<?php endforeach ?>
</ul>
</nav>
</header>

View file

@ -0,0 +1,59 @@
<?php if (empty($content)) : ?>
<div>
<?php $language->p('No pages found') ?>
</div>
<?php endif ?>
<div class="article-list"><?php foreach ($content as $page) : ?>
<!-- Post -->
<article>
<!-- Load Koblog Plugins: Page Begin -->
<?php Theme::plugins('pageBegin'); ?>
<!-- Title -->
<h2 class="title">
<a href="<?php echo $page->permalink(); ?>"><?php echo $page->title(); ?></a>
</h2>
<!-- Cover image -->
<?php if ($page->coverImage()) : ?>
<img class="cover-image" alt="" src="<?php echo $page->coverImage(); ?>" />
<?php endif ?>
<!-- Creation date -->
<div class="article-metadata flex p">
<div><time><?php echo $page->date(); ?></time></div>
<div><?php echo $L->get('Reading time') . ': ' . $page->readingTime(); ?></div>
</div>
<!-- Breaked content -->
<?php echo $page->contentBreak(); ?>
<!-- "Read more" button -->
<?php if ($page->readMore()) : ?>
<p class="center">
<a class="button-link" href="<?php echo $page->permalink(); ?>"><?php echo $L->get('Read more'); ?></a>
</p>
<?php endif ?>
<div class="flex p" id="tag-category-list">
<div id="category-list">
<a href="<?php echo $page->categoryPermalink(); ?>" class="category pill"><?php echo $page->category(); ?></a>
</div>
<div id="tag-list">
<?php foreach ($page->tags(true) as $key => $value) : ?>
<?php $tagObject = new Tag($key); ?>
<a href="<?php echo $tagObject->permalink();?>" class="tag pill" rel="tag directory">
<?php echo $value; ?>
</a>
<?php endforeach ?>
</div>
</div>
<!-- Load Koblog Plugins: Page End -->
<?php Theme::plugins('pageEnd'); ?>
</article>
<?php endforeach ?></div>
<!-- Pagination -->
<?php echo Paginator::numberedPageHTML(); ?>

View file

@ -0,0 +1,68 @@
<!-- Post -->
<article id="article-solo">
<!-- Load Koblog Plugins: Page Begin -->
<?php Theme::plugins('pageBegin'); ?>
<!-- Title -->
<h2 class="title">
<a href="<?php echo $page->permalink(); ?>"><?php echo $page->title(); ?></a>
</h2>
<!-- Cover image -->
<?php if ($page->coverImage()) : ?>
<img class="cover-image" alt="" src="<?php echo $page->coverImage(); ?>" />
<?php endif ?>
<!-- Creation date -->
<div class="article-metadata flex p">
<?php if (!$page->isStatic() && !$url->notFound()) : ?>
<div><time><?php echo $page->date(); ?></time></div>
<div><?php echo $L->get('Reading time') . ': ' . $page->readingTime(); ?></div>
</div>
<?php endif ?>
<!-- Full content -->
<div class="article-body">
<?php echo $page->content(); ?>
</div>
<?php if (!$page->isStatic() && !$url->notFound()) : ?>
<div class="flex p" id="tag-category-list">
<div id="category-list">
<a href="<?php echo $page->categoryPermalink(); ?>" class="category pill"><?php echo $page->category(); ?></a>
</div>
<div id="tag-list">
<?php foreach ($page->tags(true) as $key => $value) : ?>
<?php $tagObject = new Tag($key); ?>
<a href="<?php echo $tagObject->permalink();?>" class="tag pill" rel="tag directory">
<?php echo $value; ?>
</a>
<?php endforeach ?>
</div>
</div>
<div class="card author-area p-author h-card">
<div class="author-identity">
<img alt="" class="avatar" src="<?php echo ($page->user('profilePicture'));?>" height="64" width="64" decoding="async">
<div class="author-metadata">
<div class="author-pseudo">
Écrit par <a href="https://kazhnuz.space" class="u-url p-name"><?php echo $page->user('displayName'); ?></a>
<span class="pill"><?php echo $page->user('pronouns'); ?></span>
</div>
<div class="p-note"><?php echo $page->user('description'); ?></div>
</div>
</div>
<ul class="author-links">
<?php if ($page->user('homepage')):?>
<li><a href="<?php echo ($page->user('homepage'));?>">Homepage</a> </li>
<?php endif ?>
<?php foreach ($page->user('socials') as $key => $social):?>
<li><a href="<?php echo ($social->url);?>"><?php echo $social->name; ?></a> </li>
<?php endforeach ?>
</ul>
</div>
<?php endif ?>
<!-- Load Koblog Plugins: Page End -->
<?php Theme::plugins('pageEnd'); ?>
</article>

View file

@ -0,0 +1 @@
<?php Theme::plugins('siteSidebar') ?>

View file

@ -2,7 +2,7 @@
<div class="container">
<ul class="footer-links pl-0 mb-1">
<?php foreach (Theme::socialNetworks() as $key => $name) {
echo '<a class="color-blue" href="' . $site->getSocialNetwork($name); . '"><li class="d-inline-block pr-4">' . $name . '</li></a>';
echo '<a class="color-blue" href="' . $site->getSocialNetwork($name) . '"><li class="d-inline-block pr-4">' . $name . '</li></a>';
}
?>
</ul>