Refactor BlogX theme for Bludit v4, include plugin with settings

This commit is contained in:
Diego Najar 2021-11-21 18:44:36 +01:00
parent 65afabefd8
commit 4cfdf1722b
16 changed files with 225 additions and 45 deletions

View file

@ -0,0 +1,14 @@
{
"plugin-data":
{
"name": "Theme BlogX",
"description": "Das Plugin erlaubt verschiedene Einstellungen für das Theme BlogX."
},
"enable-or-disable-dark-mode": "Dunkelmodus aktivieren oder deaktivieren.",
"enable-or-disable-google-fonts": "Google Fonts aktivieren oder deaktivieren.",
"relative": "Relativ",
"absolute": "Absolut",
"change-the-date-format-for-the-main-page": "Einstellung des Datumsformats auf der Haupt- oder Blogseite.",
"show-tags": "Schlagwörter zeigen",
"show-tags-in-the-main-page-for-each-article": "Zeigt auf der Haupt- oder Blogseite die Schlagwörter der Beiträge."
}

View file

@ -0,0 +1,14 @@
{
"plugin-data":
{
"name": "Theme BlogX",
"description": "Das Plugin erlaubt verschiedene Einstellungen für das Theme BlogX."
},
"enable-or-disable-dark-mode": "Dunkelmodus aktivieren oder deaktivieren.",
"enable-or-disable-google-fonts": "Google Fonts aktivieren oder deaktivieren.",
"relative": "Relativ",
"absolute": "Absolut",
"change-the-date-format-for-the-main-page": "Einstellung des Datumsformats auf der Haupt- oder Blogseite.",
"show-tags": "Schlagwörter zeigen",
"show-tags-in-the-main-page-for-each-article": "Zeigt auf der Haupt- oder Blogseite die Schlagwörter der Beiträge."
}

View file

@ -0,0 +1,14 @@
{
"plugin-data":
{
"name": "Theme BlogX",
"description": "Das Plugin erlaubt verschiedene Einstellungen für das Theme BlogX."
},
"enable-or-disable-dark-mode": "Dunkelmodus aktivieren oder deaktivieren.",
"enable-or-disable-google-fonts": "Google Fonts aktivieren oder deaktivieren.",
"relative": "Relativ",
"absolute": "Absolut",
"change-the-date-format-for-the-main-page": "Einstellung des Datumsformats auf der Haupt- oder Blogseite.",
"show-tags": "Schlagwörter zeigen",
"show-tags-in-the-main-page-for-each-article": "Zeigt auf der Haupt- oder Blogseite die Schlagwörter der Beiträge."
}

View file

@ -0,0 +1,14 @@
{
"plugin-data":
{
"name": "BlogX Theme",
"description": "This plugin provides configuration for the theme BlogX."
},
"enable-or-disable-dark-mode": "Enable or disable dark mode.",
"enable-or-disable-google-fonts": "Enable or disable Google fonts.",
"relative": "Relative",
"absolute": "Absolute",
"change-the-date-format-for-the-main-page": "Change the date format for the main page.",
"show-tags": "Show tags",
"show-tags-in-the-main-page-for-each-article": "Show tags in the main page for each article."
}

View file

@ -0,0 +1,14 @@
{
"plugin-data":
{
"name": "BlogX Theme",
"description": "BlogXテーマの設定を行うプラグインです。"
},
"enable-or-disable-dark-mode": "ダークモードを有効または無効にします。",
"enable-or-disable-google-fonts": "Google Fontsの利用を有効または無効にします。",
"relative": "相対的",
"absolute": "絶対的",
"change-the-date-format-for-the-main-page": "メインページの日付表示形式を変更します。",
"show-tags": "タグの表示",
"show-tags-in-the-main-page-for-each-article": "メインページの各記事にタグを表示します。"
}

View file

@ -0,0 +1,11 @@
{
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
"version": "4.0.0",
"releaseDate": "2021-05-23",
"license": "MIT",
"compatible": "4.0.0",
"notes": "",
"type": "theme"
}

View file

