UNPKG

gatsby-plugin-next-seo

Version:
41 lines (35 loc) 1.4 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.SocialProfileJsonLd = void 0; var _react = _interopRequireDefault(require("react")); var _reactHelmetAsync = require("react-helmet-async"); /** * @deprecated * * See the Google * {@link https://developers.google.com/search/docs/data-types/social-profile | documentation} * with the reason for deprecation. * * @internal */ var SocialProfileJsonLd = function SocialProfileJsonLd(_ref) { var type = _ref.type, name = _ref.name, url = _ref.url, _ref$sameAs = _ref.sameAs, sameAs = _ref$sameAs === void 0 ? [] : _ref$sameAs, _ref$defer = _ref.defer, defer = _ref$defer === void 0 ? false : _ref$defer; var jsonld = "{\n \"@context\": \"http://schema.org\",\n \"@type\": \"".concat(type, "\",\n \"name\": \"").concat(name, "\",\n \"url\": \"").concat(url, "\",\n \"sameAs\": [\n ").concat(sameAs.map(function (socialUrl) { return "\"".concat(socialUrl, "\""); }).toString(), "\n ]\n }"); return /*#__PURE__*/_react["default"].createElement(_reactHelmetAsync.Helmet, { defer: defer }, /*#__PURE__*/_react["default"].createElement("script", { type: "application/ld+json" }, jsonld)); }; exports.SocialProfileJsonLd = SocialProfileJsonLd;