Skip to content

Instantly share code, notes, and snippets.

View cdowdy's full-sized avatar

Cory Dowdy cdowdy

View GitHub Profile
@cdowdy
cdowdy / blog.liquid
Created June 25, 2019 16:23
main blog page listing all the blog posts (blog.liquid), the post itself (example.md) and the associated layout for the individual post (blogentry.liquid)
---
title: Blog
slug: ./blog
tags: [ main-nav ]
layout: layouts/base.liquid
pagination:
data: collections.blogs
size: 5
alias: posts
---
@cdowdy
cdowdy / extension.php
Created August 12, 2016 17:01
extension setup for backend assets
<?php
namespace Bolt\Extension\cdowdy\html5video;
use Bolt\Asset\File\JavaScript;
use Bolt\Asset\Snippet\Snippet;
use Bolt\Asset\Target;
use Bolt\Controller\Zone;
use Bolt\Extension\cdowdy\html5video\Field\HTML5VideoField;
use Bolt\Extension\SimpleExtension;
@cdowdy
cdowdy / blog_listing.twig
Last active August 29, 2015 14:24
Bolt CMS Compare blog post dates to today's date
{% set publishDate = record.datepublish|date("U") %}
{% set today = "now"|date("U") %}
{% set sixMonthsAgo = today|date_modify("-180 day")|date("U") %} {# for testing #}
{% set pubPlusSix = publishDate|date_modify("+180 day")|date("U") %}
{% if today > pubPlusSix %}
<p>six months old</p>
% else %}
<p>less than six months old</p>
{% endif %}
@cdowdy
cdowdy / Chrome-Inline-SVG Fix
Created May 23, 2014 17:03
Fix weird spacing/padding in Google Chrome for inline SVG
svg {
box-sizing: border-box;
width: 100%;
height: 100%;
display: block;
}