repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/plugin_manager.rb | lib/jekyll/plugin_manager.rb | # frozen_string_literal: true
module Jekyll
class PluginManager
attr_reader :site
# Create an instance of this class.
#
# site - the instance of Jekyll::Site we're concerned with
#
# Returns nothing
def initialize(site)
@site = site
end
# Require all the plugins which are ... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/version.rb | lib/jekyll/version.rb | # frozen_string_literal: true
module Jekyll
VERSION = "4.4.1"
end
| ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/static_file.rb | lib/jekyll/static_file.rb | # frozen_string_literal: true
module Jekyll
class StaticFile
extend Forwardable
attr_reader :relative_path, :extname,
:type, # Returns the type of the collection if present, nil otherwise.
:name
def_delegator :to_liquid, :to_json, :to_json
class << self
# The ... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/errors.rb | lib/jekyll/errors.rb | # frozen_string_literal: true
module Jekyll
module Errors
FatalException = Class.new(::RuntimeError)
InvalidThemeName = Class.new(FatalException)
DropMutationException = Class.new(FatalException)
InvalidPermalinkError = Class.new(FatalException)
InvalidYAMLFrontMatterError = Class.n... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/converter.rb | lib/jekyll/converter.rb | # frozen_string_literal: true
module Jekyll
class Converter < Plugin
# Public: Get or set the highlighter prefix. When an argument is specified,
# the prefix will be set. If no argument is specified, the current prefix
# will be returned.
#
# highlighter_prefix - The String prefix (default: nil).... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/profiler.rb | lib/jekyll/profiler.rb | # frozen_string_literal: true
module Jekyll
class Profiler
TERMINAL_TABLE_STYLES = {
:alignment => :right,
:border_top => false,
:border_bottom => false,
}.freeze
private_constant :TERMINAL_TABLE_STYLES
def self.tabulate(table_rows)
require "terminal-table"
rows... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/hooks.rb | lib/jekyll/hooks.rb | # frozen_string_literal: true
module Jekyll
module Hooks
DEFAULT_PRIORITY = 20
# compatibility layer for octopress-hooks users
PRIORITY_MAP = {
:low => 10,
:normal => 20,
:high => 30,
}.freeze
# initial empty hooks
@registry = {
:site => {
:after_in... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/theme.rb | lib/jekyll/theme.rb | # frozen_string_literal: true
module Jekyll
class Theme
extend Forwardable
attr_reader :name
def_delegator :gemspec, :version, :version
def initialize(name)
@name = name.downcase.strip
Jekyll.logger.debug "Theme:", name
Jekyll.logger.debug "Theme source:", root
end
def ... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/page_excerpt.rb | lib/jekyll/page_excerpt.rb | # frozen_string_literal: true
module Jekyll
class PageExcerpt < Excerpt
attr_reader :doc
alias_method :id, :relative_path
EXCERPT_ATTRIBUTES = (Page::ATTRIBUTES_FOR_LIQUID - %w(excerpt)).freeze
private_constant :EXCERPT_ATTRIBUTES
def to_liquid
@to_liquid ||= doc.to_liquid(EXCERPT_ATTRIBU... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/page.rb | lib/jekyll/page.rb | # frozen_string_literal: true
module Jekyll
class Page
include Convertible
attr_writer :dir
attr_accessor :basename, :content, :data, :ext, :name, :output, :pager, :site
alias_method :extname, :ext
# Attributes for Liquid templates
ATTRIBUTES_FOR_LIQUID = %w(
content
dir
... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/publisher.rb | lib/jekyll/publisher.rb | # frozen_string_literal: true
module Jekyll
class Publisher
def initialize(site)
@site = site
end
def publish?(thing)
can_be_published?(thing) && !hidden_in_the_future?(thing)
end
def hidden_in_the_future?(thing)
thing.respond_to?(:date) && !@site.future && thing.date.to_i > @... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/utils.rb | lib/jekyll/utils.rb | # frozen_string_literal: true
module Jekyll
module Utils
extend self
autoload :Ansi, "jekyll/utils/ansi"
autoload :Exec, "jekyll/utils/exec"
autoload :Internet, "jekyll/utils/internet"
autoload :Platforms, "jekyll/utils/platforms"
autoload :ThreadEvent, "jekyll/utils/thread_event"
autoloa... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/reader.rb | lib/jekyll/reader.rb | # frozen_string_literal: true
module Jekyll
class Reader
attr_reader :site
def initialize(site)
@site = site
end
# Read Site data from disk and load it into internal data structures.
#
# Returns nothing.
def read
@site.layouts = LayoutReader.new(site).read
read_directo... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/plugin.rb | lib/jekyll/plugin.rb | # frozen_string_literal: true
module Jekyll
class Plugin
PRIORITIES = {
:low => -10,
:highest => 100,
:lowest => -100,
:normal => 0,
:high => 10,
}.freeze
#
def self.inherited(const)
catch_inheritance(const) do |const_|
catch_inheritance(const_)
... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/cleaner.rb | lib/jekyll/cleaner.rb | # frozen_string_literal: true
module Jekyll
# Handles the cleanup of a site's destination before it is built.
class Cleaner
HIDDEN_FILE_REGEX = %r!/\.{1,2}$!.freeze
attr_reader :site
def initialize(site)
@site = site
end
# Cleans up the site's destination directory
def cleanup!
... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/related_posts.rb | lib/jekyll/related_posts.rb | # 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 buil... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/theme_builder.rb | lib/jekyll/theme_builder.rb | # frozen_string_literal: true
module Jekyll
class ThemeBuilder
SCAFFOLD_DIRECTORIES = %w(
assets _data _layouts _includes _sass
).freeze
attr_reader :name, :path, :code_of_conduct
def initialize(theme_name, opts)
@name = theme_name.to_s.tr(" ", "_").squeeze("_")
@path = Pathname.n... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/stevenson.rb | lib/jekyll/stevenson.rb | # frozen_string_literal: true
module Jekyll
class Stevenson < ::Logger
def initialize
formatter = proc do |_, _, _, msg|
msg.to_s
end
super($stdout, :formatter => formatter)
end
def add(severity, message = nil, progname = nil)
severity ||= UNKNOWN
@logdev = logdevic... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/url.rb | lib/jekyll/url.rb | # frozen_string_literal: true
# Public: Methods that generate a URL for a resource such as a Post or a Page.
#
# Examples
#
# URL.new({
# :template => /:categories/:title.html",
# :placeholders => {:categories => "ruby", :title => "something"}
# }).to_s
#
module Jekyll
class URL
# options - One of :p... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/configuration.rb | lib/jekyll/configuration.rb | # frozen_string_literal: true
module Jekyll
class Configuration < Hash
# Default options. Overridden by values in _config.yml.
# Strings rather than symbols are used for compatibility with YAML.
DEFAULTS = {
# Where things are
"source" => Dir.pwd,
"destination" => F... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/page_without_a_file.rb | lib/jekyll/page_without_a_file.rb | # frozen_string_literal: true
module Jekyll
# A Jekyll::Page subclass to handle processing files without reading it to
# determine the page-data and page-content based on Front Matter delimiters.
#
# The class instance is basically just a bare-bones entity with just
# attributes "dir", "name", "path", "url" ... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/regenerator.rb | lib/jekyll/regenerator.rb | # frozen_string_literal: true
module Jekyll
class Regenerator
attr_reader :site, :metadata, :cache
attr_accessor :disabled
private :disabled, :disabled=
def initialize(site)
@site = site
# Read metadata from file
read_metadata
# Initialize cache to an empty hash
clear... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/liquid_extensions.rb | lib/jekyll/liquid_extensions.rb | # frozen_string_literal: true
module Jekyll
module LiquidExtensions
# Lookup a Liquid variable in the given context.
#
# context - the Liquid context in question.
# variable - the variable name, as a string.
#
# Returns the value of the variable in the context
# or the variable name if... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/entry_filter.rb | lib/jekyll/entry_filter.rb | # frozen_string_literal: true
module Jekyll
class EntryFilter
attr_reader :site
SPECIAL_LEADING_CHAR_REGEX = %r!\A#{Regexp.union([".", "_", "#", "~"])}!o.freeze
def initialize(site, base_directory = nil)
@site = site
@base_directory = derive_base_directory(
@site, base_directory.to_... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/inclusion.rb | lib/jekyll/inclusion.rb | # frozen_string_literal: true
module Jekyll
class Inclusion
attr_reader :site, :name, :path
private :site
def initialize(site, base, name)
@site = site
@name = name
@path = PathManager.join(base, name)
end
def render(context)
@template ||= site.liquid_renderer.file(path)... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/renderer.rb | lib/jekyll/renderer.rb | # frozen_string_literal: true
module Jekyll
class Renderer
attr_reader :document, :site
attr_writer :layouts, :payload
def initialize(site, document, site_payload = nil)
@site = site
@document = document
@payload = site_payload
@layouts = nil
end
# Fetches the payl... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/generator.rb | lib/jekyll/generator.rb | # frozen_string_literal: true
module Jekyll
Generator = Class.new(Plugin)
end
| ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/filters.rb | lib/jekyll/filters.rb | # frozen_string_literal: true
require_all "jekyll/filters"
module Jekyll
module Filters
include URLFilters
include GroupingFilters
include DateFilters
# Convert a Markdown string into HTML output.
#
# input - The Markdown String to convert.
#
# Returns the HTML formatted String.
... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/frontmatter_defaults.rb | lib/jekyll/frontmatter_defaults.rb | # frozen_string_literal: true
module Jekyll
# This class handles custom defaults for YAML frontmatter settings.
# These are set in _config.yml and apply both to internal use (e.g. layout)
# and the data available to liquid.
#
# It is exposed via the frontmatter_defaults method on the site class.
class Fron... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/deprecator.rb | lib/jekyll/deprecator.rb | # frozen_string_literal: true
module Jekyll
module Deprecator
extend self
def process(args)
arg_is_present? args, "--server", "The --server command has been replaced by the \
'serve' subcommand."
arg_is_present? args, "--serve", "The --serve command has been replaced by... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/excerpt.rb | lib/jekyll/excerpt.rb | # frozen_string_literal: true
module Jekyll
class Excerpt
extend Forwardable
attr_accessor :content, :doc, :ext
attr_writer :output
def_delegators :@doc,
:site, :name, :ext, :extname,
:collection, :related_posts, :type,
:coffeescript_file?,... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/log_adapter.rb | lib/jekyll/log_adapter.rb | # frozen_string_literal: true
module Jekyll
class LogAdapter
attr_reader :writer, :messages, :level
LOG_LEVELS = {
:debug => ::Logger::DEBUG,
:info => ::Logger::INFO,
:warn => ::Logger::WARN,
:error => ::Logger::ERROR,
}.freeze
# Public: Create a new instance of a log writ... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/layout.rb | lib/jekyll/layout.rb | # frozen_string_literal: true
module Jekyll
class Layout
include Convertible
attr_accessor :content, # content of layout
:data, # the Hash that holds the metadata for this layout
:ext # extension of layout
attr_reader :name, # name of layout
:... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/path_manager.rb | lib/jekyll/path_manager.rb | # frozen_string_literal: true
module Jekyll
# A singleton class that caches frozen instances of path strings returned from its methods.
#
# NOTE:
# This class exists because `File.join` allocates an Array and returns a new String on every
# call using **the same arguments**. Caching the result means redu... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/cache.rb | lib/jekyll/cache.rb | # frozen_string_literal: true
require "digest"
module Jekyll
class Cache
# class-wide base cache
@base_cache = {}
# class-wide directive to write cache to disk is enabled by default
@disk_cache_enabled = true
class << self
attr_accessor :cache_dir # class-wide cache location
attr_... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/document.rb | lib/jekyll/document.rb | # frozen_string_literal: true
module Jekyll
class Document
include Comparable
extend Forwardable
attr_reader :path, :site, :extname, :collection, :type
attr_accessor :content, :output
def_delegator :self, :read_post_data, :post_read
YAML_FRONT_MATTER_REGEXP = %r!\A(---\s*\n.*?\n?)^((---|\.... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/site.rb | lib/jekyll/site.rb | # frozen_string_literal: true
module Jekyll
class Site
attr_accessor :baseurl, :converters, :data, :drafts, :exclude,
:file_read_opts, :future, :gems, :generators, :highlighter,
:include, :inclusions, :keep_files, :layouts, :limit_posts,
:lsi, :pages, :permal... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/converters/identity.rb | lib/jekyll/converters/identity.rb | # frozen_string_literal: true
module Jekyll
module Converters
# Identity converter. Returns same content as given.
# For more info on converters see https://jekyllrb.com/docs/plugins/converters/
class Identity < Converter
safe true
priority :lowest
# Public: Does the given extension m... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/converters/markdown.rb | lib/jekyll/converters/markdown.rb | # frozen_string_literal: true
module Jekyll
module Converters
# Markdown converter.
# For more info on converters see https://jekyllrb.com/docs/plugins/converters/
class Markdown < Converter
highlighter_prefix "\n"
highlighter_suffix "\n"
safe true
def setup
return if @se... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/converters/smartypants.rb | lib/jekyll/converters/smartypants.rb | # frozen_string_literal: true
module Kramdown
module Parser
class SmartyPants < Kramdown::Parser::Kramdown
def initialize(source, options)
super
@block_parsers = [:block_html, :content]
@span_parsers = [:smart_quotes, :html_entity, :typographic_syms, :span_html]
end
de... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/converters/markdown/kramdown_parser.rb | lib/jekyll/converters/markdown/kramdown_parser.rb | # frozen_string_literal: true
module Kramdown
# A Kramdown::Document subclass meant to optimize memory usage from initializing
# a kramdown document for parsing.
#
# The optimization is by using the same options Hash (and its derivatives) for
# converting all Markdown documents in a Jekyll site.
class Jeky... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/liquid_renderer/table.rb | lib/jekyll/liquid_renderer/table.rb | # frozen_string_literal: true
module Jekyll
class LiquidRenderer
class Table
GAUGES = [:count, :bytes, :time].freeze
def initialize(stats)
@stats = stats
end
def to_s(num_of_rows = 50)
Jekyll::Profiler.tabulate(data_for_table(num_of_rows))
end
private
... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/liquid_renderer/file.rb | lib/jekyll/liquid_renderer/file.rb | # frozen_string_literal: true
module Jekyll
class LiquidRenderer
class File
def initialize(renderer, filename)
@renderer = renderer
@filename = filename
end
def parse(content)
measure_time do
@renderer.cache[@filename] ||= Liquid::Template.parse(content, :line... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/commands/serve.rb | lib/jekyll/commands/serve.rb | # frozen_string_literal: true
module Jekyll
module Commands
class Serve < Command
# Similar to the pattern in Utils::ThreadEvent except we are maintaining the
# state of @running instead of just signaling an event. We have to maintain this
# state since Serve is just called via class methods i... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/commands/clean.rb | lib/jekyll/commands/clean.rb | # frozen_string_literal: true
module Jekyll
module Commands
class Clean < Command
class << self
def init_with_program(prog)
prog.command(:clean) do |c|
c.syntax "clean [subcommand]"
c.description "Clean the site (removes site output and metadata file) without build... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/commands/doctor.rb | lib/jekyll/commands/doctor.rb | # frozen_string_literal: true
module Jekyll
module Commands
class Doctor < Command
class << self
def init_with_program(prog)
prog.command(:doctor) do |c|
c.syntax "doctor"
c.description "Search site and print specific deprecation warnings"
c.alias(:hyde... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/commands/build.rb | lib/jekyll/commands/build.rb | # frozen_string_literal: true
module Jekyll
module Commands
class Build < Command
class << self
# Create the Mercenary command for the Jekyll CLI for this Command
def init_with_program(prog)
prog.command(:build) do |c|
c.syntax "build [options]"
c.desc... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/commands/new.rb | lib/jekyll/commands/new.rb | # frozen_string_literal: true
require "erb"
module Jekyll
module Commands
class New < Command
class << self
def init_with_program(prog)
prog.command(:new) do |c|
c.syntax "new PATH"
c.description "Creates a new Jekyll site scaffold in PATH"
c.option "... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/commands/help.rb | lib/jekyll/commands/help.rb | # frozen_string_literal: true
module Jekyll
module Commands
class Help < Command
class << self
def init_with_program(prog)
prog.command(:help) do |c|
c.syntax "help [subcommand]"
c.description "Show the help message, optionally for a given subcommand."
... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/commands/new_theme.rb | lib/jekyll/commands/new_theme.rb | # frozen_string_literal: true
require "erb"
module Jekyll
module Commands
class NewTheme < Jekyll::Command
class << self
def init_with_program(prog)
prog.command(:"new-theme") do |c|
c.syntax "new-theme NAME"
c.description "Creates a new Jekyll theme scaffold"
... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/commands/serve/websockets.rb | lib/jekyll/commands/serve/websockets.rb | # frozen_string_literal: true
require "http/parser"
module Jekyll
module Commands
class Serve
# The LiveReload protocol requires the server to serve livereload.js over HTTP
# despite the fact that the protocol itself uses WebSockets. This custom connection
# class addresses the dual protocols... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/commands/serve/live_reload_reactor.rb | lib/jekyll/commands/serve/live_reload_reactor.rb | # frozen_string_literal: true
require "em-websocket"
require_relative "websockets"
module Jekyll
module Commands
class Serve
class LiveReloadReactor
attr_reader :started_event, :stopped_event, :thread
def initialize
@websockets = []
@connections_count = 0
@s... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/commands/serve/servlet.rb | lib/jekyll/commands/serve/servlet.rb | # frozen_string_literal: true
require "webrick"
module Jekyll
module Commands
class Serve
# This class is used to determine if the Servlet should modify a served file
# to insert the LiveReload script tags
class SkipAnalyzer
BAD_USER_AGENTS = [%r!MSIE!].freeze
def self.skip_pr... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/tags/include.rb | lib/jekyll/tags/include.rb | # frozen_string_literal: true
module Jekyll
module Tags
class IncludeTag < Liquid::Tag
VALID_SYNTAX = %r!
([\w-]+)\s*=\s*
(?:"([^"\\]*(?:\\.[^"\\]*)*)"|'([^'\\]*(?:\\.[^'\\]*)*)'|([\w.-]+))
!x.freeze
VARIABLE_SYNTAX = %r!
(?<variable>[^{]*(\{\{\s*[\w\-.]+\s*(\|.*)?\}\}[^... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/tags/post_url.rb | lib/jekyll/tags/post_url.rb | # frozen_string_literal: true
module Jekyll
module Tags
class PostComparer
# Deprecated (soft; No interpreter warnings).
# To be removed in v5.0.
# Use private constant `POST_PATH_MATCHER` instead.
MATCHER = %r!^(.+/)*(\d+-\d+-\d+)-(.*)$!.freeze
POST_PATH_MATCHER = %r!\A(.+/)*?(\d{... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/tags/link.rb | lib/jekyll/tags/link.rb | # frozen_string_literal: true
module Jekyll
module Tags
class Link < Liquid::Tag
include Jekyll::Filters::URLFilters
class << self
def tag_name
name.split("::").last.downcase
end
end
def initialize(tag_name, relative_path, tokens)
super
@relati... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/tags/highlight.rb | lib/jekyll/tags/highlight.rb | # frozen_string_literal: true
module Jekyll
module Tags
class HighlightBlock < Liquid::Block
include Liquid::StandardFilters
# The regular expression syntax checker. Start with the language specifier.
# Follow that by zero or more space separated options that take one of three
# forms: n... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/utils/win_tz.rb | lib/jekyll/utils/win_tz.rb | # frozen_string_literal: true
module Jekyll
module Utils
module WinTZ
extend self
# Public: Calculate the Timezone for Windows when the config file has a defined
# 'timezone' key.
#
# timezone - the IANA Time Zone specified in "_config.yml"
#
# Returns a string ... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/utils/exec.rb | lib/jekyll/utils/exec.rb | # frozen_string_literal: true
require "open3"
module Jekyll
module Utils
module Exec
extend self
# Runs a program in a sub-shell.
#
# *args - a list of strings containing the program name and arguments
#
# Returns a Process::Status and a String of output in an array in
... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/utils/thread_event.rb | lib/jekyll/utils/thread_event.rb | # frozen_string_literal: true
module Jekyll
module Utils
# Based on the pattern and code from
# https://emptysqua.re/blog/an-event-synchronization-primitive-for-ruby/
class ThreadEvent
attr_reader :flag
def initialize
@lock = Mutex.new
@cond = ConditionVariable.new
@f... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/utils/ansi.rb | lib/jekyll/utils/ansi.rb | # frozen_string_literal: true
module Jekyll
module Utils
module Ansi
extend self
ESCAPE = format("%c", 27)
MATCH = %r!#{ESCAPE}\[(?:\d+)(?:;\d+)*(j|k|m|s|u|A|B|G)|\e\(B\e\[m!ix.freeze
COLORS = {
:red => 31,
:green => 32,
:black => 30,
:magenta => 3... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/utils/platforms.rb | lib/jekyll/utils/platforms.rb | # frozen_string_literal: true
module Jekyll
module Utils
module Platforms
extend self
def jruby?
RUBY_ENGINE == "jruby"
end
def mri?
RUBY_ENGINE == "ruby"
end
def windows?
vanilla_windows? || bash_on_windows?
end
# Not a Windows Subsyste... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/utils/internet.rb | lib/jekyll/utils/internet.rb | # frozen_string_literal: true
module Jekyll
module Utils
module Internet
# Public: Determine whether the present device has a connection to
# the Internet. This allows plugin writers which require the outside
# world to have a neat fallback mechanism for offline building.
#
# Exampl... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/drops/static_file_drop.rb | lib/jekyll/drops/static_file_drop.rb | # frozen_string_literal: true
module Jekyll
module Drops
class StaticFileDrop < Drop
extend Forwardable
delegate_methods :name, :extname, :modified_time, :basename
delegate_method_as :relative_path, :path
delegate_method_as :type, :collection
private delegate_method_as :data, :fa... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/drops/document_drop.rb | lib/jekyll/drops/document_drop.rb | # frozen_string_literal: true
module Jekyll
module Drops
class DocumentDrop < Drop
extend Forwardable
NESTED_OBJECT_FIELD_BLACKLIST = %w(
content output excerpt next previous
).freeze
mutable false
delegate_method_as :relative_path, :path
private delegate_method_as ... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/drops/excerpt_drop.rb | lib/jekyll/drops/excerpt_drop.rb | # frozen_string_literal: true
module Jekyll
module Drops
class ExcerptDrop < DocumentDrop
def layout
@obj.doc.data["layout"]
end
def date
@obj.doc.date
end
def excerpt
nil
end
def name
@obj.doc.data["name"] || @obj.doc.basename
en... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/drops/collection_drop.rb | lib/jekyll/drops/collection_drop.rb | # frozen_string_literal: true
module Jekyll
module Drops
class CollectionDrop < Drop
extend Forwardable
mutable false
delegate_method_as :write?, :output
delegate_methods :label, :docs, :files, :directory, :relative_directory
private delegate_method_as :metadata, :fallback_data
... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/drops/drop.rb | lib/jekyll/drops/drop.rb | # frozen_string_literal: true
module Jekyll
module Drops
class Drop < Liquid::Drop
include Enumerable
NON_CONTENT_METHODS = [:fallback_data, :collapse_document].freeze
NON_CONTENT_METHOD_NAMES = NON_CONTENT_METHODS.map(&:to_s).freeze
private_constant :NON_CONTENT_METHOD_NAMES
# A ... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/drops/unified_payload_drop.rb | lib/jekyll/drops/unified_payload_drop.rb | # frozen_string_literal: true
module Jekyll
module Drops
class UnifiedPayloadDrop < Drop
mutable true
attr_accessor :content, :page, :layout, :paginator,
:highlighter_prefix, :highlighter_suffix
def jekyll
JekyllDrop.global
end
def site
@site_d... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/drops/url_drop.rb | lib/jekyll/drops/url_drop.rb | # frozen_string_literal: true
module Jekyll
module Drops
class UrlDrop < Drop
extend Forwardable
mutable false
delegate_method :output_ext
delegate_method_as :cleaned_relative_path, :path
def collection
@obj.collection.label
end
def name
Utils.slugify... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/drops/site_drop.rb | lib/jekyll/drops/site_drop.rb | # frozen_string_literal: true
module Jekyll
module Drops
class SiteDrop < Drop
extend Forwardable
mutable false
delegate_method_as :site_data, :data
delegate_methods :time, :pages, :static_files, :tags, :categories
private delegate_method_as :config, :fallback_data
def [](... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/drops/jekyll_drop.rb | lib/jekyll/drops/jekyll_drop.rb | # frozen_string_literal: true
module Jekyll
module Drops
class JekyllDrop < Liquid::Drop
class << self
def global
@global ||= JekyllDrop.new
end
end
def version
Jekyll::VERSION
end
def environment
Jekyll.env
end
def to_h
... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/drops/theme_drop.rb | lib/jekyll/drops/theme_drop.rb | # frozen_string_literal: true
module Jekyll
module Drops
class ThemeDrop < Drop
delegate_method_as :runtime_dependencies, :dependencies
def root
@root ||= ENV["JEKYLL_ENV"] == "development" ? @obj.root : ""
end
def authors
@authors ||= gemspec.authors.join(", ")
en... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/readers/static_file_reader.rb | lib/jekyll/readers/static_file_reader.rb | # frozen_string_literal: true
module Jekyll
class StaticFileReader
attr_reader :site, :dir, :unfiltered_content
def initialize(site, dir)
@site = site
@dir = dir
@unfiltered_content = []
end
# Create a new StaticFile object for every entry in a given list of basenames.
#
#... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/readers/theme_assets_reader.rb | lib/jekyll/readers/theme_assets_reader.rb | # frozen_string_literal: true
module Jekyll
class ThemeAssetsReader
attr_reader :site
def initialize(site)
@site = site
end
def read
return unless site.theme&.assets_path
Find.find(site.theme.assets_path) do |path|
next if File.directory?(path)
if File.symlink?(p... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/readers/layout_reader.rb | lib/jekyll/readers/layout_reader.rb | # frozen_string_literal: true
module Jekyll
class LayoutReader
attr_reader :site
def initialize(site)
@site = site
@layouts = {}
end
def read
layout_entries.each do |layout_file|
@layouts[layout_name(layout_file)] = \
Layout.new(site, layout_directory, layout_fil... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/readers/collection_reader.rb | lib/jekyll/readers/collection_reader.rb | # frozen_string_literal: true
module Jekyll
class CollectionReader
SPECIAL_COLLECTIONS = %w(posts data).freeze
attr_reader :site, :content
def initialize(site)
@site = site
@content = {}
end
# Read in all collections specified in the configuration
#
# Returns nothing.
d... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/readers/data_reader.rb | lib/jekyll/readers/data_reader.rb | # frozen_string_literal: true
module Jekyll
class DataReader
attr_reader :site, :content
def initialize(site, in_source_dir: nil)
@site = site
@content = {}
@entry_filter = EntryFilter.new(site)
@in_source_dir = in_source_dir || @site.method(:in_source_dir)
@source_dir = @in_so... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/readers/page_reader.rb | lib/jekyll/readers/page_reader.rb | # frozen_string_literal: true
module Jekyll
class PageReader
attr_reader :site, :dir, :unfiltered_content
def initialize(site, dir)
@site = site
@dir = dir
@unfiltered_content = []
end
# Create a new `Jekyll::Page` object for each entry in a given array.
#
# files - An arr... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/readers/post_reader.rb | lib/jekyll/readers/post_reader.rb | # frozen_string_literal: true
module Jekyll
class PostReader
attr_reader :site, :unfiltered_content
def initialize(site)
@site = site
end
# Read all the files in <source>/<dir>/_drafts and create a new
# Document object with each one.
#
# dir - The String relative path of the dire... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/filters/url_filters.rb | lib/jekyll/filters/url_filters.rb | # frozen_string_literal: true
module Jekyll
module Filters
module URLFilters
# Produces an absolute URL based on site.url and site.baseurl.
#
# input - the URL to make absolute.
#
# Returns the absolute URL as a String.
def absolute_url(input)
return if input.nil?
... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/filters/date_filters.rb | lib/jekyll/filters/date_filters.rb | # frozen_string_literal: true
module Jekyll
module Filters
module DateFilters
# Format a date in short format e.g. "27 Jan 2011".
# Ordinal format is also supported, in both the UK
# (e.g. "27th Jan 2011") and US ("e.g. Jan 27th, 2011") formats.
# UK format is the default.
#
#... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
jekyll/jekyll | https://github.com/jekyll/jekyll/blob/4d3db3a83d8eaa2a844bef3f6222fd30b987af05/lib/jekyll/filters/grouping_filters.rb | lib/jekyll/filters/grouping_filters.rb | # frozen_string_literal: true
module Jekyll
module Filters
module GroupingFilters
# Group an array of items by a property
#
# input - the inputted Enumerable
# property - the property
#
# Returns an array of Hashes, each looking something like this:
# {"name" => "larry... | ruby | MIT | 4d3db3a83d8eaa2a844bef3f6222fd30b987af05 | 2026-01-04T15:37:27.237281Z | false |
middleman/middleman | https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/gem_rake_helper.rb | gem_rake_helper.rb | require 'rake'
require 'yard'
require 'bundler/gem_tasks'
require 'cucumber/rake/task'
Cucumber::Rake::Task.new do |t|
exempt_tags = ["--tags 'not @wip'"]
exempt_tags << "--tags 'not @nojava'" if RUBY_PLATFORM == 'java'
exempt_tags << "--tags 'not @encoding'" unless Object.const_defined?(:Encoding)
exempt_tag... | ruby | MIT | b497703afb715044bc5cfcd5616bd3825323505b | 2026-01-04T15:39:40.166212Z | false |
middleman/middleman | https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-cli/fixtures/preview-server-hook-app/config.rb | middleman-cli/fixtures/preview-server-hook-app/config.rb | set :layout, false
class MyFeature < Middleman::Extension
def initialize(app, options_hash = {}, &block)
super
app.before_server do |server_information|
puts "/// #{server_information.listeners.first} ///"
puts "/// #{server_information.port} ///"
puts "/// #{server_information.server_name... | ruby | MIT | b497703afb715044bc5cfcd5616bd3825323505b | 2026-01-04T15:39:40.166212Z | false |
middleman/middleman | https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-cli/fixtures/preview-server-app/config.rb | middleman-cli/fixtures/preview-server-app/config.rb | ruby | MIT | b497703afb715044bc5cfcd5616bd3825323505b | 2026-01-04T15:39:40.166212Z | false | |
middleman/middleman | https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-cli/fixtures/preview-server-app/bin/dns_server.rb | middleman-cli/fixtures/preview-server-app/bin/dns_server.rb | #!/usr/bin/env ruby
require 'rubydns'
require 'psych'
db_file = ARGV[0]
port = ARGV[1] || 5300
db = if File.file? db_file
$stderr.puts 'Found dns db'
Psych.load_file(db_file)
else
$stderr.puts 'Found no dns db. Use default db.'
{
/www\.example\.org/ => '1.1.1.1'
... | ruby | MIT | b497703afb715044bc5cfcd5616bd3825323505b | 2026-01-04T15:39:40.166212Z | false |
middleman/middleman | https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-cli/features/support/env.rb | middleman-cli/features/support/env.rb | ENV["TEST"] = "true"
require 'sassc'
require 'simplecov'
SimpleCov.root(File.expand_path(File.dirname(__FILE__) + '/../..'))
SimpleCov.start
PROJECT_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__)))
require File.join(PROJECT_ROOT_PATH, 'lib', 'middleman-cli')
require File.join(File.dirname(PROJECT_ROOT... | ruby | MIT | b497703afb715044bc5cfcd5616bd3825323505b | 2026-01-04T15:39:40.166212Z | false |
middleman/middleman | https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-cli/lib/middleman-cli.rb | middleman-cli/lib/middleman-cli.rb | # Setup our load paths
libdir = File.expand_path(File.dirname(__FILE__))
$LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
# Require Thor since that's what the whole CLI is built around
require 'thor'
# CLI Module
module Middleman::Cli
# The base task from which everything else extends
class Base < ::... | ruby | MIT | b497703afb715044bc5cfcd5616bd3825323505b | 2026-01-04T15:39:40.166212Z | false |
middleman/middleman | https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-cli/lib/middleman-cli/build.rb | middleman-cli/lib/middleman-cli/build.rb | require 'middleman-core/application'
# CLI Module
module Middleman::Cli
# The CLI Build class
class Build < Thor::Group
include Thor::Actions
check_unknown_options!
class_option :environment,
aliases: '-e',
default: ENV['MM_ENV'] || ENV['RACK_ENV'] || :production
... | ruby | MIT | b497703afb715044bc5cfcd5616bd3825323505b | 2026-01-04T15:39:40.166212Z | false |
middleman/middleman | https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-cli/lib/middleman-cli/console.rb | middleman-cli/lib/middleman-cli/console.rb | # CLI Module
module Middleman::Cli
# The CLI Console class
class Console < Thor::Group
include Thor::Actions
check_unknown_options!
class_option :environment,
aliases: '-e',
default: ENV['MM_ENV'] || ENV['RACK_ENV'] || 'development',
desc: 'The enviro... | ruby | MIT | b497703afb715044bc5cfcd5616bd3825323505b | 2026-01-04T15:39:40.166212Z | false |
middleman/middleman | https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-cli/lib/middleman-cli/config.rb | middleman-cli/lib/middleman-cli/config.rb | # CLI Module
module Middleman::Cli
# The CLI Config class
class Config < Thor::Group
include Thor::Actions
check_unknown_options!
class_option :environment,
aliases: '-e',
default: ENV['MM_ENV'] || ENV['RACK_ENV'] || 'development',
desc: 'The environm... | ruby | MIT | b497703afb715044bc5cfcd5616bd3825323505b | 2026-01-04T15:39:40.166212Z | false |
middleman/middleman | https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-cli/lib/middleman-cli/server.rb | middleman-cli/lib/middleman-cli/server.rb | # CLI Module
module Middleman::Cli
# Server thor task
class Server < Thor::Group
check_unknown_options!
class_option :environment,
aliases: '-e'
class_option :port,
aliases: '-p'
class_option :server_name,
aliases: '-s'
class_option :bind_addre... | ruby | MIT | b497703afb715044bc5cfcd5616bd3825323505b | 2026-01-04T15:39:40.166212Z | false |
middleman/middleman | https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-cli/lib/middleman-cli/extension.rb | middleman-cli/lib/middleman-cli/extension.rb | # CLI Module
module Middleman::Cli
# A thor task for creating new projects
class Extension < Thor::Group
include Thor::Actions
check_unknown_options!
# Required path for the new project to be generated
argument :name, type: :string
# Template files are relative to this file
# @return [Str... | ruby | MIT | b497703afb715044bc5cfcd5616bd3825323505b | 2026-01-04T15:39:40.166212Z | false |
middleman/middleman | https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-cli/lib/middleman-cli/init.rb | middleman-cli/lib/middleman-cli/init.rb | # CLI Module
module Middleman::Cli
# A thor task for creating new projects
class Init < Thor::Group
include Thor::Actions
GIT_CMD = 'git'.freeze
check_unknown_options!
argument :target, type: :string, default: '.'
class_option 'template',
aliases: '-T',
defa... | ruby | MIT | b497703afb715044bc5cfcd5616bd3825323505b | 2026-01-04T15:39:40.166212Z | false |
middleman/middleman | https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-cli/lib/middleman-cli/templates/extension/features/support/env.rb | middleman-cli/lib/middleman-cli/templates/extension/features/support/env.rb | PROJECT_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__)))
require 'middleman-core'
require 'middleman-core/step_definitions'
require File.join(PROJECT_ROOT_PATH, 'lib', '<%= name %>')
| ruby | MIT | b497703afb715044bc5cfcd5616bd3825323505b | 2026-01-04T15:39:40.166212Z | false |
middleman/middleman | https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-cli/lib/middleman-cli/templates/extension/lib/lib.rb | middleman-cli/lib/middleman-cli/templates/extension/lib/lib.rb | require "middleman-core"
Middleman::Extensions.register :<%= name %> do
require "my-extension/extension"
MyExtension
end
| ruby | MIT | b497703afb715044bc5cfcd5616bd3825323505b | 2026-01-04T15:39:40.166212Z | false |
middleman/middleman | https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-cli/lib/middleman-cli/templates/extension/lib/lib/extension.rb | middleman-cli/lib/middleman-cli/templates/extension/lib/lib/extension.rb | # Require core library
require 'middleman-core'
# Extension namespace
class MyExtension < ::Middleman::Extension
option :my_option, 'default', 'An example option'
def initialize(app, options_hash={}, &block)
# Call super to build options from the options_hash
super
# Require libraries only when activ... | ruby | MIT | b497703afb715044bc5cfcd5616bd3825323505b | 2026-01-04T15:39:40.166212Z | false |
middleman/middleman | https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman-cli/lib/middleman-core/cli.rb | middleman-cli/lib/middleman-core/cli.rb | # Backwards compat
require 'middleman-cli'
| ruby | MIT | b497703afb715044bc5cfcd5616bd3825323505b | 2026-01-04T15:39:40.166212Z | false |
middleman/middleman | https://github.com/middleman/middleman/blob/b497703afb715044bc5cfcd5616bd3825323505b/middleman/lib/middleman.rb | middleman/lib/middleman.rb | require 'middleman-core'
# Make the VERSION string available
require 'middleman-core/version'
| ruby | MIT | b497703afb715044bc5cfcd5616bd3825323505b | 2026-01-04T15:39:40.166212Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.