Skip to content

Commit

Permalink
Version 0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Greenough committed Mar 24, 2019
1 parent c4d3d5e commit 39485e0
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 30 deletions.
File renamed without changes.
4 changes: 3 additions & 1 deletion app/frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ function get_header($title = null, $description = null) {

if($title == null) {
$title = $config['blog_name'];
} else {
$title = $title . ' ' . $config['title_seperator'] . ' ' . $config['blog_name'];
}

if($description == null) {
$title = $config['blog_description'];
$description = $config['blog_description'];
}

require 'themes/' . $config['frontend_theme'] . '/header.php';
Expand Down
3 changes: 3 additions & 0 deletions app/generate.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ function generate_rss($posts) {

foreach($posts as $p){
$item = new Suin\RSSWriter\Item();
$url = $config['blog_url'] . '/' . $p->slug . '/';

$item
->title($p->title)
->description($p->body)
->url($url)
->appendTo($channel);
}

Expand Down
2 changes: 1 addition & 1 deletion app/plugins.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

// Load plugins from /plugins/ folder
// Load plugins (/x/x.php) from /plugins/ folder
function load_plugins() {
$plugins = array_filter(glob('plugins/*'), 'is_dir');
foreach($plugins as $plugin) {
Expand Down
6 changes: 6 additions & 0 deletions config.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
// Posts per page
'posts_per_page' => 4,

// The direct URL to your blog without a trailing slash (eg. https://adgr.dev or https://adgr.dev/blog)
'blog_url' => 'https://nicholas.dev1.adgr.dev',

// The name of your blog
'blog_name' => 'Nicholas Demo',

Expand All @@ -28,6 +31,9 @@
// Date format
'date_format' => 'jS F Y',

// Page title seperator
'title_seperator' => '|',

/* ============================================
Advanced Settings
============================================ */
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
});

$router->map('GET','/rss/', function() {
header('Content-type: application/json');
header('Content-type: application/xml');
echo generate_rss(get_posts());
});

Expand Down
55 changes: 33 additions & 22 deletions themes/default/assets/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pre {
}

.site-header .logo {
background: #6a3093; /* fallback for old browsers */
background: #6a3093;
background: linear-gradient(to right, #6a3093, #a044ff);
padding: 25px 0;
text-transform: uppercase;
Expand Down Expand Up @@ -104,24 +104,35 @@ hr {
}

table {
padding: 0; width: 100%; }
table tr {
border-top: 1px solid #cccccc;
background-color: white;
margin: 0;
padding: 0; }
table tr th {
font-weight: bold;
border: 1px solid #cccccc;
text-align: left;
margin: 0;
padding: 6px 13px; }
table tr td {
border: 1px solid #cccccc;
text-align: left;
margin: 0;
padding: 6px 13px; }
table tr th :first-child, table tr td :first-child {
margin-top: 0; }
table tr th :last-child, table tr td :last-child {
margin-bottom: 0; }
padding: 0; width: 100%;
}

table tr {
border-top: 1px solid #cccccc;
background-color: white;
margin: 0;
padding: 0;
}

table tr th {
font-weight: bold;
border: 1px solid #cccccc;
text-align: left;
margin: 0;
padding: 6px 13px;
}

table tr td {
border: 1px solid #cccccc;
text-align: left;
margin: 0;
padding: 6px 13px;
}

table tr th :first-child, table tr td :first-child {
margin-top: 0;
}

table tr th :last-child, table tr td :last-child {
margin-bottom: 0;
}
2 changes: 1 addition & 1 deletion themes/default/single.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php get_header(); ?>
<?php get_header($post->title, $post->excerpt); ?>

<article>
<img src="<?= $post->image; ?>" alt="<?= $post->title; ?>">
Expand Down
5 changes: 4 additions & 1 deletion themes/default/tag.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php get_header(); ?>
<?php
$title = 'Posts tagged ' . $tag;
get_header($title);
?>

<h1>Posts tagged "<?= $tag ?>"</h1>

Expand Down
6 changes: 3 additions & 3 deletions views/default.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!doctype HTML>
<html>
<head>
<title><?= BLOG_NAME ?></title>
<title><?= $config['blog_name']; ?></title>

<style>
* {
Expand Down Expand Up @@ -46,8 +46,8 @@
<body>
<div id="main">
<div class="error">
<h1><?= BLOG_NAME ?></h1>
<p>Powered by <a href="https://github.com/adamgreenough/nicholas">Nicholas</a> ✨</p>
<h1><?= $config['blog_name']; ?></h1>
<p>Powered by <a href="https://nicholas.adgr.dev/">Nicholas</a> ✨</p>
</div>
</div>
</body>
Expand Down

0 comments on commit 39485e0

Please sign in to comment.