@rileybathurst/paddle 0.0.53 → 0.0.55
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 +39 -34
package/package.json
CHANGED
package/src/PaddleSEO.tsx
CHANGED
|
@@ -2,10 +2,10 @@ import React from "react";
|
|
|
2
2
|
import { Script } from "gatsby";
|
|
3
3
|
|
|
4
4
|
interface BreadcrumbsTypes {
|
|
5
|
-
url
|
|
5
|
+
url?: string;
|
|
6
6
|
[key: number]: {
|
|
7
|
-
name
|
|
8
|
-
item
|
|
7
|
+
name?: string;
|
|
8
|
+
item?: string;
|
|
9
9
|
};
|
|
10
10
|
}[]
|
|
11
11
|
// I could probably pass it two arguments instead but for now
|
|
@@ -41,13 +41,13 @@ function Breadcrumbs(breadcrumbs: BreadcrumbsTypes) {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
type SEOtypes = {
|
|
44
|
-
title
|
|
45
|
-
description
|
|
44
|
+
title?: string;
|
|
45
|
+
description?: string;
|
|
46
46
|
url: string;
|
|
47
|
-
ogImage
|
|
48
|
-
|
|
49
|
-
breadcrumbs
|
|
50
|
-
children: React.ReactNode;
|
|
47
|
+
ogImage?: string;
|
|
48
|
+
ogImagedescription?: string;
|
|
49
|
+
breadcrumbs?: BreadcrumbsTypes;
|
|
50
|
+
// children: React.ReactNode;
|
|
51
51
|
|
|
52
52
|
strapiLocale: {
|
|
53
53
|
name: string;
|
|
@@ -61,22 +61,24 @@ type SEOtypes = {
|
|
|
61
61
|
geoRadius: string;
|
|
62
62
|
phone: string;
|
|
63
63
|
ogImage: string;
|
|
64
|
-
|
|
64
|
+
ogImagedescription: string;
|
|
65
65
|
};
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
allStrapiLocation: {
|
|
68
|
+
nodes: {
|
|
69
|
+
streetAddress: string;
|
|
70
|
+
addressLocality: string;
|
|
71
|
+
addressRegion: string;
|
|
72
|
+
postalCode: string;
|
|
73
|
+
paymentAccepted: string;
|
|
74
|
+
phone: string;
|
|
75
|
+
opening_time: string;
|
|
76
|
+
closing_time: string;
|
|
77
|
+
}[];
|
|
76
78
|
};
|
|
77
79
|
}
|
|
78
80
|
|
|
79
|
-
export const PaddleSEO = ({ title, description, ogImage,
|
|
81
|
+
export const PaddleSEO = ({ title, description, ogImage, ogImagedescription, breadcrumbs, strapiLocale, allStrapiLocation }: SEOtypes) => {
|
|
80
82
|
|
|
81
83
|
const businessName = `${strapiLocale.name} Kayak & Paddleboard rentals and tours`;
|
|
82
84
|
|
|
@@ -85,15 +87,17 @@ export const PaddleSEO = ({ title, description, ogImage, ogimagedescription, bre
|
|
|
85
87
|
const PaddleDescription = description || businessName;
|
|
86
88
|
// url: `${strapiLocale.url}${SE0.url}` || strapiLocale.url,
|
|
87
89
|
const PaddleImage = ogImage || strapiLocale.ogImage;
|
|
88
|
-
const PaddleImageAlt =
|
|
90
|
+
const PaddleImageAlt = ogImagedescription || strapiLocale.ogImagedescription;
|
|
89
91
|
|
|
90
92
|
// const query = '- cash\n - credit card';
|
|
91
93
|
// const formatted = query.split('\n').map((item) => item.trim().replace('- ', '')).join(', ');
|
|
92
94
|
// console.log(formatted);
|
|
93
95
|
|
|
96
|
+
// TODO: this is now allStrapiLocation.nodes
|
|
97
|
+
// TODO: I think this will be a keylocation piece
|
|
94
98
|
// console.log(strapiLocation.paymentAccepted);
|
|
95
|
-
const paymentAcceptedQuery = strapiLocation.paymentAccepted;
|
|
96
|
-
const paymentAcceptedFormatted = paymentAcceptedQuery.split('\n').map((payment: string) => payment.trim().replace('- ', '')).join(', ');
|
|
99
|
+
// const paymentAcceptedQuery = strapiLocation.paymentAccepted ? strapiLocation.paymentAccepted : '';
|
|
100
|
+
// const paymentAcceptedFormatted = paymentAcceptedQuery.split('\n').map((payment: string) => payment.trim().replace('- ', '')).join(', ');
|
|
97
101
|
// console.log(paymentAcceptedFormatted);
|
|
98
102
|
|
|
99
103
|
return (
|
|
@@ -118,13 +122,18 @@ export const PaddleSEO = ({ title, description, ogImage, ogimagedescription, bre
|
|
|
118
122
|
"url": "${strapiLocale.url}",
|
|
119
123
|
"description": "${strapiLocale.name}",
|
|
120
124
|
"image": "${PaddleImage}",
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
|
|
126
|
+
${allStrapiLocation.nodes.map((location) => {
|
|
127
|
+
return `{
|
|
128
|
+
"address": {
|
|
129
|
+
"@type": "PostalAddress",
|
|
130
|
+
"streetAddress": "${location.streetAddress}",
|
|
131
|
+
"addressLocality": "${location.addressLocality}",
|
|
132
|
+
"addressRegion": "${location.addressRegion}",
|
|
133
|
+
"postalCode": "${location.postalCode}"
|
|
134
|
+
},
|
|
135
|
+
}`
|
|
136
|
+
})},
|
|
128
137
|
"geo": {
|
|
129
138
|
"@type": "GeoCoordinates",
|
|
130
139
|
"latitude": "${strapiLocale.latitude}",
|
|
@@ -139,11 +148,7 @@ export const PaddleSEO = ({ title, description, ogImage, ogimagedescription, bre
|
|
|
139
148
|
},
|
|
140
149
|
"geoRadius": "${strapiLocale.geoRadius}"
|
|
141
150
|
},
|
|
142
|
-
"paymentAccepted": "${paymentAcceptedFormatted}",
|
|
143
151
|
"telephone": "${strapiLocale.phone}",
|
|
144
|
-
"numberOfEmployees": "10",
|
|
145
|
-
"openingHours": "Mo, Tu, We, Th, Fr, Sa, Su ${strapiLocation.opening_time}-${strapiLocation.closing_time}",
|
|
146
|
-
"priceRange": "$30-$375"
|
|
147
152
|
}
|
|
148
153
|
`}
|
|
149
154
|
</Script>
|