@ -0,0 +1,33 @@
<?php
class blogx extends Plugin {
public function init()
{
$this->dbFields = array(
'googleFonts'=>false
);
}
public function form()
{
global $L;
$html = '<div class="mb-3">';
$html .= '<label class="form-label" for="googleFonts">'.$L->get('Google Fonts').'</label>';
$html .= '<select class="form-select" id="googleFonts" name="googleFonts">';
$html .= '<option value="true" '.($this->getValue('googleFonts')===true?'selected':'').'>'.$L->get('Enabled').'</option>';
$html .= '<option value="false" '.($this->getValue('googleFonts')===false?'selected':'').'>'.$L->get('Disabled').'</option>';
$html .= '</select>';
$html .= '<div class="form-text">'.$L->get('Enable or disable Google fonts.').'</div>';
$html .= '</div>';
return $html;
}
public function googleFonts()
{
return $this->getValue('googleFonts');
}
}

View file

@ -0,0 +1,42 @@
/*
Plugins
*/
.plugin {
margin-top: 3rem;
}
.plugin-label {
font-size: 1em;
text-transform: uppercase;
}
.plugin ul {
list-style: none;
padding-left: 0;
}
.plugin li {
padding: 0.2rem 0;
}
/*
Custom plugins
*/
/* Plugin navigation */
div.plugin-navigation ul {
list-style: none;
padding-left: 0;
}
div.plugin-navigation ul.child {
padding-left: 1rem;
}
/* Plugin Hit counter */
div.plugin-hit-counter div.counter {
background: #f3f3f3;
border-radius: 5px;
border: 1px solid #e4e4e4;
text-align: center;
}

View file

