Add the function below to your ~/.bashrc
or ~/.zshrc
file.
Usage:
kirby <branch>
kirby
<?php | |
use Kirby\Cms\App; | |
App::plugin('adamkiss/simple-snippets', []); | |
if (! function_exists('s')) { | |
/** | |
* Short, auto-return snippet call with support for auto-merging certain parameters | |
* | |
* @param string $snippetName |
by Jenny Knuth, based on the work of Chris Coyier and Taylor Hunt
A data URI is a nice way to include a web resource without needing to make an HTTP request. Chris Coyier explains the technique nicely in Probably Don't Base64 SVG.
While a PNG might use Base64 encoding, for SVG, there is a better way.
Taylor Hunt's experiments led to this solution for optimizing SVGs in data URIs:
"So the best way of encoding SVG in a data URI is data:image/svg+xml,[actual data]
. We don’t need the ;charset=utf-8
parameter (or the invalid ;utf8
parameter…), because URLs are always ASCII."