{"id":21262849,"url":"https://github.com/stackql/docusaurus-plugin-structured-data","last_synced_at":"2025-07-11T04:31:17.093Z","repository":{"id":65338747,"uuid":"588804547","full_name":"stackql/docusaurus-plugin-structured-data","owner":"stackql","description":"Adds `JSON-LD` Structured Data (from `schema.org`) to each generated page in a Docusaurus site","archived":false,"fork":false,"pushed_at":"2023-05-19T06:01:29.000Z","size":36,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-06T06:57:22.985Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stackql.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-01-14T04:00:42.000Z","updated_at":"2024-09-18T21:16:20.000Z","dependencies_parsed_at":"2023-02-12T19:01:04.952Z","dependency_job_id":null,"html_url":"https://github.com/stackql/docusaurus-plugin-structured-data","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackql%2Fdocusaurus-plugin-structured-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackql%2Fdocusaurus-plugin-structured-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackql%2Fdocusaurus-plugin-structured-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackql%2Fdocusaurus-plugin-structured-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackql","download_url":"https://codeload.github.com/stackql/docusaurus-plugin-structured-data/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225674897,"owners_count":17506272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-21T04:59:31.637Z","updated_at":"2024-11-21T04:59:32.368Z","avatar_url":"https://github.com/stackql.png","language":"JavaScript","readme":"# docusaurus-plugin-structured-data\n\u003e Plugin to configure [__Structured Data__](https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data) for Docusaurus sites\n\n## How it works\n\nThis plugin will generate  [__Structured Data__](https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data) for your Docusaurus site, compliant with [__schema.org__](https://schema.org/).  \n\nThe plugin will generate the following types of structured data, and include them in the `\u003chead\u003e` of your site using the [__JSON-LD__](https://developers.google.com/search/docs/guides/intro-structured-data) format:  \n\n- [__`Organization`__](https://schema.org/Organization) - *augmented using data from `themeConfig.structuredData.organization`*\n- [__`WebSite`__](https://schema.org/WebSite) - *augmented using data from `themeConfig.structuredData.website`*\n- [__`WebPage`__](https://schema.org/WebPage) - *dynamically generated for each page*\n- [__`BreadcrumbList`__](https://schema.org/BreadcrumbList) - *dynamically generated for each page*\n\n\u003e Docusaurus generated microdata for `BreadcrumbList` is removed by this plugin in favor of the corresponding JSON-LD data.\n\n`Organization` and `WebSite` can be extended using the `themeConfig.structuredData` object based upon properties provided (e.g. you can add any `schema.org` compliant properties for `Organization` and `WebSite` and these will be automatically included in your structured data for each page).  \n\n`WebPage` structured data is dynamically generated for each page, and includes the following properties:  \n\n- [__`name`__](https://schema.org/name) - *sourced from page `title`*\n- [__`url`__](https://schema.org/url) - *page url*\n- [__`description`__](https://schema.org/description) - *sourced from `description` in the page frontmatter*\n- [__`mainEntityOfPage`__](https://schema.org/mainEntityOfPage) - *sourced from `siteConfig.url`*\n- [__`headline`__](https://schema.org/headline) - *sourced from `siteConfig.title`*\n- [__`dateModified`__](https://schema.org/dateModified) - *sourced from the build date*\n- [__`datePublished`__](https://schema.org/datePublished) - *sourced from `themeConfig.structuredData.website.datePublished`*\n\n`BreadcrumbList` structured data is dynamically generated for each page based upon the page `route`.  \n\n\u003e this plugin uses the `postBuild` lifecycle hook to generate the structured data for each page, and inject it into the `\u003chead\u003e` of the page.  It is only invoked upon __`yarn build`__ or __`npm run build`__ commands being run.  \n \n`Article` structured data is automatically generated by this plugin for blog articles, including calcualting `wordCount` and including `author` data.   \n\n## Installation\n\n\u003cdetails\u003e\n\u003csummary\u003eNPM\u003c/summary\u003e\n\u003cp\u003e\n\n```bash\nnpm i @stackql/docusaurus-plugin-structured-data\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eYARN\u003c/summary\u003e\n\u003cp\u003e\n\n```bash\nyarn add @stackql/docusaurus-plugin-structured-data\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n## Setup\n\nAdd to `plugins` in `docusaurus.config.js`:\n\n```js\n{\n  plugins: [\n    '@stackql/docusaurus-plugin-structured-data',\n    ...\n  ]\n}\n```\n\nUpdate `themeConfig` in the `docusaurus.config.js` file, the following shows mandatory properties:\n\n```js\n{\n  ...,\n  themeConfig: {\n    structuredData: {\n      excludedRoutes: [], // array of routes to exclude from structured data generation, include custom redirects here\n      verbose: boolean, // print verbose output to console (default: false)\n      featuredImageDimensions: {\n        width: number,\n        height: number,\n      },\n      authors:{\n        author_name: {\n          authorId: string, // unique id for the author - used as an identifier in structured data\n          url: string, // MUST be the same as the `url` property in the `authors.yml` file in the `blog` directory\n          imageUrl: string, // gravatar url\n          sameAs: [] // synonymous entity links, e.g. github, linkedin, twitter, etc.\n        },\n      },  \n      organization: {}, // Organization properties can be added to this object\n      website: {}, // WebSite properties can be added to this object\n      webpage: {\n        datePublished: string, // default is the current date\n        inLanguage: string, // default: en-US\n      },\n      breadcrumbLabelMap: {} // used to map the breadcrumb labels to a custom value\n      }\n    },\n    ...\n  }\n```\n\n## Config Example\n\nBelow is an example of a `docusaurus.config.js` file with the `themeConfig.structuredData` object populated with all available properties:  \n\n```js\nstructuredData: {\n  excludedRoutes: [\n    '/providers',\n  ],  \n  verbose: true,\n  featuredImageDimensions: {\n    width: 1200,\n    height: 627,\n  },\n  authors:{\n    'Jeffrey Aven': {\n      authorId: '1',\n      url: 'https://www.linkedin.com/in/jeffreyaven/',\n      imageUrl: 'https://s.gravatar.com/avatar/f96573d092470c74be233e1dded5376f?s=80',\n      sameAs: [\n        'https://www.amazon.com/stores/Jeffrey-Aven/author/B0BSP78VVL',\n        'https://developers.google.com/community/experts/directory/profile/profile-jeffrey-aven',\n        'https://www.linkedin.com/in/jeffreyaven/',\n        'https://www.crunchbase.com/person/jeffrey-aven',\n        'https://github.com/jeffreyaven',\n        'https://dev.to/jeffreyaven',\n      ],\n    },\n  },  \n  organization: {\n    sameAs: [\n      'https://twitter.com/stackql',\n      'https://www.linkedin.com/company/stackql',\n      'https://github.com/stackql',\n      'https://www.youtube.com/@stackql',\n      'https://hub.docker.com/u/stackql',\n    ],\n    contactPoint: {\n      '@type': 'ContactPoint',\n      email: 'info@stackql.io',\n    },\n    logo: {\n      '@type': 'ImageObject',\n      inLanguage: 'en-US',\n      '@id': 'https://stackql.io/#logo',\n      url: 'https://stackql.io/img/stackql-cover.png',\n      contentUrl: 'https://stackql.io/img/stackql-cover.png',\n      width: 1440,\n      height: 900,\n      caption: 'StackQL - your cloud using SQL',\n    },\n    address: {\n      '@type': 'PostalAddress',\n      addressCountry: 'AU', // https://en.wikipedia.org/wiki/ISO_3166-1\n      postalCode: '3001',\n      streetAddress: 'Level 24, 570 Bourke Street, Melbourne, Victoria',\n    },\n    duns: '750469226',\n    taxID: 'ABN 65 656 147 054',\n  },\n  website: {\n    inLanguage: 'en-US',\n  },\n  webpage: {\n    inLanguage: 'en-US',\n    datePublished: '2021-07-01',\n  },\n  breadcrumbLabelMap: {\n    'developers': 'Developers',\n    'functions': 'Functions',\n    'aggregate': 'Aggregate',\n    'datetime': 'Date Time',\n    'json': 'JSON',\n    'math': 'Math',\n    'string': 'String',\n    'command-line-usage': 'Command Line Usage',\n    'getting-started': 'Getting Started',\n    'language-spec': 'Language Specification',\n    're': 'Regular Expressions',\n  }\n},\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackql%2Fdocusaurus-plugin-structured-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackql%2Fdocusaurus-plugin-structured-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackql%2Fdocusaurus-plugin-structured-data/lists"}