@ -18,6 +18,10 @@ img {
max-width: 100%;
}
a {
color: #004ab7;
text-decoration: none;
}
pre, code {
background: #f8f8f8;
@ -99,17 +103,13 @@ footer {
padding-bottom: 5px;
}
/* Plugins */
.plugin {
margin-top: 3rem;
.cover-image {
height: 300px;
background-position: center;
background-size: cover;
}
.plugin-label {
font-size: 1em;
text-transform: uppercase;
}
.plugin ul {
list-style: none;
padding: 0 0 0 10px;
}
/* Icons */
.bi {
margin-right: .5rem!important;
}

5
bl-themes/blogx/init.php Normal file
View file

@ -0,0 +1,5 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
if ($theme==false) {
exit("The theme needs the plugin Popeye to work properly, please enable it from the admin panel.");
}

View file

@ -2,9 +2,10 @@
"author": "Bludit",
"email": "",
"website": "https://themes.bludit.com",
"version": "4.0.0",
"version": "4.0",
"releaseDate": "2021-05-23",
"license": "MIT",
"compatible": "4.0.0",
"notes": ""
"compatible": "4.0",
"notes": "",
"plugin": "blogx"
}

View file

@ -1,5 +1,5 @@
<footer class="footer bg-dark">
<div class="container">
<p class="m-0 text-center text-white text-uppercase"><?php echo $site->footer(); ?><span class="ms-5 text-warning">Powered by<img class="mini-logo" src="<?php echo DOMAIN_THEME_IMG.'favicon.png'; ?>"/><a target="_blank" class="text-white" href="https://www.bludit.com">Bludit</a></span></p>
<p class="m-0 text-center text-white text-uppercase"><?php echo $site->footer(); ?><span class="ms-5 text-warning">Powered by <a target="_blank" class="text-white" href="https://www.bludit.com">Bludit</a> - Open source CMS</span></p>
</div>
</footer>

View file

@ -1,21 +1,33 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="Bludit">
<!-- Dynamic title tag -->
<?php echo HTML::metaTags('title'); ?>
<!-- Generate <title>...</title> -->
<?php echo HTML::metaTagTitle(); ?>
<!-- Dynamic description tag -->
<?php echo HTML::metaTags('description'); ?>
<!-- Generate <meta name="description" content="..."> -->
<?php echo HTML::metaTagDescription(); ?>
<!-- Include Favicon -->
<!-- Generate <link rel="icon" href="..."> -->
<?php echo HTML::favicon('img/favicon.png'); ?>
<!-- Include Bootstrap CSS file bootstrap.css -->
<!-- Include CSS Bootstrap file from Bludit Core -->
<?php echo HTML::cssBootstrap(); ?>
<!-- Include CSS Bootstrap ICONS file from Bludit Core -->
<?php echo HTML::cssBootstrapIcons(); ?>
<!-- Include CSS Styles from this theme -->
<?php echo HTML::css('css/style.css'); ?>
<?php echo HTML::css('css/plugins.css'); ?>
<!-- Load Bludit Plugins: Site head -->
<?php execPluginsByHook('siteHead'); ?>
<!-- Enable or disable Google Fonts from theme's settings -->
<?php if ($theme->googleFonts()): ?>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:sans,bold">
<style>
body { font-family: "Open Sans", sans-serif; }
</style>
<?php endif; ?>
<!-- Execute Bludit plugins for the hook "Site head" -->
<?php execPluginsByHook('siteHead'); ?>

View file

@ -11,19 +11,22 @@
<!-- Load Bludit Plugins: Page Begin -->
<?php execPluginsByHook('pageBegin'); ?>
<!-- Cover image -->
<?php if ($page->coverImage()): ?>
<img class="card-img-top mb-3 rounded-0" alt="Cover Image" src="<?php echo $page->coverImage(); ?>"/>
<?php endif ?>
<div class="card-body p-0">
<!-- Title -->
<a class="text-dark" href="<?php echo $page->permalink(); ?>">
<h2 class="title"><?php echo $page->title(); ?></h2>
</a>
<!-- Creation date -->
<h6 class="card-subtitle mb-3 text-muted"><?php echo $page->date(); ?> - <?php echo $L->get('Reading time') . ': ' . $page->readingTime(); ?></h6>
<!-- Creation date -->
<h6 class="card-subtitle mb-4 text-muted">
<i class="bi bi-calendar"></i><?php echo $page->date(); ?>
<i class="ms-3 bi bi-clock-history"></i><?php echo $L->get('Reading time') . ': ' . $page->readingTime(); ?>
</h6>
<!-- Cover image -->
<?php if ($page->coverImage()): ?>
<div class="cover-image mt-4 mb-4" style="background-image: url('<?php echo $page->coverImage(); ?>')"/></div>
<?php endif ?>
<!-- Breaked content -->
<?php echo $page->contentBreak(); ?>

View file

@ -3,10 +3,10 @@
<a class="navbar-brand" href="<?php echo HTML::siteUrl() ?>">
<span class="text-white"><?php echo $site->title() ?></span>
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto">
<!-- Static pages -->
@ -29,4 +29,4 @@
</ul>
</div>
</div>
</nav>
</nav>

View file

@ -4,11 +4,6 @@
<!-- Load Bludit Plugins: Page Begin -->
<?php execPluginsByHook('pageBegin'); ?>
<!-- Cover image -->
<?php if ($page->coverImage()): ?>
<img class="card-img-top mb-3 rounded-0" alt="Cover Image" src="<?php echo $page->coverImage(); ?>"/>
<?php endif ?>
<div class="card-body p-0">
<!-- Title -->
<a class="text-dark" href="<?php echo $page->permalink(); ?>">
@ -16,10 +11,18 @@
</a>
<?php if (!$page->isStatic() && !$url->notFound()): ?>
<!-- Creation date -->
<h6 class="card-subtitle mb-3 text-muted"><?php echo $page->date(); ?> - <?php echo $L->get('Reading time') . ': ' . $page->readingTime() ?></h6>
<!-- Creation date -->
<h6 class="card-subtitle mb-4 text-muted">
<i class="bi bi-calendar"></i><?php echo $page->date(); ?>
<i class="ms-3 bi bi-clock-history"></i><?php echo $L->get('Reading time') . ': ' . $page->readingTime(); ?>
</h6>
<?php endif ?>
<!-- Cover image -->
<?php if ($page->coverImage()): ?>
<div class="cover-image mt-4 mb-4" style="background-image: url('<?php echo $page->coverImage(); ?>')"/></div>
<?php endif ?>
<!-- Full content -->
<?php echo $page->content(); ?>