File: json_ld.rb

package info (click to toggle)
ruby-jekyll-seo-tag 2.8.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 336 kB
  • sloc: ruby: 1,934; sh: 23; makefile: 6
file content (31 lines) | stat: -rw-r--r-- 1,009 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# frozen_string_literal: true

module Jekyll
  class SeoTag
    # This module is deprecated, but is included in the Gem to avoid a breaking
    # change and should be removed at the next major version bump
    module JSONLD
      METHODS_KEYS = {
        :json_context   => "@context",
        :type           => "@type",
        :name           => "name",
        :page_title     => "headline",
        :json_author    => "author",
        :json_image     => "image",
        :date_published => "datePublished",
        :date_modified  => "dateModified",
        :description    => "description",
        :publisher      => "publisher",
        :main_entity    => "mainEntityOfPage",
        :links          => "sameAs",
        :canonical_url  => "url",
      }.freeze

      # Self should be a Jekyll::SeoTag::Drop instance (when extending the module)
      def json_ld
        Jekyll.logger.warn "Jekyll::SeoTag::JSONLD is deprecated"
        @json_ld ||= JSONLDDrop.new(self)
      end
    end
  end
end