LinkProvider
One entry in `LINK_PROVIDERS` — how to recognize a pasted URL as belonging to a specific provider, and what kind of link it is.
One entry in LINK_PROVIDERS — how to recognize a pasted URL as belonging to a specific provider, and what kind of link it is.
Import from @homepages/template-kit.
Signature
Section titled “Signature”export interface LinkProvider { kind: LinkKind; label: string; pattern: RegExp; path?: RegExp; strategy: LinkStrategy;}Constraints
Section titled “Constraints”patterntests the parsed URL’s HOSTNAME, never the raw string — a path segment naming a host must not classify as that host.path, when present, additionally tests the pathname:mapsneeds it becausedrive.google.comandwww.google.com/mapsshare no distinguishing host.
See also
Section titled “See also”acceptsLinkcollectionForSlotisLinkAcceptsmatchLinkProvidertourEmbedUrlvideoEmbedUrlCOLLECTIONSCONTENT_SLOT_TYPESDECISION_TYPESLINK_KINDSLINK_PROVIDERSLINK_STRATEGIESREF_SLOT_TYPESREFERRAL_FIELDSREFERRAL_IMAGE_FIELDSSLOT_TYPESSOURCE_FIELDSVIDEO_SOURCESCollectionFieldCollectionIdKeyCollectionOwnershipContentSlotTypeDecisionTypeLinkKindLinkProviderIdLinkStrategyReferralFieldReferralImageFieldRefSlotTypeSlotTypeSourceFieldContainerSourceFieldDescriptorSourceFieldNameSourceFieldValueTypeVideoSourceWritebackTarget