ampproject / amphtml

The AMP web component framework.
https://amp.dev
Apache License 2.0
14.89k stars 3.88k forks source link

Allow multiple link-rewriter configs #34607

Open gps08 opened 3 years ago

gps08 commented 3 years ago

Description

Allow for the amp-link-rewriter to be configured for multiple input/output objects. This would allow for more customization for sites with multiple vendors.

Currently the amp-link-rewriter is expecting a singular config and throws error if missing output. If the rewriter is updated to take an array of configs, then the user would be able to add additional customization.

For example: One link rewriter is generic and applies monetization to most anchor tags. Another more specific rewriter to params to a specific link.

For the overlap it could be the first in the config array gets to rewrite the link.

Alternatives Considered

Tried (with variable-sized container) for link rewriting, but it modifies the href after first click has happened.

Additional Context

This is a copy of issue #23325

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.