Add bin and edit workflow
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 9s

This commit is contained in:
2026-09-16 13:11:16 -06:00
parent c8ac4fcae5
commit 4cee170d66
17576 changed files with 895740 additions and 2 deletions
@@ -0,0 +1,52 @@
# frozen_string_literal: true
module Jekyll
class RelatedPosts
class << self
attr_accessor :lsi
end
attr_reader :post, :site
def initialize(post)
@post = post
@site = post.site
Jekyll::External.require_with_graceful_fail("classifier-reborn") if site.lsi
end
def build
return [] unless site.posts.docs.size > 1
if site.lsi
build_index
lsi_related_posts
else
most_recent_posts
end
end
def build_index
self.class.lsi ||= begin
lsi = ClassifierReborn::LSI.new(:auto_rebuild => false)
Jekyll.logger.info("Populating LSI...")
site.posts.docs.each do |x|
lsi.add_item(x)
end
Jekyll.logger.info("Rebuilding index...")
lsi.build_index
Jekyll.logger.info("")
lsi
end
end
def lsi_related_posts
self.class.lsi.find_related(post, 11)
end
def most_recent_posts
@most_recent_posts ||= (site.posts.docs.last(11).reverse! - [post]).first(10)
end
end
end