Compare commits
No commits in common. "f1496b06538f785b0200e867885a8a08c17b8b35" and "2d714c2393e4cea66a1d0f452c437d1eead23127" have entirely different histories.
f1496b0653
...
2d714c2393
|
@ -26,8 +26,6 @@ if( $page->isHomePage() ) {
|
||||||
<meta name="robots" content="<?php echo $page->meta_robots()->html() ?>">
|
<meta name="robots" content="<?php echo $page->meta_robots()->html() ?>">
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<link rel="alternate" type="application/rss+xml" title="Janniks Blog" href="<?= site()->url() ?>?rss"/>
|
|
||||||
|
|
||||||
<?php echo css('assets/css/foundation.css?v1.1') ?>
|
<?php echo css('assets/css/foundation.css?v1.1') ?>
|
||||||
|
|
||||||
<?php echo css('assets/css/main.css?v1.1') ?>
|
<?php echo css('assets/css/main.css?v1.1') ?>
|
||||||
|
|
|
@ -17,6 +17,6 @@ $a = $article;
|
||||||
</p>
|
</p>
|
||||||
<div class="meta">
|
<div class="meta">
|
||||||
<time datetime="<?php echo $a->date()->toDate('Y-m-d') ?>"><?php echo $a->date()->toDate('d. M. Y') ?></time>
|
<time datetime="<?php echo $a->date()->toDate('Y-m-d') ?>"><?php echo $a->date()->toDate('d. M. Y') ?></time>
|
||||||
<?php echo tags_html($base_url, $a); ?>
|
<?php echo tags($base_url, $a); ?>
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
<?php
|
|
||||||
// -------------------------------------------
|
|
||||||
// kirby snipper FOR generic
|
|
||||||
|
|
||||||
// copyright: Jannik Beyerstedt | https://jannikbeyerstedt.de
|
|
||||||
// license: http://www.gnu.org/licenses/gpl-3.0.txt GPLv3 License
|
|
||||||
|
|
||||||
// Usage: snippet('blogfeed',["articles"=>$articles, "link"=>$baseurl, "feedurl"=>$feedurl])
|
|
||||||
// -------------------------------------------
|
|
||||||
|
|
||||||
header("Content-Type: application/rss+xml");
|
|
||||||
?>
|
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
|
||||||
<channel>
|
|
||||||
<title>Janniks Blog</title>
|
|
||||||
<description>Persönliches Blog von Jannik Beyerstedt</description>
|
|
||||||
<link><?php echo $link ?></link>
|
|
||||||
<atom:link href="<?= \Kirby\Toolkit\Xml::encode($feedurl) ?>" rel="self" type="application/rss+xml" />
|
|
||||||
<pubDate><?php echo date("d M Y H:i:s O") ?></pubDate>
|
|
||||||
|
|
||||||
<?php foreach($articles as $a):?>
|
|
||||||
<item>
|
|
||||||
<title><?php echo \Kirby\Toolkit\Xml::encode($a->title()) ?></title>
|
|
||||||
<link><?php echo \Kirby\Toolkit\Xml::encode($a->url()) ?></link>
|
|
||||||
<guid isPermaLink="false">jbeyerstedt/<?php echo \Kirby\Toolkit\Xml::encode($a->slug()) ?></guid>
|
|
||||||
<pubDate><?php echo $a->date()->toDate("d M Y H:i:s O") ?></pubDate>
|
|
||||||
<description><![CDATA[<?php echo $a->text()->kirbytext() ?>]]></description>
|
|
||||||
</item>
|
|
||||||
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</channel>
|
|
||||||
</rss>
|
|
|
@ -6,8 +6,8 @@
|
||||||
// license: http://www.gnu.org/licenses/gpl-3.0.txt GPLv3 License
|
// license: http://www.gnu.org/licenses/gpl-3.0.txt GPLv3 License
|
||||||
// -------------------------------------------
|
// -------------------------------------------
|
||||||
|
|
||||||
// Function needed by blogexcerpt
|
$base_url = $site->find('blog')->url();
|
||||||
function tags_html($base_url, $article) {
|
function tags($base_url, $article) {
|
||||||
$tags = explode(',',(string)$article->tags());
|
$tags = explode(',',(string)$article->tags());
|
||||||
|
|
||||||
if (!empty($tags[0])) {
|
if (!empty($tags[0])) {
|
||||||
|
@ -23,20 +23,10 @@ function tags_html($base_url, $article) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$base_url = $site->find('blog')->url();
|
|
||||||
$feed_url = $base_url.'?rss';
|
|
||||||
$articles = $page->children()->listed()->flip();
|
$articles = $page->children()->listed()->flip();
|
||||||
|
|
||||||
$title = $page->title()->html();
|
$title = $page->title()->html();
|
||||||
|
|
||||||
// Deliver RSS feed on ?rss GET parameter
|
|
||||||
$is_rss = get('rss');
|
|
||||||
if ($is_rss !== null) {
|
|
||||||
snippet('blogfeed', ["articles"=>$articles,"link"=>$base_url,"feedurl"=>$feed_url]);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filter by requested tag
|
|
||||||
if($tag = param('tag')) {
|
if($tag = param('tag')) {
|
||||||
$articles = $articles->filterBy('tags', $tag, ',');
|
$articles = $articles->filterBy('tags', $tag, ',');
|
||||||
$title .= ' - '.$tag;
|
$title .= ' - '.$tag;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
// -------------------------------------------
|
// -------------------------------------------
|
||||||
|
|
||||||
$base_url = $site->find('blog')->url();
|
$base_url = $site->find('blog')->url();
|
||||||
function tags_html($base_url, $article) {
|
function tags($base_url, $article) {
|
||||||
$tags = explode(',',(string)$article->tags());
|
$tags = explode(',',(string)$article->tags());
|
||||||
|
|
||||||
if (!empty($tags[0])) {
|
if (!empty($tags[0])) {
|
||||||
|
@ -43,7 +43,7 @@ snippet('base/cont-header');
|
||||||
|
|
||||||
<div class="meta bottom">
|
<div class="meta bottom">
|
||||||
<time datetime="<?php echo $page->date()->toDate('Y-m-d') ?>"><?php echo $page->date()->toDate('d. M. Y') ?></time>
|
<time datetime="<?php echo $page->date()->toDate('Y-m-d') ?>"><?php echo $page->date()->toDate('d. M. Y') ?></time>
|
||||||
<?php echo tags_html($base_url, $page); ?>
|
<?php echo tags($base_url, $page); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
|
|
Loading…
Reference in a new issue