# frozen_string_literal: true class TweetEmbedGenerator < Jekyll::Generator def generate(site) return if !site.config["embed_tweets"] all_notes = site.collections['notes'].docs all_pages = site.pages all_docs = all_notes + all_pages all_docs.each do |current_note| current_note.content.gsub!( /^https?:\/\/twitter\.com\/(?:#!\/)?(\w+)\/status(es)?\/(\d+)$/i, <<~HTML
This tweet could not be embedded. View it on Twitter instead.HTML ) end end end