@rileybathurst/paddle 0.0.51 → 0.0.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/PaddleSEO.tsx +17 -23
package/package.json
CHANGED
package/src/PaddleSEO.tsx
CHANGED
|
@@ -10,9 +10,6 @@ interface BreadcrumbsTypes {
|
|
|
10
10
|
}[]
|
|
11
11
|
// I could probably pass it two arguments instead but for now
|
|
12
12
|
function Breadcrumbs(breadcrumbs: BreadcrumbsTypes) {
|
|
13
|
-
|
|
14
|
-
// console.log(breadcrumbs);
|
|
15
|
-
// console.log(Object.entries(breadcrumbs).length);
|
|
16
13
|
if (!Object.entries(breadcrumbs).length) return null;
|
|
17
14
|
|
|
18
15
|
// remove the breadcrumbs.url from the Object.entries
|
|
@@ -76,19 +73,16 @@ type SEOtypes = {
|
|
|
76
73
|
};
|
|
77
74
|
}
|
|
78
75
|
|
|
79
|
-
export const PaddleSEO = (strapiLocale, strapiLocation: SEOtypes) => {
|
|
76
|
+
export const PaddleSEO = (title, description, image, imageAlt, breadcrumbs, strapiLocale, strapiLocation: SEOtypes) => {
|
|
80
77
|
|
|
81
78
|
const businessName = `${strapiLocale.name} Kayak & Paddleboard rentals and tours`;
|
|
82
79
|
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
imageAlt: strapiLocale.ogimagedescription || SEO.imageAlt,
|
|
90
|
-
breadcrumbs: SE0.breadcrumbs || null,
|
|
91
|
-
};
|
|
80
|
+
const PaddleTitle = title ? `${title} | ${businessName}` : `${businessName} | ${strapiLocale.topbar.topbar} `;
|
|
81
|
+
// TODO: tagline would be a better fallback description
|
|
82
|
+
const PaddleDescription = description || businessName;
|
|
83
|
+
// url: `${strapiLocale.url}${SE0.url}` || strapiLocale.url,
|
|
84
|
+
const PaddleImage = image || strapiLocale.ogImage;
|
|
85
|
+
const PaddleImageAlt = imageAlt || strapiLocale.ogimagedescription;
|
|
92
86
|
|
|
93
87
|
// const query = '- cash\n - credit card';
|
|
94
88
|
// const formatted = query.split('\n').map((item) => item.trim().replace('- ', '')).join(', ');
|
|
@@ -101,15 +95,15 @@ export const PaddleSEO = (strapiLocale, strapiLocation: SEOtypes) => {
|
|
|
101
95
|
|
|
102
96
|
return (
|
|
103
97
|
<>
|
|
104
|
-
<title>{
|
|
105
|
-
<meta name="description" content={
|
|
98
|
+
<title>{PaddleTitle}</title>
|
|
99
|
+
<meta name="description" content={PaddleDescription} />
|
|
106
100
|
|
|
107
101
|
<meta property="og:type" content="website" />
|
|
108
|
-
<meta property="og:url" content={
|
|
109
|
-
<meta property="og:title" content={
|
|
110
|
-
<meta property="og:description" content={
|
|
111
|
-
<meta property="og:image" content={
|
|
112
|
-
<meta property="og:image:alt" content={
|
|
102
|
+
{/* <meta property="og:url" content={url} /> */}
|
|
103
|
+
<meta property="og:title" content={PaddleTitle} />
|
|
104
|
+
<meta property="og:description" content={PaddleDescription} />
|
|
105
|
+
<meta property="og:image" content={PaddleImage} />
|
|
106
|
+
<meta property="og:image:alt" content={PaddleImageAlt} />
|
|
113
107
|
<meta name="theme-color" content={strapiLocale.themeColor} />
|
|
114
108
|
|
|
115
109
|
<Script type="application/ld+json">
|
|
@@ -120,7 +114,7 @@ export const PaddleSEO = (strapiLocale, strapiLocation: SEOtypes) => {
|
|
|
120
114
|
"name": "${businessName}",
|
|
121
115
|
"url": "${strapiLocale.url}",
|
|
122
116
|
"description": "${strapiLocale.name}",
|
|
123
|
-
"image": "${
|
|
117
|
+
"image": "${PaddleImage}",
|
|
124
118
|
"address": {
|
|
125
119
|
"@type": "PostalAddress",
|
|
126
120
|
"streetAddress": "${strapiLocation.streetAddress}",
|
|
@@ -151,8 +145,8 @@ export const PaddleSEO = (strapiLocale, strapiLocation: SEOtypes) => {
|
|
|
151
145
|
`}
|
|
152
146
|
</Script>
|
|
153
147
|
|
|
154
|
-
<Breadcrumbs {...
|
|
155
|
-
{SE0.children}
|
|
148
|
+
<Breadcrumbs {...breadcrumbs} />
|
|
149
|
+
{/* {SE0.children} */}
|
|
156
150
|
</>
|
|
157
151
|
);
|
|
158
152
|
};
|