This file contains 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
body { | |
font-family: Helvetica, arial, sans-serif; | |
font-size: 14px; | |
line-height: 1.6; | |
padding-top: 10px; | |
padding-bottom: 10px; | |
background-color: white; | |
padding: 30px; } | |
body > *:first-child { |
This file contains 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 | |
// 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', | |
))); |
This file contains 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 | |
$blogs = $pages->findByUID('blog1', 'blog2'); | |
$articles = $blogs->children()->sortBy('date', 'desc'); | |
// if you want you can add a limit or pagination to that set of articles | |
// afterwards just use a regular foreach loop to go through them all. | |
?> |
This file contains 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
(function($) { | |
$.fn.smoothScroll = function() { | |
return this.on('click', function() { | |
var hash = $(this).attr('href'); | |
var dest = $(hash).offset(); | |
$('html:not(:animated),body:not(:animated)').animate({scrollTop: dest.top, scrollLeft: dest.left}, 500, function() { | |
window.location.hash = hash; |
This file contains 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 $article = $pages->find('blog')->children()->last() ?> | |
<div class="footer"> | |
<div class="container"> | |
<div class="grid full"> | |
// Displays the latest blog article | |
<h3><?php echo html($article->title()) ?></h3> | |
<small><?php echo html($article->Published()) ?></small> | |
<p><?php echo excerpt($article->text(), 250) ?>... <a href="<?php echo html($article->url()) ?>">Continue reading</a></p> | |
</div> | |
<div class="cf"></div> |
This file contains 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 $n=0; foreach($page->children()->visible()->flip() as $article): $n++; ?> | |
<?php if($n==1): ?> | |
<!-- html for your first article --> | |
<?php else: ?> | |
<!-- html for all the other articles --> | |
<?php endif ?> | |
<?php endforeach ?> |
This file contains 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 | |
c::set('routes', array( | |
array( | |
'pattern' => 'projects/old-project-url-for-project-a', | |
'action' => function() { | |
go('projects/project-a'); | |
} | |
), | |
array( |
This file contains 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 | |
/** | |
* 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 |
This file contains 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 function($site, $pages, $page) { | |
$alert = null; | |
if(get('submit')) { | |
$data = array( | |
'name' => get('name'), |
OlderNewer