From 5571dc766e2143e39762ff0b47c41d1c2e154f4c Mon Sep 17 00:00:00 2001 From: Benjamin Sanders Date: Sat, 11 Oct 2025 10:34:24 -0400 Subject: Vendor bundled gems for deployment --- .../gems/jekyll-feed-0.17.0/lib/jekyll-feed.rb | 12 ++ .../jekyll-feed-0.17.0/lib/jekyll-feed/feed.xml | 112 ++++++++++++++++ .../lib/jekyll-feed/generator.rb | 149 +++++++++++++++++++++ .../jekyll-feed-0.17.0/lib/jekyll-feed/meta-tag.rb | 27 ++++ .../lib/jekyll-feed/page-without-a-file.rb | 9 ++ .../jekyll-feed-0.17.0/lib/jekyll-feed/version.rb | 7 + 6 files changed, 316 insertions(+) create mode 100644 vendor/bundle/ruby/3.4.0/gems/jekyll-feed-0.17.0/lib/jekyll-feed.rb create mode 100644 vendor/bundle/ruby/3.4.0/gems/jekyll-feed-0.17.0/lib/jekyll-feed/feed.xml create mode 100644 vendor/bundle/ruby/3.4.0/gems/jekyll-feed-0.17.0/lib/jekyll-feed/generator.rb create mode 100644 vendor/bundle/ruby/3.4.0/gems/jekyll-feed-0.17.0/lib/jekyll-feed/meta-tag.rb create mode 100644 vendor/bundle/ruby/3.4.0/gems/jekyll-feed-0.17.0/lib/jekyll-feed/page-without-a-file.rb create mode 100644 vendor/bundle/ruby/3.4.0/gems/jekyll-feed-0.17.0/lib/jekyll-feed/version.rb (limited to 'vendor/bundle/ruby/3.4.0/gems/jekyll-feed-0.17.0/lib') diff --git a/vendor/bundle/ruby/3.4.0/gems/jekyll-feed-0.17.0/lib/jekyll-feed.rb b/vendor/bundle/ruby/3.4.0/gems/jekyll-feed-0.17.0/lib/jekyll-feed.rb new file mode 100644 index 0000000..60dd607 --- /dev/null +++ b/vendor/bundle/ruby/3.4.0/gems/jekyll-feed-0.17.0/lib/jekyll-feed.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +require "jekyll" +require "fileutils" +require "jekyll-feed/generator" + +module JekyllFeed + autoload :MetaTag, "jekyll-feed/meta-tag" + autoload :PageWithoutAFile, "jekyll-feed/page-without-a-file.rb" +end + +Liquid::Template.register_tag "feed_meta", JekyllFeed::MetaTag diff --git a/vendor/bundle/ruby/3.4.0/gems/jekyll-feed-0.17.0/lib/jekyll-feed/feed.xml b/vendor/bundle/ruby/3.4.0/gems/jekyll-feed-0.17.0/lib/jekyll-feed/feed.xml new file mode 100644 index 0000000..9068836 --- /dev/null +++ b/vendor/bundle/ruby/3.4.0/gems/jekyll-feed-0.17.0/lib/jekyll-feed/feed.xml @@ -0,0 +1,112 @@ + +{% if page.xsl %} + +{% endif %} + + Jekyll + + + {{ site.time | date_to_xmlschema }} + {{ page.url | absolute_url | xml_escape }} + + {% assign title = site.title | default: site.name %} + {% if page.collection != "posts" %} + {% assign collection = page.collection | capitalize %} + {% assign title = title | append: " | " | append: collection %} + {% endif %} + {% if page.category %} + {% assign category = page.category | capitalize %} + {% assign title = title | append: " | " | append: category %} + {% endif %} + + {% if title %} + {{ title | smartify | xml_escape }} + {% endif %} + + {% if site.description %} + {{ site.description | xml_escape }} + {% endif %} + + {% if site.author %} + + {{ site.author.name | default: site.author | xml_escape }} + {% if site.author.email %} + {{ site.author.email | xml_escape }} + {% endif %} + {% if site.author.uri %} + {{ site.author.uri | xml_escape }} + {% endif %} + + {% endif %} + + {% if page.tags %} + {% assign posts = site.tags[page.tags] %} + {% else %} + {% assign posts = site[page.collection] %} + {% endif %} + {% if page.category %} + {% assign posts = posts | where: "categories", page.category %} + {% endif %} + {% unless site.show_drafts %} + {% assign posts = posts | where_exp: "post", "post.draft != true" %} + {% endunless %} + {% assign posts = posts | sort: "date" | reverse %} + {% assign posts_limit = site.feed.posts_limit | default: 10 %} + {% for post in posts limit: posts_limit %} + + {% assign post_title = post.title | smartify | strip_html | normalize_whitespace | xml_escape %} + + {{ post_title }} + + {{ post.date | date_to_xmlschema }} + {{ post.last_modified_at | default: post.date | date_to_xmlschema }} + {{ post.id | absolute_url | xml_escape }} + {% assign excerpt_only = post.feed.excerpt_only | default: site.feed.excerpt_only %} + {% unless excerpt_only %} + + {% endunless %} + + {% assign post_author = post.author | default: post.authors[0] | default: site.author %} + {% assign post_author = site.data.authors[post_author] | default: post_author %} + {% assign post_author_email = post_author.email | default: nil %} + {% assign post_author_uri = post_author.uri | default: nil %} + {% assign post_author_name = post_author.name | default: post_author %} + + + {{ post_author_name | default: "" | xml_escape }} + {% if post_author_email %} + {{ post_author_email | xml_escape }} + {% endif %} + {% if post_author_uri %} + {{ post_author_uri | xml_escape }} + {% endif %} + + + {% if post.category %} + + {% elsif post.categories %} + {% for category in post.categories %} + + {% endfor %} + {% endif %} + + {% for tag in post.tags %} + + {% endfor %} + + {% assign post_summary = post.description | default: post.excerpt %} + {% if post_summary and post_summary != empty %} + + {% endif %} + + {% assign post_image = post.image.path | default: post.image %} + {% if post_image %} + {% unless post_image contains "://" %} + {% assign post_image = post_image | absolute_url %} + {% endunless %} + + + {% endif %} + + {% endfor %} + diff --git a/vendor/bundle/ruby/3.4.0/gems/jekyll-feed-0.17.0/lib/jekyll-feed/generator.rb b/vendor/bundle/ruby/3.4.0/gems/jekyll-feed-0.17.0/lib/jekyll-feed/generator.rb new file mode 100644 index 0000000..7a95919 --- /dev/null +++ b/vendor/bundle/ruby/3.4.0/gems/jekyll-feed-0.17.0/lib/jekyll-feed/generator.rb @@ -0,0 +1,149 @@ +# frozen_string_literal: true + +module JekyllFeed + class Generator < Jekyll::Generator + safe true + priority :lowest + + # Main plugin action, called by Jekyll-core + def generate(site) + @site = site + if disabled_in_development? + Jekyll.logger.info "Jekyll Feed:", "Skipping feed generation in development" + return + end + collections.each do |name, meta| + Jekyll.logger.info "Jekyll Feed:", "Generating feed for #{name}" + (meta["categories"] + [nil]).each do |category| + path = feed_path(:collection => name, :category => category) + next if file_exists?(path) + + @site.pages << make_page(path, :collection => name, :category => category) + end + end + generate_feed_by_tag if config["tags"] && !@site.tags.empty? + end + + private + + # Matches all whitespace that follows + # 1. A '>', which closes an XML tag or + # 2. A '}', which closes a Liquid tag + # We will strip all of this whitespace to minify the template + MINIFY_REGEX = %r!(?<=>|})\s+!.freeze + + # Returns the plugin's config or an empty hash if not set + def config + @config ||= @site.config["feed"] || {} + end + + # Determines the destination path of a given feed + # + # collection - the name of a collection, e.g., "posts" + # category - a category within that collection, e.g., "news" + # + # Will return "/feed.xml", or the config-specified default feed for posts + # Will return `/feed/category.xml` for post categories + # WIll return `/feed/collection.xml` for other collections + # Will return `/feed/collection/category.xml` for other collection categories + def feed_path(collection: "posts", category: nil) + prefix = collection == "posts" ? "/feed" : "/feed/#{collection}" + return "#{prefix}/#{category}.xml" if category + + collections.dig(collection, "path") || "#{prefix}.xml" + end + + # Returns a hash representing all collections to be processed and their metadata + # in the form of { collection_name => { categories = [...], path = "..." } } + def collections + return @collections if defined?(@collections) + + @collections = case config["collections"] + when Array + config["collections"].map { |c| [c, {}] }.to_h + when Hash + config["collections"] + else + {} + end + + @collections = normalize_posts_meta(@collections) + @collections.each_value do |meta| + meta["categories"] = (meta["categories"] || []).to_set + end + + @collections + end + + def generate_feed_by_tag + tags_config = config["tags"] + tags_config = {} unless tags_config.is_a?(Hash) + + except = tags_config["except"] || [] + only = tags_config["only"] || @site.tags.keys + tags_pool = only - except + tags_path = tags_config["path"] || "/feed/by_tag/" + + generate_tag_feed(tags_pool, tags_path) + end + + def generate_tag_feed(tags_pool, tags_path) + tags_pool.each do |tag| + # allow only tags with basic alphanumeric characters and underscore to keep + # feed path simple. + next if %r![^a-zA-Z0-9_]!.match?(tag) + + Jekyll.logger.info "Jekyll Feed:", "Generating feed for posts tagged #{tag}" + path = "#{tags_path}#{tag}.xml" + next if file_exists?(path) + + @site.pages << make_page(path, :tags => tag) + end + end + + # Path to feed.xml template file + def feed_source_path + @feed_source_path ||= File.expand_path "feed.xml", __dir__ + end + + def feed_template + @feed_template ||= File.read(feed_source_path).gsub(MINIFY_REGEX, "") + end + + # Checks if a file already exists in the site source + def file_exists?(file_path) + File.exist? @site.in_source_dir(file_path) + end + + # Generates contents for a file + + def make_page(file_path, collection: "posts", category: nil, tags: nil) + PageWithoutAFile.new(@site, __dir__, "", file_path).tap do |file| + file.content = feed_template + file.data.merge!( + "layout" => nil, + "sitemap" => false, + "xsl" => file_exists?("feed.xslt.xml"), + "collection" => collection, + "category" => category, + "tags" => tags + ) + file.output + end + end + + # Special case the "posts" collection, which, for ease of use and backwards + # compatability, can be configured via top-level keys or directly as a collection + def normalize_posts_meta(hash) + hash["posts"] ||= {} + hash["posts"]["path"] ||= config["path"] + hash["posts"]["categories"] ||= config["categories"] + config["path"] ||= hash["posts"]["path"] + hash + end + + def disabled_in_development? + config && config["disable_in_development"] && Jekyll.env == "development" + end + end +end diff --git a/vendor/bundle/ruby/3.4.0/gems/jekyll-feed-0.17.0/lib/jekyll-feed/meta-tag.rb b/vendor/bundle/ruby/3.4.0/gems/jekyll-feed-0.17.0/lib/jekyll-feed/meta-tag.rb new file mode 100644 index 0000000..d143c72 --- /dev/null +++ b/vendor/bundle/ruby/3.4.0/gems/jekyll-feed-0.17.0/lib/jekyll-feed/meta-tag.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module JekyllFeed + class MetaTag < Liquid::Tag + # Use Jekyll's native relative_url filter + include Jekyll::Filters::URLFilters + + def render(context) + # Jekyll::Filters::URLFilters requires `@context` to be set in the environment. + @context = context + + config = context.registers[:site].config + path = config.dig("feed", "path") || "feed.xml" + title = config["title"] || config["name"] + + attributes = { + :type => "application/atom+xml", + :rel => "alternate", + :href => absolute_url(path), + } + attributes[:title] = title if title + + attrs = attributes.map { |k, v| "#{k}=#{v.to_s.encode(:xml => :attr)}" }.join(" ") + "" + end + end +end diff --git a/vendor/bundle/ruby/3.4.0/gems/jekyll-feed-0.17.0/lib/jekyll-feed/page-without-a-file.rb b/vendor/bundle/ruby/3.4.0/gems/jekyll-feed-0.17.0/lib/jekyll-feed/page-without-a-file.rb new file mode 100644 index 0000000..b7d3278 --- /dev/null +++ b/vendor/bundle/ruby/3.4.0/gems/jekyll-feed-0.17.0/lib/jekyll-feed/page-without-a-file.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module JekyllFeed + class PageWithoutAFile < Jekyll::Page + def read_yaml(*) + @data ||= {} + end + end +end diff --git a/vendor/bundle/ruby/3.4.0/gems/jekyll-feed-0.17.0/lib/jekyll-feed/version.rb b/vendor/bundle/ruby/3.4.0/gems/jekyll-feed-0.17.0/lib/jekyll-feed/version.rb new file mode 100644 index 0000000..dbaf1b2 --- /dev/null +++ b/vendor/bundle/ruby/3.4.0/gems/jekyll-feed-0.17.0/lib/jekyll-feed/version.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Jekyll + module Feed + VERSION = "0.17.0" + end +end -- cgit v1.2.3