This file contains hidden or 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
--- | |
eleventyExcludeFromCollections: true | |
pagination: | |
data: collections.versions | |
size: 1 | |
alias: page | |
eleventyComputed: | |
title: "{{ page.data.title }}" | |
permalink: "/{{ page.data.version | slugify }}/{{ page.data.title | slugify }}/" | |
--- |
This file contains hidden or 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
--- | |
eleventyExcludeFromCollections: true | |
pagination: | |
data: collections.stores | |
size: 1 | |
alias: store | |
eleventyComputed: | |
title: "{{ store.data.title }} Content Manager config" | |
permalink: "/stores/{{ store.data.slugOverride | slugify }}/admin/config.yml" | |
--- |
This file contains hidden or 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
/** | |
* "Time Ago" vanilla javascript snippet | |
* | |
* Lovingly stolen from StackOverflow here: https://stackoverflow.com/a/37802747 | |
* | |
* Convert elements like this: | |
* <time datetime="Thu May 12 2022 21:05:56 GMT+0000 (Coordinated Universal Time)">May 12th, 2022</time> | |
* | |
* To This: | |
* <time datetime="Thu May 12 2022 21:05:56 GMT+0000 (Coordinated Universal Time)">4 days ago</time> |
This file contains hidden or 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
... | |
postsByTag: function (eleventyConfig) { | |
let _ = require("lodash"); | |
eleventyConfig.addCollection("postsByTag", function(collection) { | |
// Get unique list of tags | |
let tagSet = new Set(); | |
collection.getAllSorted().map(function(item) { | |
if( "tags" in item.data ) { |
This file contains hidden or 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
eleventyConfig.addNunjucksShortcode("youtube", function (youtubeId, aspectRatio) { | |
return `<div class="aspect-ratio" style="--aspect-ratio: ${aspectRatio}"><iframe class="youtube-player video video--youtube" src="https://www.youtube.com/embed/${youtubeId}/" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></div>`; | |
}); |
This file contains hidden or 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 | |
/** | |
* Replace FacetWP default HTML output for "Checkboxes" with Bootstrap custom checkbox markup | |
*/ | |
add_filter('facetwp_facet_html', function ($output, $params) { | |
// Check that this facet is a "checkboxes" type facet before proceeding. | |
if ('checkboxes' == $params['facet']['type']) { | |
// Initialize variables |
This file contains hidden or 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
$(".gform_wrapper form").on("submit", function(e){ | |
$(this).find(".gform_button").attr("disabled", true); | |
}); |
This file contains hidden or 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 | |
// Apply product categories to newly created or saved tickets that match the The Events Calendar categories of the associated event | |
add_action('event_tickets_after_save_ticket', function ($event_id, $ticket, $raw_data, $classname) { | |
if (! empty($ticket) && isset($ticket->ID)) { | |
// Apply the "event-tickets" category to add tickets so that all tickets have at least this category to start | |
wp_add_object_terms($ticket->ID, 'event-tickets', 'product_cat'); | |
// Get all the other "tribe_events_cat" taxonomy terms on the event |
This file contains hidden or 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 | |
// Adjust FacetWP "Radio" HTML output to be friendlier with our theme | |
add_filter('facetwp_facet_html', function ($output, $params) { | |
// Check that this facet is a "radio" type facet before proceeding. | |
if ('radio' == $params['facet']['type']) { | |
// Initialize our variables | |
$output = ''; |
NewerOlder