Skip to content

Instantly share code, notes, and snippets.

View plfstr's full-sized avatar

Paul plfstr

View GitHub Profile
@plfstr
plfstr / much-content
Created August 19, 2013 22:39
Much Content? - Script which displays a percentage of page content vs comments.
function getOffset()
{
var commentsList = ['comments', 'discussion', 'reply', 'notes', 'commentarea', 'disqus_thread', 'fb-comment-container', 'lf_comment_stream', 'respond', 'response', 'CommentList', 'comments-list', 'start-of-comments', 'article-comments', 'echo-stream', 'vanilla-comments', 'cboxid']; //If some comments are not being picked up, append their #ID to this array.
var i = 0,
commentsLength = commentsList.length,
getViewheight = window.innerHeight, //The height of the browser viewport
getTotalheight = document.body.scrollHeight,
percentStyle,
percentBox;
@plfstr
plfstr / Kirby CMS Figure Quote Plugin
Created September 20, 2014 15:15
Kirbytext plugin for Kirby CMS to create <figure> wrapped blockquotes, with optional <figcaption>
<?php
# ***Must be included as part of plugins/kirbytext.extend.php*** - Follow guidance here http://getkirby.com/blog/kirbytext
# Kirby CMS Figure Quote Plugin - Forked from https://gist.github.com/bastianallgeier/2924148#file-figure-php
# Blockquote markup best practice followed from http://alistapart.com/blog/post/more-thoughts-about-blockquotes-than-are-strictly-required
# Include in a post as follows (figquote: Example quotes need to be good ones. source: Mr Example)
/* Example CSS to target blockquote:
.blockquote {}
.blockquote p {}
.blockquote blockquote {}
.blockquote figcaption:before {content: "—";}
@plfstr
plfstr / readme.md
Last active October 21, 2015 10:14 — forked from ClementRoy/kirbytext.extended.php
Kirby 2 Kirbytag extension for simple CodePen embeds.
@plfstr
plfstr / breadcrumblist.php
Created August 31, 2016 14:32
Breadcrumb Schema JSON-LD Snippet for Kirby 2 CMS
<!--BreadcrumbList Schema-->
<?php if($page->depth() >= 2) : ?>
<?php $schemacrumbs = $page->parents()->flip(); $schemacrumbcount = 1; ?>
<?php if(isset($schemacrumbs)) : ?>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
<?php foreach($schemacrumbs as $schemacrumb): ?>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.