Members
# constant getDomainSpecificHamburgerMenuItems
returns hamburger menu items for subdomains
which menuGroup to pick for which domain can be configured by setting featureConfig.sidebarMenu.menuGroupSlug for the subdomain if featureConfig isn't passed, check if menuGroup with slug "amp-sidebar-menu-${domainSlug}" is present and return those items if that's not set, check if menuGroup with slug "sidebar-menu-${domainSlug}" is present and return those items if that's not set either, return default menu group items
# constant getTokensForDarkTheme
Inverts colors for dark theme. Currently only inverts shades of gray not sure how desirable the output of this will be on non-gray colors. Check before using!
Methods
# ampifyStory(params) → {function}
The ampifyStory function is used behind the scenes by quintype/framework
It picks the correct story template and passes on control to renderToString
Parameters:
| Name | Type | Description |
|---|---|---|
params |
Object | [mandatory] object containing parameters |
story |
Object | [mandatory] story object |
publisherConfig |
Object | [mandatory] the publisher config - same as "/api/v1/config" |
ampConfig |
Object | [mandatory] AMP specific config coming from platform - same as "/api/v1/amp/config" |
seo |
String | ready to use SEO string that can be put in the document head |
opts |
Object | opts object containing customizations and configs |
the renderToString function
# applyTransforms()
transforms are functions provided optionally by the user that "transform" the amp html string generated by ampLib opts.transforms is an array of functions, executed left to right output of function at 0th index is given as input to the function at index 1 and so on
# extractAmpCustomStyles()
Extracts amp-custom style content from customMetaTags and returns:
- ampCustomStyles: the content inside