@rileybathurst/paddle 0.0.51 → 0.0.53

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/PaddleSEO.tsx +20 -23
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rileybathurst/paddle",
3
3
  "private": false,
4
- "version": "0.0.51",
4
+ "version": "0.0.53",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -45,7 +45,7 @@
45
45
  "typescript": "^5.2.2",
46
46
  "vite": "^5.2.0"
47
47
  },
48
- "description": "This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.",
48
+ "description": "building blocks",
49
49
  "main": "src/index.tsx",
50
50
  "module": "src/index.tsx",
51
51
  "author": "",
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
@@ -62,6 +59,9 @@ type SEOtypes = {
62
59
  latitude: string;
63
60
  longitude: string;
64
61
  geoRadius: string;
62
+ phone: string;
63
+ ogImage: string;
64
+ ogimagedescription: string;
65
65
  };
66
66
 
67
67
  strapiLocation: {
@@ -76,19 +76,16 @@ type SEOtypes = {
76
76
  };
77
77
  }
78
78
 
79
- export const PaddleSEO = (strapiLocale, strapiLocation: SEOtypes) => {
79
+ export const PaddleSEO = ({ title, description, ogImage, ogimagedescription, breadcrumbs, strapiLocale, strapiLocation }: SEOtypes) => {
80
80
 
81
81
  const businessName = `${strapiLocale.name} Kayak & Paddleboard rentals and tours`;
82
82
 
83
- const seo = {
84
- title: SE0.title ? `${SE0.title} | ${businessName}` : `${businessName} | ${strapiLocale.topbar.topbar} `,
85
- // TODO: tagline would be a better fallback description
86
- description: SE0.description || businessName,
87
- url: `${strapiLocale.url}${SE0.url}` || strapiLocale.url,
88
- image: strapiLocale.ogImage || SEO.image,
89
- imageAlt: strapiLocale.ogimagedescription || SEO.imageAlt,
90
- breadcrumbs: SE0.breadcrumbs || null,
91
- };
83
+ const PaddleTitle = title ? `${title} | ${businessName}` : `${businessName} | ${strapiLocale.topbar.topbar} `;
84
+ // TODO: tagline would be a better fallback description
85
+ const PaddleDescription = description || businessName;
86
+ // url: `${strapiLocale.url}${SE0.url}` || strapiLocale.url,
87
+ const PaddleImage = ogImage || strapiLocale.ogImage;
88
+ const PaddleImageAlt = ogimagedescription || strapiLocale.ogimagedescription;
92
89
 
93
90
  // const query = '- cash\n - credit card';
94
91
  // const formatted = query.split('\n').map((item) => item.trim().replace('- ', '')).join(', ');
@@ -101,15 +98,15 @@ export const PaddleSEO = (strapiLocale, strapiLocation: SEOtypes) => {
101
98
 
102
99
  return (
103
100
  <>
104
- <title>{seo.title}</title>
105
- <meta name="description" content={seo.description} />
101
+ <title>{PaddleTitle}</title>
102
+ <meta name="description" content={PaddleDescription} />
106
103
 
107
104
  <meta property="og:type" content="website" />
108
- <meta property="og:url" content={seo.url} />
109
- <meta property="og:title" content={seo.title} />
110
- <meta property="og:description" content={seo.description} />
111
- <meta property="og:image" content={seo.image} />
112
- <meta property="og:image:alt" content={seo.imageAlt} />
105
+ {/* <meta property="og:url" content={url} /> */}
106
+ <meta property="og:title" content={PaddleTitle} />
107
+ <meta property="og:description" content={PaddleDescription} />
108
+ <meta property="og:image" content={PaddleImage} />
109
+ <meta property="og:image:alt" content={PaddleImageAlt} />
113
110
  <meta name="theme-color" content={strapiLocale.themeColor} />
114
111
 
115
112
  <Script type="application/ld+json">
@@ -120,7 +117,7 @@ export const PaddleSEO = (strapiLocale, strapiLocation: SEOtypes) => {
120
117
  "name": "${businessName}",
121
118
  "url": "${strapiLocale.url}",
122
119
  "description": "${strapiLocale.name}",
123
- "image": "${seo.image}",
120
+ "image": "${PaddleImage}",
124
121
  "address": {
125
122
  "@type": "PostalAddress",
126
123
  "streetAddress": "${strapiLocation.streetAddress}",
@@ -151,8 +148,8 @@ export const PaddleSEO = (strapiLocale, strapiLocation: SEOtypes) => {
151
148
  `}
152
149
  </Script>
153
150
 
154
- <Breadcrumbs {...seo.breadcrumbs} />
155
- {SE0.children}
151
+ <Breadcrumbs {...breadcrumbs} />
152
+ {/* {SE0.children} */}
156
153
  </>
157
154
  );
158
155
  };