Skip to content

Instantly share code, notes, and snippets.

View bastianallgeier's full-sized avatar
🎯
Focusing

Bastian Allgeier bastianallgeier

🎯
Focusing
View GitHub Profile
@bastianallgeier
bastianallgeier / .htaccess
Created June 4, 2018 15:11 — forked from benjaminfritz/.htaccess
.htaccess mit Kirby Installation auf HostEurope Webhosting Server
# Kirby .htaccess
# rewrite rules
<IfModule mod_rewrite.c>
# enable awesome urls. i.e.:
# http://yourdomain.com/about-us/team
RewriteEngine on
# make sure to set the RewriteBase correctly
@bastianallgeier
bastianallgeier / ifttt-instagram-to-blog.php
Last active July 21, 2017 06:59 — forked from brendandawes/ifttt-instagram-to-blog.php
IFTTT Make channel action to create blog post from new post on Instagram
<?php
/* if this script is located in your document root… */
require(__DIR__ . '/kirby/bootstrap.php');
if(get('params')) {
$articles = page('blog')->children();
$sort = ($articles->count() + 1);
$date = date('Y-m-d');
<?php $article = $pages->find('blog')->children()->last() ?>
<div class="footer">
<div class="container">
<div class="grid full">
// Displays the latest blog article
<h3><?php echo html($article->title()) ?></h3>
<small><?php echo html($article->Published()) ?></small>
<p><?php echo excerpt($article->text(), 250) ?>... <a href="<?php echo html($article->url()) ?>">Continue reading</a></p>
</div>
<div class="cf"></div>
@bastianallgeier
bastianallgeier / Search.php
Created September 27, 2012 19:35 — forked from niklausgerber/Search.php
Search Query
<?php snippet('header') ?>
<?php snippet('navigation') ?>
<section id="search">
<?php
$search = new search(array(
'searchfield' => 'q',
'ignore' => array('disclaimer', 'error', 'feed', 'home', 'imprint', 'sitemap', 'about'),
@bastianallgeier
bastianallgeier / test
Created September 27, 2012 11:04 — forked from niklausgerber/test
Can this be done more cleverly - and it does not work
<?php $article = $pages->find('blog')->children()->last() ?>
<section>
<h2 class="nav-element"><a href="<?php echo html($article->url()) ?>"><?php echo html($article->title()) ?></a></h2>
<p><?php echo excerpt($article->text(), 300) ?> <a href="<?php echo html($article->url()) ?>">Read more</a></p>
</section>
@bastianallgeier
bastianallgeier / blog.php
Created April 6, 2012 09:17 — forked from anonymous/blog.php
how to filter by tag params?
<?php snippet('header') ?>
<?php snippet('menu') ?>
<?php
if(param('tag')) {
$articles = $pages->find('blog')
->children()
->visible()
->filterBy('tags', param('tag'), ',')
<?php $articles = $pages->find('blog')->children()->visible()->flip()->limit(3); ?>
<div class="grid">
<div class="row">
<?php $n=0; foreach($articles as $article): ?>
<div class="slot-<?php echo $n . '-' . ($n+1); ?>">
<div class="center">
<a href="<?php echo $article->url() ?>"><?php echo thumb($article->images()->find('thumb.png'), array('width' => 400, 'height' => 300)) ?></a>
</div>
@bastianallgeier
bastianallgeier / separator
Created March 2, 2012 10:20 — forked from niklausgerber/separator
Separator
<?php if($page->hasPrev()): ?>
« <a href="<?php echo $page->prev()->url() ?>">Previous</a>
<?php endif ?>
<?php if($page->hasPrev() && $page->hasNext()): ?>
| //Separator: Should only show up between "Previous | Next" but not if there is just one.
<?php endif ?>
<?php if($page->hasNext()): ?>
<a href="<?php echo $page->next()->url() ?>">Next</a> »
@bastianallgeier
bastianallgeier / home.php
Created February 28, 2012 09:57 — forked from niklausgerber/home.php
Show articles on home but not on blog page / different folder
<?php foreach($page->children()->visible()->flip() as $article): ?>
<li>
<a href="<?php echo $article->url() ?>"><?php echo html($article->title()) ?> <span><?php echo html($article->published()) ?></span></a>
</li>
<?php endforeach ?>