@ndlib/component-library 0.0.84 → 0.0.85

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.
@@ -1,12 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { siteMetadata } from './siteMetadata';
3
- export const Seo = ({ title, description, image, nofollow, noindex, }) => {
3
+ export const Seo = ({ title, description, image, nofollow, noindex, pathname, }) => {
4
4
  const { title: defaultTitle, description: defaultDescription, image: defaultImage, nofollow: defaultNoindex, noindex: defaultNofollow, siteUrl, twitterUsername, } = siteMetadata();
5
5
  const seo = {
6
6
  title: title || defaultTitle,
7
7
  description: description || defaultDescription,
8
8
  image: image ? image : defaultImage,
9
- url: siteUrl + location.pathname || '',
9
+ url: siteUrl + pathname || '',
10
10
  nofollow: nofollow || defaultNofollow,
11
11
  noindex: noindex || defaultNoindex,
12
12
  twitterUsername,
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  export type StructuredDataProps = {
3
3
  title?: string;
4
+ pathname?: string;
4
5
  description?: string;
5
6
  siteUrl?: string;
6
7
  nofollow?: string;
@@ -33,6 +34,6 @@ export type StructuredDataProps = {
33
34
  publishedDate: string;
34
35
  }[];
35
36
  };
36
- export declare const getStructuredDataSchemas: ({ title, description, nofollow, noindex, image, events, news, }: StructuredDataProps) => string[];
37
+ export declare const getStructuredDataSchemas: ({ title, pathname, description, nofollow, noindex, image, events, news, }: StructuredDataProps) => string[];
37
38
  export declare const StructuredData: React.FC<StructuredDataProps>;
38
39
  export default StructuredData;
@@ -3,7 +3,7 @@ import { siteMetadata } from './siteMetadata';
3
3
  import { stringifyWebpageSchema } from './sdWebsite';
4
4
  import { stringifyEventSchema } from './sdEvent';
5
5
  import { stringifyNewsSchema } from './sdNews';
6
- export const getStructuredDataSchemas = ({ title, description, nofollow, noindex, image, events, news, }) => {
6
+ export const getStructuredDataSchemas = ({ title, pathname, description, nofollow, noindex, image, events, news, }) => {
7
7
  const { title: defaultTitle, description: defaultDescription, image: defaultImage, siteUrl, nofollow: defaultNofollow, noindex: defaultNoindex, } = siteMetadata();
8
8
  const metadata = {
9
9
  title: title || defaultTitle,
@@ -11,13 +11,13 @@ export const getStructuredDataSchemas = ({ title, description, nofollow, noindex
11
11
  nofollow: nofollow || defaultNofollow,
12
12
  noindex: noindex || defaultNoindex,
13
13
  image: image || defaultImage,
14
- url: `${siteUrl}${location.pathname || ''}`,
14
+ url: `${siteUrl}${pathname || ''}`,
15
15
  lang: 'en',
16
16
  events: events,
17
17
  news: news,
18
18
  };
19
19
  const schemas = [];
20
- if (location.pathname !== '') {
20
+ if (pathname !== '') {
21
21
  schemas.push(stringifyWebpageSchema({
22
22
  name: metadata.title,
23
23
  description: metadata.description,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ndlib/component-library",
3
- "version": "0.0.84",
3
+ "version": "0.0.85",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "files": [