Skip to content

Support a target option for social links. #5214

@ajiho

Description

@ajiho

Is your feature request related to a problem? Please describe.

Sometimes I prefer to place all social/contact information on a dedicated page, since it allows for richer descriptions and additional context. However, social links currently always open in a new tab.

Describe the solution you'd like

It would be great if socialLinks could support a target option, similar to themeConfig.nav for example:

themeConfig: {
  socialLinks: [
    {
      icon: "github",
      link: "https://github.com/ajiho",
      target: "_blank",
    },
    {
      icon: {
        svg: "<svg>...</svg>",
      },
      ariaLabel: "wechat",
      link: "/contact",
      target: "_self",
    },
  ];
}

This would provide more flexibility, especially for links that point to internal pages.

Describe alternatives you've considered

No response

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No 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