Add blueprints and fake content

This commit is contained in:
Paul Nicoué 2021-11-18 17:44:47 +01:00
parent 1ff19bf38f
commit 8235816462
592 changed files with 22385 additions and 31535 deletions

View file

@ -3,10 +3,12 @@
use Kirby\Cms\App;
use Kirby\Cms\Collection;
use Kirby\Cms\File;
use Kirby\Cms\Filename;
use Kirby\Cms\FileVersion;
use Kirby\Cms\Template;
use Kirby\Data\Data;
use Kirby\Email\PHPMailer as Emailer;
use Kirby\Filesystem\F;
use Kirby\Filesystem\Filename;
use Kirby\Http\Server;
use Kirby\Http\Uri;
use Kirby\Http\Url;
@ -14,7 +16,6 @@ use Kirby\Image\Darkroom;
use Kirby\Text\Markdown;
use Kirby\Text\SmartyPants;
use Kirby\Toolkit\A;
use Kirby\Toolkit\F;
use Kirby\Toolkit\Str;
use Kirby\Toolkit\Tpl as Snippet;
@ -55,6 +56,17 @@ return [
return $output;
},
/**
* Add your own email provider
*
* @param \Kirby\Cms\App $kirby Kirby instance
* @param array $props
* @param bool $debug
*/
'email' => function (App $kirby, array $props = [], bool $debug = false) {
return new Emailer($props, $debug);
},
/**
* Modify URLs for file objects
*
@ -70,7 +82,7 @@ return [
* Adapt file characteristics
*
* @param \Kirby\Cms\App $kirby Kirby instance
* @param \Kirby\Cms\File|\Kirby\Cms\FileModifications $file The file object
* @param \Kirby\Cms\File|\Kirby\Filesystem\Asset $file The file object
* @param array $options All thumb options (width, height, crop, blur, grayscale)
* @return \Kirby\Cms\File|\Kirby\Cms\FileVersion
*/
@ -233,7 +245,7 @@ return [
}
}
return $item->searchHits > 0 ? true : false;
return $item->searchHits > 0;
});
return $results->sort('searchScore', 'desc');
@ -305,15 +317,18 @@ return [
* Add your own thumb generator
*
* @param \Kirby\Cms\App $kirby Kirby instance
* @param string $src The root of the original file
* @param string $template The template for the root to the desired destination
* @param string $src Root of the original file
* @param string $dst Template string for the root to the desired destination
* @param array $options All thumb options that should be applied: `width`, `height`, `crop`, `blur`, `grayscale`
* @return string
*/
'thumb' => function (App $kirby, string $src, string $template, array $options): string {
$darkroom = Darkroom::factory(option('thumbs.driver', 'gd'), option('thumbs', []));
'thumb' => function (App $kirby, string $src, string $dst, array $options): string {
$darkroom = Darkroom::factory(
option('thumbs.driver', 'gd'),
option('thumbs', [])
);
$options = $darkroom->preprocess($src, $options);
$root = (new Filename($src, $template, $options))->toString();
$root = (new Filename($src, $dst, $options))->toString();
F::copy($src, $root, true);
$darkroom->process($root, $options);
@ -327,13 +342,9 @@ return [
* @param \Kirby\Cms\App $kirby Kirby instance
* @param string $path URL path
* @param array|string|null $options Array of options for the Uri class
* @param Closure $originalHandler Deprecated: Callback function to the original URL handler with `$path` and `$options` as parameters
* Use `$kirby->nativeComponent('url')` inside your URL component instead.
* @return string
*
* @todo Remove $originalHandler parameter in 3.6.0
*/
'url' => function (App $kirby, string $path = null, $options = null, Closure $originalHandler = null): string {
'url' => function (App $kirby, string $path = null, $options = null): string {
$language = null;
// get language from simple string option