Sha256: 62a19b12edb28066e1eae64173b61eaca32426ab17073f548b5b2d9d9b21b5e9
Contents?: true
Size: 927 Bytes
Versions: 17
Compression:
Stored size: 927 Bytes
Contents
# frozen_string_literal: true module Bridgetown module Model class PluginOrigin < RepoOrigin class << self def handle_scheme?(scheme) scheme == "plugin" end end def manifest @manifest ||= begin manifest_origin = Addressable::URI.unescape(url.path.delete_prefix("/")).split("/").first site.config.source_manifests.find do |manifest| manifest.origin.to_s == manifest_origin end.tap do |manifest| raise "Unable to locate a source manifest for #{manifest_origin}" unless manifest end end end def relative_path @relative_path ||= Pathname.new( Addressable::URI.unescape(url.path.delete_prefix("/")).split("/")[1..].join("/") ) end def original_path @original_path ||= relative_path.expand_path(manifest.content) end end end end
Version data entries
17 entries across 17 versions & 1 rubygems