Skip to content

Make stylesheets API more generalized #8049

@johnnyreilly

Description

@johnnyreilly

Have you read the Contributing Guidelines on issues?

Description

In the same way as there's support for adding custom meta tags globally:

https://docusaurus.io/docs/api/themes/configuration#metadata

Could there also be support for adding custom link tags that are applied globally?

It looks like there isn't a way to do this with Docusaurus. The closest I've found is this section related to stylesheets:

https://docusaurus.io/docs/api/docusaurus-config#stylesheets

I initially thought this might work, but it doesn't as it depends upon an href tag being present. In my case, there isn't one - and it's not a stylesheet so that probably makes sense.

Imagine being able to do something like this in docusaurus.config.js:

module.exports = {
  linktags: [
     {
       rel: 'monetization',
       content: 'https://ilp.uphold.com/LwQQhXdpwxeJ',
     },
   ],
}

Has this been requested on Canny?

https://docusaurus.io/feature-requests/p/custom-link-tags-in-header

Motivation

I'm trying to add a custom link tag to the header of all the pages on my Docusaurus site. In my case I'm looking to render a web monetization link which looks like this:

<link rel="monetization" content="https://ilp.uphold.com/LwQQhXdpwxeJ" />

It looks like there isn't a way to do this with Docusaurus.

API design

See earlier

Have you tried building it?

No

Self-service

  • I'd be willing to contribute this feature to Docusaurus myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions