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

@ -9,12 +9,12 @@
$subnav = false;
if ($page->depth() == 1) {
$baseSec = $page;
if ( $page->isVisible() && $baseSec->hasVisibleChildren() ) {
if ( $page->isVisible() && $baseSec->hasVisibleChildren() && $page->template() != 'blog' ) {
$subnav = true;
}
}else if ($page->depth() == 2) {
$baseSec = $page->parent();
if ( $page->isVisible() && $baseSec->hasVisibleChildren() ) {
if ( $page->isVisible() && $baseSec->hasVisibleChildren() && $page->template() != 'blogarticle' ) {
$subnav = true;
}
}
@ -26,7 +26,7 @@ if ($page->depth() == 1) {
<ul class="nav mobileNav">
<?php foreach ($site->children()->visible() as $p) : ?>
<a href="<?php echo $p->url()?>" <?php echo ($page == $p)?'class="active"':'' ?>><li><?php echo $p->title() ?></li></a>
<?php if ($p->hasVisibleChildren()) : ?>
<?php if ($p->hasVisibleChildren() && $p->template() != 'blog') : ?>
<ul class="">
<?php foreach ($p->children()->visible() as $c) : ?>
<a href="<?php echo $c->url()?>" <?php echo ($page == $c)?'class="active"':'' ?>><li><?php echo $c->title() ?></li></a>
@ -47,7 +47,7 @@ if ($page->depth() == 1) {
</a>
<?php endif; ?>
<nav>
<nav aria-hidden="true">
<button class="navbar-toggler hidden-sm-up" type="button" data-toggle="collapse" data-target="#exCollapsingNavbar">
Menü <i class="fa fa-bars"></i>
</button>

View file

@ -0,0 +1,40 @@
<?php
// -------------------------------------------
// kirby snippet FOR jannikbeyerstedt.de
// copyright: Jannik Beyerstedt | https://jannikbeyerstedt.de
// license: http://www.gnu.org/licenses/gpl-3.0.txt GPLv3 License
// -------------------------------------------
if( $page->isHomePage() ) {
$title = $site->title()->html();
}else if ($page->depth() == 2) {
$title = $page->parent()->title()->html().': '.$page->title()->html();
}else {
$title = $page->title()->html().' | '.$site->title()->html();
}
?>
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title><?php echo $title ?> </title>
<meta name="description" content="<?php echo $site->description()->html() ?>">
<meta name="keywords" content="<?php echo $page->tags()->html() ?>">
<meta name="author" content="<?php echo $site->author()->html() ?>" >
<?php if ($page->meta_robots()->html() != "") : ?>
<meta name="robots" content="<?php echo $page->meta_robots()->html() ?>">
<?php endif; ?>
<?php echo css('assets/css/foundation.css') ?>
<?php echo css('assets/css/main.css') ?>
<?php echo css('assets/css/blog.css') ?>
<!-- Google web fonts -->
<link href='https://fonts.googleapis.com/css?family=Alegreya+Sans:400,100,300,400italic,500,500italic,700' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Crimson+Text:400,700' rel='stylesheet' type='text/css'>
</head>
<body>

View file

@ -0,0 +1,22 @@
<?php
// -------------------------------------------
// kirby snippet FOR jannikbeyerstedt.de
// copyright: Jannik Beyerstedt | https://jannikbeyerstedt.de
// license: http://www.gnu.org/licenses/gpl-3.0.txt GPLv3 License
// usage: snippet('blogexcerpt',["article"=>$article,"length"=>200,"base_url"=>$base_url])
// -------------------------------------------
$a = $article;
?>
<article class="excerpt">
<h2><a href="<?php echo $a->url()?>"><?php echo $a->title()->html() ?></a></h2>
<p><?php echo $a->text()->excerpt($length) ?>
<a class="more" href="<?php echo $a->url()?>">»</a>
</p>
<div class="meta">
<time datetime="<?php echo $a->date('Y-m-d') ?>"><?php echo $a->date('d. M. Y') ?></time>
<?php echo tags($base_url, $a); ?>
</div>
</article>