Skip to content

Commit

Permalink
Merge branch 'iiif_manifest_title' into adventist_dev
Browse files Browse the repository at this point in the history
  • Loading branch information
orangewolf committed Sep 21, 2023
2 parents 8e3b70f + a1f0f29 commit e45bb38
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/iiif_manifest/manifest_builder/canvas_builder_decorator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true

# OVERRIDE IIIFManifest v0.5.0 to use the parent's title as the label instead of the filename

module IIIFManifest
module ManifestBuilderDecorator
module CanvasBuilderDecorator
def apply_record_properties
canvas['@id'] = path
canvas.label = record['parent_title_tesim']&.first || record.to_s
end
end
end
end

IIIFManifest::ManifestBuilder.prepend(IIIFManifest::ManifestBuilderDecorator)
IIIFManifest::ManifestBuilder::CanvasBuilder.prepend(IIIFManifest::ManifestBuilder::CanvasBuilderDecorator)

0 comments on commit e45bb38

Please sign in to comment.