25869.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. "use strict";
  2. exports.id = 25869;
  3. exports.ids = [25869];
  4. exports.modules = {
  5. /***/ 25869:
  6. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  8. /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
  9. /* harmony export */ });
  10. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20997);
  11. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
  12. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16689);
  13. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  14. /* harmony import */ var next_seo__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16641);
  15. /* harmony import */ var next_seo__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_seo__WEBPACK_IMPORTED_MODULE_2__);
  16. /* harmony import */ var _utils_string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96174);
  17. const NextSeoWrapper = (props)=>{
  18. const { url , image , imageAlt , imageHeight , imageWidth , openGraph , description , ...rest } = props;
  19. const openGraphParams = {
  20. ...openGraph && {
  21. openGraph
  22. },
  23. ...url && {
  24. url
  25. },
  26. ...image && {
  27. images: [
  28. {
  29. url: image,
  30. width: imageWidth,
  31. height: imageHeight,
  32. alt: imageAlt
  33. }
  34. ]
  35. }
  36. };
  37. const params = {
  38. ...rest,
  39. ...description && {
  40. description: (0,_utils_string__WEBPACK_IMPORTED_MODULE_3__/* .truncateString */ .aS)(description, 150)
  41. }
  42. };
  43. return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(next_seo__WEBPACK_IMPORTED_MODULE_2__.NextSeo, {
  44. ...params,
  45. openGraph: openGraphParams
  46. });
  47. };
  48. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (NextSeoWrapper);
  49. /***/ }),
  50. /***/ 96174:
  51. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  52. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  53. /* harmony export */ "Nl": () => (/* binding */ slugifiedCollectionIdToCollectionId),
  54. /* harmony export */ "aS": () => (/* binding */ truncateString)
  55. /* harmony export */ });
  56. /* unused harmony export stripHTMLTags */
  57. /**
  58. * Shorten a text by setting the maximum number of characters
  59. * by the value of the parameter and adding "..." at the end.
  60. *
  61. * @param {string} rawString
  62. * @param {number} length
  63. * @param {string} suffix
  64. * @returns {string}
  65. */ const truncateString = (rawString, length, suffix = "...")=>{
  66. const characters = rawString.split("", length);
  67. let shortenedText = "";
  68. for(let index = 0; index < characters.length; index += 1){
  69. const character = characters[index];
  70. if (shortenedText.length === length - 1) {
  71. shortenedText = `${shortenedText}${character}${suffix}`;
  72. break;
  73. }
  74. shortenedText = `${shortenedText}${character}`;
  75. }
  76. return shortenedText;
  77. };
  78. /**
  79. * Strip HTML tags from a string.
  80. *
  81. * @param {string} rawString
  82. * @returns {string}
  83. */ const stripHTMLTags = (rawString)=>rawString.replace(/(<([^>]+)>)/gi, "");
  84. /**
  85. * Convert a slugified collection id to collection id only after
  86. * removing the slug.
  87. *
  88. * @param {string} slugifiedCollectionId
  89. * @returns {string}
  90. */ const slugifiedCollectionIdToCollectionId = (slugifiedCollectionId)=>{
  91. if (!slugifiedCollectionId) {
  92. return "";
  93. }
  94. const splits = slugifiedCollectionId.split("-");
  95. // if there is no slug in the url (collections with a name that cannot be slugified e.g. emoticons)
  96. if (splits.length === 1) {
  97. return splits[0];
  98. }
  99. return splits[splits.length - 1];
  100. };
  101. /***/ })
  102. };
  103. ;
  104. //# sourceMappingURL=25869.js.map