Last active
May 21, 2020 07:14
-
-
Save scottboms/98eefa57073521074aa3a7325ebe825f to your computer and use it in GitHub Desktop.
Core Kirby config file. See also related files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Allows you to use blueprints to tell | |
* Kirby whether to cache a page or not | |
* | |
* eg. | |
* In a page blueprint | |
* options: | |
* cache: false | |
*/ | |
return [ | |
'pages' => [ | |
'active' => false, | |
'ignore' => function ($page) { | |
$options = $page->blueprint()->options(); | |
return isset($options['cache']) ? !$options['cache'] : false; | |
} | |
] | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return [ | |
// set environment variable | |
'environment' => 'development', | |
// activate debug mode | |
'debug' => true, | |
// disable the fingerprint plugin | |
'bvdputte.fingerprint.disabled' => true, | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The config file is optional. It accepts a return array with config options | |
* Note: Never include more than one return statement, all options go within this single return array | |
* All config options: https://getkirby.com/docs/reference/system/options | |
*/ | |
return [ | |
// thumbnail options | |
// load from external file by using 'require once' | |
'thumbs' => require_once 'thumbs.php', | |
// turn on markdown extra | |
'markdown' => [ | |
'extra' => true | |
], | |
// turn on smartypants globally | |
// set content file extensions to .md from .txt default | |
'smartypants' => true, | |
'content' => [ | |
'extension' => 'md' | |
], | |
// routes & redirects | |
// load from external file using 'require_once' | |
'routes' => require_once 'routes.php', | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return [ | |
// set environment variable | |
'environment' => 'production', | |
// disable debug mode on live server | |
// for security reasons | |
'debug' => false, | |
// cache options | |
// load from external file using 'require_once' | |
'cache' => require_once 'cache.php', | |
'bvdputte.fingerprint.disabled' => false, | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return [ | |
// virtual page for RSS feed | |
// using the kirby3-feed plugin to general RSS feed | |
[ | |
'pattern' => 'feed', | |
'method' => 'GET', | |
'action' => function () { | |
$options = [ | |
'url' => site()->url(), | |
'feedurl' => site()->url() . '/feed/', | |
'title' => 'Latest Dispatches', | |
'description' => 'The Latest Dispatches from Scott Boms', | |
'link' => site()->url() . '/documenting/', | |
'urlfield' => 'url', | |
'titlefield' => 'title', | |
'datefield' => 'date', | |
'textfield' => 'text', // Field used for feed content | |
'modified' => time(), | |
'mime' => null, | |
'sort' => true, | |
]; | |
// build feed from 'documenting' page content, get last 10 entries with newest first | |
$feed = page('documenting')->children()->listed()->flip()->limit(10)->feed($options); | |
return $feed; | |
} | |
], | |
// filtering for projects routes | |
// filter by tag without querystring parameters | |
[ | |
'pattern' => 'making/(:any)', | |
'action' => function ($filter) { | |
if ($page = page('making/' . $filter)) { | |
return $page; | |
} else { | |
return page('making')->render([ | |
'filter' => $filter | |
]); | |
} | |
} | |
], | |
// additional custom routes would go here | |
// used on homepage for unique urls to pages | |
[ | |
'pattern' => ['education', 'speaking'], | |
'action' => function() { | |
// do something | |
return page('thinking'); | |
} | |
], | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return [ | |
// thumb generation presets with names | |
'presets' => [ | |
'normal' => ['width' => 800, 'quality' => 75], | |
'large' => ['width' => 1200, 'quality' => 75], | |
'xlarge' => ['width' => 1800, 'quality' => 75] | |
], | |
// srcset defaults - two sets: default, albums | |
'srcsets' => [ | |
'default' => [ | |
'800w' => ['width' => 800, 'quality' => 75], | |
'1200w' => ['width' => 1200, 'quality' => 75], | |
'1800w' => ['width' => 1800, 'quality' => 75], | |
], | |
'albums' => [ | |
'400w' => ['width' => 400, 'quality' => 75], | |
'600w' => ['width' => 600, 'quality' => 75], | |
], | |
], | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment