/web
/htdocs1
/anymadestudiocom
/home
/www
/site
/snippets
/header.php
<!doctype html>
<html lang="<?= site()->language()->code() ?>">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta property="og:url" content="<?= $page->url() ?>" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="<?= $site->title()->html() ?>" />
<?php if($page->isHomepage()): ?>
<title><?= $site->title()->html() ?></title>
<meta property="og:title" content="<?= $site->title()->html() ?>" />
<?php else: ?>
<title><?= $page->title()->html() ?> | <?= $site->title()->html() ?></title>
<meta property="og:title" content="<?= $page->title()->html() ?> | <?= $site->title()->html() ?>" />
<?php endif; ?>
<?php if($page->intendedTemplate() == 'modular'): ?>
<meta name="description" content="<?= $page->text()->excerpt(160) ?>">
<meta property="og:description" content="<?= $page->text()->excerpt(160) ?>" />
<?php else: ?>
<meta name="description" content="<?= $site->description()->html() ?>">
<meta property="og:description" content="<?= $site->description()->html() ?>" />
<?php endif; ?>
<?php if($page->intendedTemplate() == 'modular'): ?>
<?php if($intro = $page->headerimage()->toFile()): ?>
<meta property="og:image" content="<?= $intro->crop(1200, 800, 95)->url(); ?>" />
<?php endif; ?>
<?php else: ?>
<?php $latestProject = $site->index()->filterBy('intendedTemplate', 'modular')->visible()->first(); ?>
<?php if($intro = $latestProject->headerimage()->toFile()): ?>
<meta property="og:image" content="<?= $intro->crop(1200, 800, 95)->url(); ?>" />
<?php endif; ?>
<?php endif; ?>
<?= css('assets/css/fonts.css') ?>
<?= css('assets/sass/main.css') ?>
/web
/htdocs1
/anymadestudiocom
/home
/www
/kirby
/vendor
/getkirby
/toolkit
/lib
/tpl.php
/**
* Tpl
*
* Super simple template engine
*
* @package Kirby Toolkit
* @author Bastian Allgeier <bastian@getkirby.com>
* @link http://getkirby.com
* @copyright Bastian Allgeier
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
class Tpl extends Silo {
public static $data = array();
public static function load($_file, $_data = array(), $_return = true) {
if(!file_exists($_file)) return false;
ob_start();
extract(array_merge(static::$data, (array)$_data));
require($_file);
$_content = ob_get_contents();
ob_end_clean();
if($_return) return $_content;
echo $_content;
}
}
/web
/htdocs1
/anymadestudiocom
/home
/www
/kirby
/kirby
/component
/snippet.php
* Returns a snippet file path by name
*
* @param string $name
* @return string
*/
public function file($name) {
return $this->kirby->roots()->snippets() . DS . str_replace('/', DS, $name) . '.php';
}
/**
* Renders the snippet with the given data
*
* @param string $name
* @param array $data
* @param boolean $return
* @return string
*/
public function render($name, $data = [], $return = false) {
if(is_object($data)) $data = ['item' => $data];
return tpl::load($this->kirby->registry->get('snippet', $name), $data, $return);
}
}
/web
/htdocs1
/anymadestudiocom
/home
/www
/kirby
/helpers.php
<?php
/**
* Embeds a snippet from the snippet folder
*
* @param string $file
* @param mixed $data array or object
* @param boolean $return
* @return string
*/
function snippet($file, $data = array(), $return = false) {
return kirby::instance()->component('snippet')->render($file, $data, $return);
}
/**
* Builds a css link tag for relative or absolute urls
*
* @param string $url
* @param string|array $media Either a media string or an array of attributes
* @return string
*/
function css() {
return call([kirby::instance()->component('css'), 'tag'], func_get_args());
}
/**
* Builds a script tag for relative or absolute links
*
* @param string $src
* @param boolean|array $async Either true for the async attribute or an array of attributes
* @return string
*/
function js() {
return call([kirby::instance()->component('js'), 'tag'], func_get_args());
}
/**
* Global markdown parser shortcut
*
* @param string $text
/web
/htdocs1
/anymadestudiocom
/home
/www
/site
/templates
/gallery.php
<?php snippet('header', ['site' => $site, 'page' => $page]); ?>
<?php snippet('menu_gallery', ['site' => $site, 'page' => $page]); ?>
<style type="text/css">
.page-container.fullscreen section.image {
background-size: cover;
<?php if($page->bgcolor()->isNotEmpty()): ?>
background-color: <?= $page->bgcolor() ?>;
<?php endif; ?>
}
</style>
<div class="page-container fullscreen is-faded">
<?php
if($page->intendedTemplate() == 'modular') {
$images = $page->moduleList()->images();
$first = $images->first();
$index = 0;
} else {
$images = $page->images()->sortBy('sort', 'asc')->slice(1);
$first = $images->first();
$index = 0;
}
?>
<?php foreach($images as $image): ?>
<style type="text/css">
section#<?= $image->name(); ?> {
background-image: url('<?= $image->resize(600)->url(); ?>');
<?php if($image->isPortrait()): ?>
background-size: contain;
<?php endif; ?>
}
@media (min-width: 600px) {
section#<?= $image->name(); ?> {
background-image: url('<?= $image->resize(1200)->url(); ?>');
}
}
@media (min-width: 1200px) {
section#<?= $image->name(); ?> {
/web
/htdocs1
/anymadestudiocom
/home
/www
/kirby
/vendor
/getkirby
/toolkit
/lib
/tpl.php
/**
* Tpl
*
* Super simple template engine
*
* @package Kirby Toolkit
* @author Bastian Allgeier <bastian@getkirby.com>
* @link http://getkirby.com
* @copyright Bastian Allgeier
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
class Tpl extends Silo {
public static $data = array();
public static function load($_file, $_data = array(), $_return = true) {
if(!file_exists($_file)) return false;
ob_start();
extract(array_merge(static::$data, (array)$_data));
require($_file);
$_content = ob_get_contents();
ob_end_clean();
if($_return) return $_content;
echo $_content;
}
}
/web
/htdocs1
/anymadestudiocom
/home
/www
/site
/config
/config.php
'name' => 'English',
'default' => true,
'locale' => 'en_US',
'url' => '/',
),
));
c::set('routes', array(
array(
'pattern' => 'projects/(:any)/gallery',
'action' => function($project) {
// $page = kirby()->site()->index()->find($project);
// $site = kirby()->site();
tpl::load(kirby()->roots()->templates() . DS . 'gallery.php', [
'site' => site(),
// 'page' => $page = kirby()->site()->index()->findBy('uid', $project)
'page' => page('projects/' . $project)
], false);
}
)
));
/web
/htdocs1
/anymadestudiocom
/home
/www
/kirby
/vendor
/getkirby
/toolkit
/helpers.php
/**
* Facepalm typo alias
* @see csrf()
*/
function csfr() {
return call('csrf', func_get_args());
}
/**
* Shortcut for call_user_func_array with a better handling of arguments
*
* @param mixed $function
* @param mixed $arguments
* @return mixed
*/
function call($function, $arguments = array()) {
if(!is_callable($function)) return false;
if(!is_array($arguments)) $arguments = array($arguments);
return call_user_func_array($function, $arguments);
}
/**
* Parses yaml structured text
*
* @param $string
* @return array
*/
function yaml($string) {
return yaml::decode($string);
}
/**
* Simple email sender helper
*
* @param array $params
* @return Email
*/
function email($params = array()) {
return new Email($params);
/web
/htdocs1
/anymadestudiocom
/home
/www
/kirby
/kirby.php
// load all plugins
$this->plugins();
// start the router
$this->router = new Router($this->routes());
$this->route = $this->router->run(trim($this->path(), '/'));
// check for a valid route
if(is_null($this->route)) {
header::status('500');
header::type('json');
die(json_encode(array(
'status' => 'error',
'message' => 'Invalid route or request method'
)));
}
// call the router action with all arguments from the pattern
$response = call($this->route->action(), $this->route->arguments());
// load all language variables
// this can only be loaded once the router action has been called
// otherwise the current language is not yet available
$this->localize();
// build the response
$this->response = $this->component('response')->make($response);
// store the current language in the session
if(
$this->option('language.detect') &&
$this->site()->multilang() &&
$this->site()->language()
) {
s::set('kirby_language', $this->site()->language()->code());
}
return $this->response;
/web
/htdocs1
/anymadestudiocom
/home
/www
/index.php
<?php
define('DS', DIRECTORY_SEPARATOR);
// load kirby
require(__DIR__ . DS . 'kirby' . DS . 'bootstrap.php');
// check for a custom site.php
if(file_exists(__DIR__ . DS . 'site.php')) {
require(__DIR__ . DS . 'site.php');
} else {
$kirby = kirby();
}
// render
echo $kirby->launch();