lib/bolognese/schema_org.rb in bolognese-0.5.3 vs lib/bolognese/schema_org.rb in bolognese-0.6.1

- old
+ new

@@ -12,10 +12,11 @@ @raw = doc.at_xpath('//script[@type="application/ld+json"]') end end alias_method :schema_org, :as_schema_org + alias_method :bibtex, :as_bibtex def metadata @metadata ||= raw.present? ? Maremma.from_json(raw) : {} end @@ -43,9 +44,13 @@ metadata.fetch("@type", nil) end def additional_type metadata.fetch("additionalType", nil) + end + + def bibtex_type + Bolognese::Bibtex::SO_TO_BIB_TRANSLATIONS[type] || "misc" end def name metadata.fetch("name", nil) end