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
require 'cgi' | |
require 'net/https' | |
require 'uri' | |
module Jekyll | |
class SnippetTag < Liquid::Tag | |
def initialize(tag_name, text, token) | |
super | |
@text = text | |
@cache_disabled = false |
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
require 'digest' | |
module MD5Filter | |
def md5 (input) | |
md5 = Digest::MD5.new | |
md5.update input | |
md5.hexdigest | |
end | |
end |
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
require "base64" | |
module Base64Filter | |
def base64_encode (input) | |
Base64.encode64(input) | |
end | |
end | |
Liquid::Template.register_filter(Base64Filter) # register filter globally |
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
{% if jekyll.environment == 'production' %} | |
{%- if site.tracking.google_analytics -%} | |
{%- include tracking/ga.html -%} | |
{%- endif -%} | |
{%- if site.tracking.google_tag_manager -%} | |
{%- include tracking/gtm.html -%} | |
{%- endif -%} | |
{%- if site.tracking.facebook_pixel -%} | |
{%- include tracking/fb.html -%} |
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
{% comment %} | |
This tag assumes that you have some kind of a process to create webp | |
versions of your images, maybe as part of your build pipeline. | |
Also, my specific staging environment does have this webp generation setup | |
which is why I exclude the webp source on staging - you can do the same for other | |
environments, like development. | |
{% endcomment %} |