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
<section x-data="{showModal: false, html: ''}"> | |
<button | |
@click="html='loading...'; showLoading = true; showModal = !showModal; | |
fetch('{{ entry.url }}', { | |
method: 'GET', | |
headers: { | |
'X-Requested-With': 'XMLHttpRequest', | |
}, | |
}) |
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
{# | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
_layouts/main-layout.html | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
All image transforms are defined here in the main layout template so they can be used site-wide. Templates using this layout can reference them thus: | |
{{ theBackgroundImage.url(transform.small) }} | |
#} | |
{% set transform = { | |
small: { |
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
{% macro truncate(text, limit, append) %} | |
{# settings #} | |
{% set suffix = append|default('...') %} | |
{% set punctuation = ['.',',','-',':',';'] %} | |
{# logic #} | |
{% set array = text|split(' ') %} | |
{% set arrayTruncated = array|slice(0, limit) %} | |
{% set string = arrayTruncated|join(' ') %} | |
{% if limit and array|length > limit %} | |
{% for mark in punctuation %} |
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
// Add this to your 'plugins' array in your tailwind config file. | |
// This creates classes suffixed with an opacity level for each bg colour | |
// For example, .bg-red would have .bg-red-10 through .bg-red-100 for 0.10% opacity background and 100% opacity respectively. | |
({addUtilities, config}) => { | |
let colors = config('colors', []); | |
const newColors = {}; | |
let hexToRgb = (hex) => { | |
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); | |
return result ? { | |
r: parseInt(result[1], 16), |
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
<div class="module__image image--lazy" | |
data-image-src="Tim-Smith_220x140_220_140_int_c1.jpg"></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
# Globals | |
.DS_Store | |
cgi-bin/ | |
error_log | |
# Master Config | |
config/config.local.php | |
# Caches | |
sized/ |