Skip to content

Add external link markup #65

@michaeltlombardi

Description

@michaeltlombardi

As an author, I want to be able to mark external links that open in new tabs accessibly.

Proposed Markup

Input Markdown

[external:Deploy to Netlify](https:netlify.app)

Output HTML

<a href="https://netlify.app" target="_blank" rel="noopener noreferrer">
  Deploy to Netlify
</a>

Rendered Output

Deploy to Netlify

Options

Because this uses link markup, instead of specifying the style as an attribute or title (because the title is a valid link component), instead use the prefix:

  • external and external-default map to data/_params/platen/links/external/_default.yaml

  • external-foo maps to data/_params/platen/links/external/foo.yaml

  • The prefix bar defined as an alias:

    platen:
      markup:
        links:
          aliases:
            prefix: bar
            definition: my_theme.bar

    Maps to data/_params/platen/links/my_theme/bar.yaml

Users should be able to set at least the following attributes:

  • target
  • rel
  • href
  • class

Where href is overridden by the value specified for the link itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions