Skip to content

Provide documentation on configuring .jsonld files to be loaded as script #9052

@thadguidry

Description

@thadguidry

Have you read the Contributing Guidelines on issues?

Description

We currently do OK by mentioning that scripts can be loaded.
https://docusaurus.io/docs/api/docusaurus-config#scripts
Great!

However, we should provide an example to also be linkable to our SEO section for https://docusaurus.io/docs/seo#structured-content.

For example, it's unclear what or where the best convention is (so we should provide a paragraph on guidelines under structured-content and also under the API reference for docusaurus-config#scripts) when a user has created their .jsonld file for Schema.org context to be loaded. Where to place the .jsonld file in Docusaurus file hierarchy is a bit unclear as a best practice. Should it go under /src? Or /static? or /assets? somewhere else?

where in Docusaurus file heirarchy do I place my seo_homepage.jsonld file to be properly loaded in this example?

module.exports = {
  scripts: [
  { src: 'https://plausible.io/js/script.js',
    'data-domain': 'homihq.com',
    defer: true,
    async: false,
  },
  { src: 'seo_homepage.jsonld',
    type: 'application/ld+json',
    defer: true,
    async: true,
  },
  ],

Self-service

  • I'd be willing to address this documentation request myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationThe issue is related to the documentation of Docusaurus

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions