1
0
Fork 0

[SITE] add template, blueprint, css for the blog

This commit is contained in:
Jannik Beyerstedt 2016-04-17 00:23:20 +02:00
parent 64cb550e9f
commit 2f2fa568ef
14 changed files with 466 additions and 9 deletions

View file

@ -0,0 +1,57 @@
<?php
// -------------------------------------------
// kirby template FOR jannikbeyerstedt.de
// copyright: Jannik Beyerstedt | https://jannikbeyerstedt.de
// license: http://www.gnu.org/licenses/gpl-3.0.txt GPLv3 License
// -------------------------------------------
$base_url = $site->find('blog')->url();
function tags($base_url, $article) {
$tags = explode(',',(string)$article->tags());
if (!empty($tags[0])) {
$return_val = '<span class="tags">';
foreach ($tags as $tag) {
$url = $base_url.'/tag:'.$tag;
$return_val .= '<a href="'.$url.'">' . $tag . '</a> ';
}
$return_val .= '</span>';
return $return_val;
} else {
return '';
}
}
snippet('blog-htmlhead');
snippet('base/cont-header');
?>
<main class="section blog">
<div class="container">
<article class="blogarticle">
<h1><?php echo $page->title()->html() ?></h1>
<?php echo $page->text()->kirbytext(); ?>
</article>
<?php if($page->hasPrevVisible() || $page->hasNextVisible()): ?>
<div class="teasers">
<?php if($page->hasNextVisible()) {
echo snippet('blogexcerpt',["article"=>$page->nextVisible(),"length"=>200,"base_url"=>$base_url]);
} ?>
<?php if($page->hasPrevVisible()) {
echo snippet('blogexcerpt',["article"=>$page->prevVisible(),"length"=>200,"base_url"=>$base_url]);
} ?>
</div>
<?php endif ?>
</div>
</main>
<?php snippet('base/cont-footer') ?>
<?php snippet('base/html-end', ["bs_util"=>1,
"bs_collapse"=>1]) ?>