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 / kirby-2.1-changelog.md
Created March 31, 2015 15:33
Kirby 2.1 beta changelog

Kirby 2.1 Beta

Panel

Improved Structure field

Modals

A lot of you werent happy with the current state of structure modals. They were simply too small. All modals now adapt to the screen size and if the window gets too small, modals become scrollable, avoiding any usability issues.

<?php
// get the post UID from the URL
$uid = param('post');
if(!$uid) die(a::json(array(
'status' => 'error',
'msg' => 'The post could not be found',
)));
<form action="<?php echo url('search') ?>" method="get">
<!-- html for your global search form -->
</form>
@bastianallgeier
bastianallgeier / loaded.css
Created December 2, 2011 10:57
I'd love to have a :loaded pseudo selector in css, which makes it possible to style elements when they are actually loaded – like images, iframes or the entire document
img {
opacity: 0;
-webkit-transition: opacity .2s;
-moz-transition: opacity .2s;
-o-transition: opacity .2s;
transition: opacity .2s;
}
img:loaded {
opacity: 1;
@bastianallgeier
bastianallgeier / nginx
Last active November 30, 2023 10:14
nginx setup
# block content
location ~ ^/content/(.*).(txt|md|mdown)$ {
rewrite ^/content/(.*).(txt|md|mdown)$ /error redirect;
}
# block all files in the site folder from being accessed directly
location ~ ^/site/(.*)$ {
rewrite ^/site/(.*)$ /error redirect;
}
@bastianallgeier
bastianallgeier / statify.php
Last active October 4, 2022 17:12
A first draft for a script, which converts a Kirby site into a static site. It's a rough first draft, so don't expect it to be perfect. Play with it, if you like it!
<?php
/**
* Instructions:
*
* 1. Put this into the document root of your Kirby site
* 2. Make sure to setup the base url for your site correctly
* 3. Run this script with `php statify.php` or open it in your browser
* 4. Upload all files and folders from static to your server
* 5. Test your site
@bastianallgeier
bastianallgeier / .htaccess
Created January 3, 2012 11:58
Kirby Default htaccess
DirectoryIndex index.php index.htm index.html
# disable directory listing
Options -Indexes
# rewrite rules
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
title: Example Blueprint
fields:
elastic:
label: Search
type: elastic
@bastianallgeier
bastianallgeier / kirby2.md
Last active August 17, 2020 08:57
An overview of changes and new features for Kirby 2 – Toolkit, CMS and Panel (work in progress)

I've moved this doc to:

<?php
class kirbytextExtended extends kirbytext {
function __construct($text=false, $markdown=true, $smartypants=true {
parent::__construct($text, $markdown, $smartypants);
// define custom tags
$this->addTags('figure');