@mindful-web/marko-web 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +3 -0
- package/LICENSE +21 -0
- package/browser/.eslintrc.js +1 -0
- package/browser/components/element-id.js +1 -0
- package/browser/components/gated-download/wufoo.vue +97 -0
- package/browser/components/image-slide.vue +54 -0
- package/browser/components/image-slider.vue +87 -0
- package/browser/components/index.js +15 -0
- package/browser/components/load-more-trigger.vue +129 -0
- package/browser/components/oembed.vue +133 -0
- package/browser/components/trigger-in-view-event.vue +41 -0
- package/browser/components/trigger-screen-change-event.vue +94 -0
- package/browser/event-bus.js +5 -0
- package/browser/index.js +83 -0
- package/browser/jquery-full.js +3 -0
- package/browser/jquery.js +3 -0
- package/browser/utils/clean-path.js +4 -0
- package/browser/vue.js +3 -0
- package/components/browser-component/script.marko +10 -0
- package/components/browser-component/script.marko.js +39 -0
- package/components/browser-component.marko +25 -0
- package/components/browser-component.marko.js +75 -0
- package/components/deferred-stylesheet.marko +6 -0
- package/components/deferred-stylesheet.marko.js +28 -0
- package/components/document/components/body-wrapper.marko +8 -0
- package/components/document/components/body-wrapper.marko.js +33 -0
- package/components/document/components/error.marko +26 -0
- package/components/document/components/error.marko.js +88 -0
- package/components/document/components/live-reload.marko +7 -0
- package/components/document/components/live-reload.marko.js +30 -0
- package/components/document/components/polyfill.marko +8 -0
- package/components/document/components/polyfill.marko.js +33 -0
- package/components/document/components/styles.marko +20 -0
- package/components/document/components/styles.marko.js +61 -0
- package/components/document/container.marko +15 -0
- package/components/document/container.marko.js +54 -0
- package/components/document/index.marko +63 -0
- package/components/document/index.marko.js +139 -0
- package/components/document/marko.json +46 -0
- package/components/element/array.marko +19 -0
- package/components/element/array.marko.js +67 -0
- package/components/element/audio.marko +5 -0
- package/components/element/audio.marko.js +33 -0
- package/components/element/block.marko +11 -0
- package/components/element/block.marko.js +44 -0
- package/components/element/clear.marko +4 -0
- package/components/element/clear.marko.js +32 -0
- package/components/element/components/image.marko +32 -0
- package/components/element/components/image.marko.js +62 -0
- package/components/element/components/text.marko +11 -0
- package/components/element/components/text.marko.js +37 -0
- package/components/element/content/address1.marko +14 -0
- package/components/element/content/address1.marko.js +40 -0
- package/components/element/content/address2.marko +14 -0
- package/components/element/content/address2.marko.js +40 -0
- package/components/element/content/audio.marko +13 -0
- package/components/element/content/audio.marko.js +39 -0
- package/components/element/content/authors.marko +12 -0
- package/components/element/content/authors.marko.js +43 -0
- package/components/element/content/body.marko +28 -0
- package/components/element/content/body.marko.js +66 -0
- package/components/element/content/byline.marko +15 -0
- package/components/element/content/byline.marko.js +41 -0
- package/components/element/content/city-state-zip.marko +14 -0
- package/components/element/content/city-state-zip.marko.js +40 -0
- package/components/element/content/contributors.marko +12 -0
- package/components/element/content/contributors.marko.js +43 -0
- package/components/element/content/country.marko +14 -0
- package/components/element/content/country.marko.js +40 -0
- package/components/element/content/embed-code.marko +15 -0
- package/components/element/content/embed-code.marko.js +41 -0
- package/components/element/content/end-date.marko +17 -0
- package/components/element/content/end-date.marko.js +43 -0
- package/components/element/content/ends.marko +14 -0
- package/components/element/content/ends.marko.js +40 -0
- package/components/element/content/fax.marko +14 -0
- package/components/element/content/fax.marko.js +40 -0
- package/components/element/content/images.marko +12 -0
- package/components/element/content/images.marko.js +43 -0
- package/components/element/content/marko.json +328 -0
- package/components/element/content/mobile.marko +14 -0
- package/components/element/content/mobile.marko.js +40 -0
- package/components/element/content/name.marko +15 -0
- package/components/element/content/name.marko.js +41 -0
- package/components/element/content/phone.marko +14 -0
- package/components/element/content/phone.marko.js +40 -0
- package/components/element/content/photographers.marko +12 -0
- package/components/element/content/photographers.marko.js +43 -0
- package/components/element/content/public-email.marko +19 -0
- package/components/element/content/public-email.marko.js +47 -0
- package/components/element/content/published.marko +17 -0
- package/components/element/content/published.marko.js +43 -0
- package/components/element/content/short-name.marko +15 -0
- package/components/element/content/short-name.marko.js +41 -0
- package/components/element/content/sidebar-stubs.marko +24 -0
- package/components/element/content/sidebar-stubs.marko.js +63 -0
- package/components/element/content/sidebars.marko +27 -0
- package/components/element/content/sidebars.marko.js +63 -0
- package/components/element/content/source.marko +14 -0
- package/components/element/content/source.marko.js +40 -0
- package/components/element/content/sponsors.marko +12 -0
- package/components/element/content/sponsors.marko.js +43 -0
- package/components/element/content/start-date.marko +17 -0
- package/components/element/content/start-date.marko.js +43 -0
- package/components/element/content/starts.marko +14 -0
- package/components/element/content/starts.marko.js +40 -0
- package/components/element/content/teaser.marko +15 -0
- package/components/element/content/teaser.marko.js +41 -0
- package/components/element/content/title.marko +14 -0
- package/components/element/content/title.marko.js +40 -0
- package/components/element/content/tollfree.marko +14 -0
- package/components/element/content/tollfree.marko.js +40 -0
- package/components/element/content/transcript.marko +22 -0
- package/components/element/content/transcript.marko.js +53 -0
- package/components/element/content/website.marko +22 -0
- package/components/element/content/website.marko.js +51 -0
- package/components/element/date.marko +2 -0
- package/components/element/date.marko.js +27 -0
- package/components/element/extract-render.js +1 -0
- package/components/element/image/caption.marko +15 -0
- package/components/element/image/caption.marko.js +41 -0
- package/components/element/image/credit.marko +15 -0
- package/components/element/image/credit.marko.js +41 -0
- package/components/element/image/display-name.marko +14 -0
- package/components/element/image/display-name.marko.js +40 -0
- package/components/element/image/marko.json +38 -0
- package/components/element/image/slider.marko +18 -0
- package/components/element/image/slider.marko.js +50 -0
- package/components/element/img.marko +12 -0
- package/components/element/img.marko.js +43 -0
- package/components/element/index.marko +12 -0
- package/components/element/index.marko.js +47 -0
- package/components/element/link.marko +25 -0
- package/components/element/link.marko.js +54 -0
- package/components/element/magazine-issue/description.marko +14 -0
- package/components/element/magazine-issue/description.marko.js +40 -0
- package/components/element/magazine-issue/digital-edition-url.marko +22 -0
- package/components/element/magazine-issue/digital-edition-url.marko.js +51 -0
- package/components/element/magazine-issue/marko.json +42 -0
- package/components/element/magazine-issue/name.marko +14 -0
- package/components/element/magazine-issue/name.marko.js +40 -0
- package/components/element/magazine-issue/pdf-url.marko +22 -0
- package/components/element/magazine-issue/pdf-url.marko.js +51 -0
- package/components/element/magazine-publication/cancel-url.marko +22 -0
- package/components/element/magazine-publication/cancel-url.marko.js +51 -0
- package/components/element/magazine-publication/change-address-url.marko +22 -0
- package/components/element/magazine-publication/change-address-url.marko.js +51 -0
- package/components/element/magazine-publication/description.marko +14 -0
- package/components/element/magazine-publication/description.marko.js +40 -0
- package/components/element/magazine-publication/einquiry-url.marko +22 -0
- package/components/element/magazine-publication/einquiry-url.marko.js +51 -0
- package/components/element/magazine-publication/marko.json +82 -0
- package/components/element/magazine-publication/name.marko +14 -0
- package/components/element/magazine-publication/name.marko.js +40 -0
- package/components/element/magazine-publication/renewal-url.marko +22 -0
- package/components/element/magazine-publication/renewal-url.marko.js +51 -0
- package/components/element/magazine-publication/reprints-url.marko +22 -0
- package/components/element/magazine-publication/reprints-url.marko.js +51 -0
- package/components/element/magazine-publication/subscribe-url.marko +22 -0
- package/components/element/magazine-publication/subscribe-url.marko.js +51 -0
- package/components/element/marko.json +211 -0
- package/components/element/obj-array.marko +17 -0
- package/components/element/obj-array.marko.js +56 -0
- package/components/element/obj-audio.marko +20 -0
- package/components/element/obj-audio.marko.js +50 -0
- package/components/element/obj-date.marko +25 -0
- package/components/element/obj-date.marko.js +55 -0
- package/components/element/obj-nodes.marko +20 -0
- package/components/element/obj-nodes.marko.js +62 -0
- package/components/element/obj-text.marko +23 -0
- package/components/element/obj-text.marko.js +53 -0
- package/components/element/obj.marko +23 -0
- package/components/element/obj.marko.js +61 -0
- package/components/element/object-link.js +49 -0
- package/components/element/object-type.js +9 -0
- package/components/element/picture.marko +38 -0
- package/components/element/picture.marko.js +85 -0
- package/components/element/show-element.js +8 -0
- package/components/element/text.marko +37 -0
- package/components/element/text.marko.js +76 -0
- package/components/element/website-section/description.marko +16 -0
- package/components/element/website-section/description.marko.js +44 -0
- package/components/element/website-section/hierarchy.marko +19 -0
- package/components/element/website-section/hierarchy.marko.js +60 -0
- package/components/element/website-section/marko.json +31 -0
- package/components/element/website-section/name.marko +18 -0
- package/components/element/website-section/name.marko.js +46 -0
- package/components/font/google.marko +6 -0
- package/components/font/google.marko.js +41 -0
- package/components/font/link.marko +14 -0
- package/components/font/link.marko.js +45 -0
- package/components/font/marko.json +21 -0
- package/components/font/typekit.marko +5 -0
- package/components/font/typekit.marko.js +38 -0
- package/components/load-more/index.marko +53 -0
- package/components/load-more/index.marko.js +119 -0
- package/components/load-more/marko.json +30 -0
- package/components/load-more/trigger.marko +11 -0
- package/components/load-more/trigger.marko.js +40 -0
- package/components/marko.json +37 -0
- package/components/node/body.marko +40 -0
- package/components/node/body.marko.js +112 -0
- package/components/node/element.marko +6 -0
- package/components/node/element.marko.js +39 -0
- package/components/node/footer.marko +19 -0
- package/components/node/footer.marko.js +63 -0
- package/components/node/header.marko +19 -0
- package/components/node/header.marko.js +63 -0
- package/components/node/image-inner-wrapper.marko +61 -0
- package/components/node/image-inner-wrapper.marko.js +116 -0
- package/components/node/image-wrapper.marko +34 -0
- package/components/node/image-wrapper.marko.js +98 -0
- package/components/node/image.marko +51 -0
- package/components/node/image.marko.js +93 -0
- package/components/node/index.marko +35 -0
- package/components/node/index.marko.js +100 -0
- package/components/node/marko.json +189 -0
- package/components/node/utils/image-height.js +3 -0
- package/components/node/utils/image-values.js +17 -0
- package/components/node-list/body.marko +19 -0
- package/components/node-list/body.marko.js +50 -0
- package/components/node-list/element.marko +3 -0
- package/components/node-list/element.marko.js +35 -0
- package/components/node-list/footer.marko +19 -0
- package/components/node-list/footer.marko.js +50 -0
- package/components/node-list/header.marko +19 -0
- package/components/node-list/header.marko.js +50 -0
- package/components/node-list/index.marko +36 -0
- package/components/node-list/index.marko.js +93 -0
- package/components/node-list/marko.json +121 -0
- package/components/node-list/node.marko +15 -0
- package/components/node-list/node.marko.js +49 -0
- package/components/node-list/nodes.marko +82 -0
- package/components/node-list/nodes.marko.js +126 -0
- package/components/page/container.marko +13 -0
- package/components/page/container.marko.js +46 -0
- package/components/page/description.marko +4 -0
- package/components/page/description.marko.js +26 -0
- package/components/page/image.marko +50 -0
- package/components/page/image.marko.js +122 -0
- package/components/page/layouts/content.marko +23 -0
- package/components/page/layouts/content.marko.js +63 -0
- package/components/page/layouts/default.marko +20 -0
- package/components/page/layouts/default.marko.js +61 -0
- package/components/page/layouts/dynamic-page.marko +19 -0
- package/components/page/layouts/dynamic-page.marko.js +59 -0
- package/components/page/layouts/magazine-issue.marko +19 -0
- package/components/page/layouts/magazine-issue.marko.js +59 -0
- package/components/page/layouts/magazine-publication.marko +19 -0
- package/components/page/layouts/magazine-publication.marko.js +59 -0
- package/components/page/layouts/marko.json +86 -0
- package/components/page/layouts/website-section.marko +25 -0
- package/components/page/layouts/website-section.marko.js +78 -0
- package/components/page/marko.json +93 -0
- package/components/page/metadata/components/common.marko +54 -0
- package/components/page/metadata/components/common.marko.js +117 -0
- package/components/page/metadata/content.marko +147 -0
- package/components/page/metadata/content.marko.js +216 -0
- package/components/page/metadata/default.marko +2 -0
- package/components/page/metadata/default.marko.js +29 -0
- package/components/page/metadata/dynamic-page.marko +40 -0
- package/components/page/metadata/dynamic-page.marko.js +84 -0
- package/components/page/metadata/google-structured-data/content.js +138 -0
- package/components/page/metadata/magazine-issue.marko +39 -0
- package/components/page/metadata/magazine-issue.marko.js +83 -0
- package/components/page/metadata/magazine-publication.marko +35 -0
- package/components/page/metadata/magazine-publication.marko.js +79 -0
- package/components/page/metadata/marko.json +32 -0
- package/components/page/metadata/website-section.marko +48 -0
- package/components/page/metadata/website-section.marko.js +92 -0
- package/components/page/rel-canonical.marko +13 -0
- package/components/page/rel-canonical.marko.js +42 -0
- package/components/page/title.marko +18 -0
- package/components/page/title.marko.js +46 -0
- package/components/page/wrapper.marko +16 -0
- package/components/page/wrapper.marko.js +63 -0
- package/components/resolve/marko.json +6 -0
- package/components/resolve/page.marko +10 -0
- package/components/resolve/page.marko.js +49 -0
- package/components/rss/marko.json +10 -0
- package/components/rss/website-section.marko +17 -0
- package/components/rss/website-section.marko.js +46 -0
- package/config/abstract-config.js +42 -0
- package/config/core.js +48 -0
- package/config/site.js +6 -0
- package/express/apollo.js +34 -0
- package/express/asset-loader.js +55 -0
- package/express/cdn.js +27 -0
- package/express/css-loader.js +117 -0
- package/express/embedded-media.js +31 -0
- package/express/error-handlers.js +113 -0
- package/express/find-content-alias.js +30 -0
- package/express/get-redirect.js +44 -0
- package/express/graphql-proxy.js +17 -0
- package/express/index.js +153 -0
- package/express/json-error-handler.js +30 -0
- package/express/load-document.js +3 -0
- package/express/load-more.js +6 -0
- package/express/load-object.js +10 -0
- package/express/oembed.js +18 -0
- package/express/rss.js +19 -0
- package/express/sitemaps.js +16 -0
- package/express/website-context.js +19 -0
- package/index.js +8 -0
- package/integration/test-website-boot.js +198 -0
- package/marko.json +6 -0
- package/middleware/disabled-features.js +15 -0
- package/middleware/index.js +15 -0
- package/middleware/page-node/index.js +45 -0
- package/middleware/page-node/resolved.js +26 -0
- package/middleware/with-content.js +54 -0
- package/middleware/with-dynamic-page.js +37 -0
- package/middleware/with-load-more.js +9 -0
- package/middleware/with-magazine-issue.js +24 -0
- package/middleware/with-magazine-publication.js +24 -0
- package/middleware/with-website-section.js +47 -0
- package/package.json +64 -0
- package/scss/carousel.scss +42 -0
- package/scss/document.scss +55 -0
- package/scss/fonts/alata-fallback.scss +7 -0
- package/scss/fonts/alegreya-fallback.scss +6 -0
- package/scss/fonts/arimo-fallback.scss +7 -0
- package/scss/fonts/fira-sans-fallback.scss +7 -0
- package/scss/fonts/ibm-plex-sans-fallback.scss +7 -0
- package/scss/fonts/informapro-fallback.scss +6 -0
- package/scss/fonts/lato-fallback.scss +7 -0
- package/scss/fonts/manrope-fallback.scss +6 -0
- package/scss/fonts/merriweather-fallback.scss +7 -0
- package/scss/fonts/montserrat-fallback.scss +7 -0
- package/scss/fonts/open-sans-condensed-fallback.scss +6 -0
- package/scss/fonts/open-sans-fallback.scss +7 -0
- package/scss/fonts/oswald-fallback.scss +7 -0
- package/scss/fonts/poppins-fallback.scss +6 -0
- package/scss/fonts/pt-sans-fallback.scss +6 -0
- package/scss/fonts/pt-serif-fallback.scss +6 -0
- package/scss/fonts/public-sans-fallback.scss +7 -0
- package/scss/fonts/raleway-fallback.scss +6 -0
- package/scss/fonts/roboto-condensed-fallback.scss +7 -0
- package/scss/fonts/roboto-fallback.scss +7 -0
- package/scss/fonts/roboto-slab-fallback.scss +7 -0
- package/scss/fonts/solitaire-mvb-pro-fallback.scss +6 -0
- package/scss/fonts/source-sans-4-fallback.scss +7 -0
- package/scss/fonts/source-serif-pro-fallback.scss +7 -0
- package/scss/fonts/synthese-fallback.scss +6 -0
- package/scss/fonts/zilla-slab-fallback.scss +6 -0
- package/scss/load-more.scss +3 -0
- package/scss/node-list.scss +144 -0
- package/scss/node.scss +371 -0
- package/scss/page-image.scss +15 -0
- package/start-server.js +169 -0
- package/utils/apply-query-params.js +16 -0
- package/utils/build-content-input.js +9 -0
- package/utils/build-marko-global.js +1 -0
- package/utils/default-value.js +1 -0
- package/utils/embedded-media/facebook-oembed.js +50 -0
- package/utils/embedded-media/image.js +71 -0
- package/utils/embedded-media/index.js +8 -0
- package/utils/embedded-media/instagram-oembed.js +57 -0
- package/utils/embedded-media/oembed.js +18 -0
- package/utils/hierarchy-aliases.js +3 -0
- package/utils/hierarchy-ids.js +3 -0
- package/utils/index.js +11 -0
- package/utils/is-dev.js +1 -0
- package/utils/published-content/description.js +1 -0
- package/utils/render-ssr-component-from-marko.js +18 -0
- package/utils/render-ssr-component.js +15 -0
- package/utils/should-collapse.js +1 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
$ const { config } = out.global;
|
|
2
|
+
$ const {
|
|
3
|
+
title,
|
|
4
|
+
canonicalPath,
|
|
5
|
+
canonicalUrl,
|
|
6
|
+
imageSrc,
|
|
7
|
+
imageDimensions,
|
|
8
|
+
description,
|
|
9
|
+
noIndex,
|
|
10
|
+
} = input;
|
|
11
|
+
$ const fallbackImage = config.fallbackImage();
|
|
12
|
+
$ const image = imageSrc || fallbackImage;
|
|
13
|
+
|
|
14
|
+
<!-- Standard Fields -->
|
|
15
|
+
<marko-web-page-title value=title />
|
|
16
|
+
<marko-web-page-description value=description />
|
|
17
|
+
<marko-web-page-rel-canonical path=canonicalPath url=canonicalUrl />
|
|
18
|
+
|
|
19
|
+
<!-- No Index Directive -->
|
|
20
|
+
<if(noIndex)>
|
|
21
|
+
<meta name="robots" content="noindex">
|
|
22
|
+
</if>
|
|
23
|
+
|
|
24
|
+
<!-- Name/Title (OpenGrah, and Schema.org respectively) -->
|
|
25
|
+
<if(title)>
|
|
26
|
+
<meta property="og:title" item-prop="name" content=title />
|
|
27
|
+
</if>
|
|
28
|
+
|
|
29
|
+
<if(image)>
|
|
30
|
+
<!-- Image (standard, OpenGrah, and Schema.org respectively) -->
|
|
31
|
+
<meta name="image" property="og:image" item-prop="image" content=image />
|
|
32
|
+
<if(imageDimensions && imageDimensions.width && imageDimensions.height)>
|
|
33
|
+
<meta property="og:image:width" content=`${imageDimensions.width}` />
|
|
34
|
+
<meta property="og:image:height" content=`${imageDimensions.height}` />
|
|
35
|
+
</if>
|
|
36
|
+
<!-- @todo Create a new focal point preview for FB's 1200x630 ratio -->
|
|
37
|
+
</if>
|
|
38
|
+
|
|
39
|
+
<!-- OpenGraph -->
|
|
40
|
+
<marko-web-page-rel-canonical|{ href }| path=canonicalPath url=canonicalUrl>
|
|
41
|
+
<meta property="og:url" content=href />
|
|
42
|
+
</marko-web-page-rel-canonical>
|
|
43
|
+
<meta property="og:site_name" content=config.website("name") />
|
|
44
|
+
<meta property="og:locale" content=config.website("language.primaryCode") />
|
|
45
|
+
|
|
46
|
+
<!-- Twitter -->
|
|
47
|
+
<meta name="twitter:card" content="summary_large_image" />
|
|
48
|
+
<meta name="twitter:title" content=title />
|
|
49
|
+
<if(description)>
|
|
50
|
+
<meta name="twitter:description" content=description />
|
|
51
|
+
</if>
|
|
52
|
+
<if(image)>
|
|
53
|
+
<meta name="twitter:image" content=image />
|
|
54
|
+
</if>
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// Compiled using marko@4.20.2 - DO NOT EDIT
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
|
5
|
+
marko_componentType = "/@mindful-web/marko-web$1.0.0/components/page/metadata/components/common.marko",
|
|
6
|
+
marko_component = require("./common.marko"),
|
|
7
|
+
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
|
8
|
+
marko_web_page_title_template = require("../../title.marko"),
|
|
9
|
+
marko_loadTag = require("marko/dist/runtime/helpers/load-tag"),
|
|
10
|
+
marko_web_page_title_tag = marko_loadTag(marko_web_page_title_template),
|
|
11
|
+
marko_web_page_description_template = require("../../description.marko"),
|
|
12
|
+
marko_web_page_description_tag = marko_loadTag(marko_web_page_description_template),
|
|
13
|
+
marko_web_page_rel_canonical_template = require("../../rel-canonical.marko"),
|
|
14
|
+
marko_web_page_rel_canonical_tag = marko_loadTag(marko_web_page_rel_canonical_template),
|
|
15
|
+
marko_attr = require("marko/dist/runtime/html/helpers/attr");
|
|
16
|
+
|
|
17
|
+
function render(input, out, __component, component, state) {
|
|
18
|
+
var data = input;
|
|
19
|
+
|
|
20
|
+
const { config } = out.global;
|
|
21
|
+
|
|
22
|
+
const {
|
|
23
|
+
title,
|
|
24
|
+
canonicalPath,
|
|
25
|
+
canonicalUrl,
|
|
26
|
+
imageSrc,
|
|
27
|
+
imageDimensions,
|
|
28
|
+
description,
|
|
29
|
+
noIndex,
|
|
30
|
+
} = input;
|
|
31
|
+
|
|
32
|
+
const fallbackImage = config.fallbackImage();
|
|
33
|
+
|
|
34
|
+
const image = imageSrc || fallbackImage;
|
|
35
|
+
|
|
36
|
+
marko_web_page_title_tag({
|
|
37
|
+
concatWith: "|",
|
|
38
|
+
value: title
|
|
39
|
+
}, out, __component, "0");
|
|
40
|
+
|
|
41
|
+
marko_web_page_description_tag({
|
|
42
|
+
value: description
|
|
43
|
+
}, out, __component, "1");
|
|
44
|
+
|
|
45
|
+
marko_web_page_rel_canonical_tag({
|
|
46
|
+
path: canonicalPath,
|
|
47
|
+
url: canonicalUrl
|
|
48
|
+
}, out, __component, "2");
|
|
49
|
+
|
|
50
|
+
if (noIndex) {
|
|
51
|
+
out.w("<meta name=\"robots\" content=\"noindex\">");
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (title) {
|
|
55
|
+
out.w("<meta property=\"og:title\" item-prop=\"name\"" +
|
|
56
|
+
marko_attr("content", title) +
|
|
57
|
+
">");
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (image) {
|
|
61
|
+
out.w("<meta name=\"image\" property=\"og:image\" item-prop=\"image\"" +
|
|
62
|
+
marko_attr("content", image) +
|
|
63
|
+
">");
|
|
64
|
+
|
|
65
|
+
if ((imageDimensions && imageDimensions.width) && imageDimensions.height) {
|
|
66
|
+
out.w("<meta property=\"og:image:width\"" +
|
|
67
|
+
marko_attr("content", "" + imageDimensions.width) +
|
|
68
|
+
"><meta property=\"og:image:height\"" +
|
|
69
|
+
marko_attr("content", "" + imageDimensions.height) +
|
|
70
|
+
">");
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
marko_web_page_rel_canonical_tag({
|
|
75
|
+
path: canonicalPath,
|
|
76
|
+
url: canonicalUrl,
|
|
77
|
+
renderBody: function(out, { href }) {
|
|
78
|
+
out.w("<meta property=\"og:url\"" +
|
|
79
|
+
marko_attr("content", href) +
|
|
80
|
+
">");
|
|
81
|
+
}
|
|
82
|
+
}, out, __component, "8");
|
|
83
|
+
|
|
84
|
+
out.w("<meta property=\"og:site_name\"" +
|
|
85
|
+
marko_attr("content", config.website("name")) +
|
|
86
|
+
"><meta property=\"og:locale\"" +
|
|
87
|
+
marko_attr("content", config.website("language.primaryCode")) +
|
|
88
|
+
"><meta name=\"twitter:card\" content=\"summary_large_image\"><meta name=\"twitter:title\"" +
|
|
89
|
+
marko_attr("content", title) +
|
|
90
|
+
">");
|
|
91
|
+
|
|
92
|
+
if (description) {
|
|
93
|
+
out.w("<meta name=\"twitter:description\"" +
|
|
94
|
+
marko_attr("content", description) +
|
|
95
|
+
">");
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (image) {
|
|
99
|
+
out.w("<meta name=\"twitter:image\"" +
|
|
100
|
+
marko_attr("content", image) +
|
|
101
|
+
">");
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
marko_template._ = marko_renderer(render, {
|
|
106
|
+
e_: marko_componentType
|
|
107
|
+
}, marko_component);
|
|
108
|
+
|
|
109
|
+
marko_template.meta = {
|
|
110
|
+
id: "/@mindful-web/marko-web$1.0.0/components/page/metadata/components/common.marko",
|
|
111
|
+
component: "./common.marko",
|
|
112
|
+
tags: [
|
|
113
|
+
"../../title.marko",
|
|
114
|
+
"../../description.marko",
|
|
115
|
+
"../../rel-canonical.marko"
|
|
116
|
+
]
|
|
117
|
+
};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import gql from "graphql-tag";
|
|
2
|
+
import { get } from "@mindful-web/object-path";
|
|
3
|
+
import { warn, isFunction } from "@mindful-web/utils";
|
|
4
|
+
import { extractFragmentData } from "@mindful-web/web-common/src/utils";
|
|
5
|
+
import defaultBuildStructuredData from "./google-structured-data/content";
|
|
6
|
+
|
|
7
|
+
<!-- @todo This data should generated and saved to the content object as flat data, so no relationships are required. -->
|
|
8
|
+
|
|
9
|
+
$ const { config } = out.global;
|
|
10
|
+
$ const { id, structuredDataQueryFragment } = input;
|
|
11
|
+
$ const { spreadFragmentName, processedFragment } = extractFragmentData(structuredDataQueryFragment);
|
|
12
|
+
$ const queryFragment = gql`
|
|
13
|
+
fragment ContentPageMetadataFragment on Content {
|
|
14
|
+
id
|
|
15
|
+
type
|
|
16
|
+
siteContext {
|
|
17
|
+
url
|
|
18
|
+
path
|
|
19
|
+
canonicalUrl
|
|
20
|
+
noIndex
|
|
21
|
+
}
|
|
22
|
+
published
|
|
23
|
+
updated
|
|
24
|
+
metadata {
|
|
25
|
+
title
|
|
26
|
+
description
|
|
27
|
+
publishedDate
|
|
28
|
+
updatedDate
|
|
29
|
+
expiresDate
|
|
30
|
+
image {
|
|
31
|
+
id
|
|
32
|
+
src(input: { options: { auto: "format,compress", w: "1200", fit: "max", q: 70 } })
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
userRegistration {
|
|
36
|
+
isCurrentlyRequired
|
|
37
|
+
}
|
|
38
|
+
... on ContentVideo {
|
|
39
|
+
embedSrc
|
|
40
|
+
transcript
|
|
41
|
+
}
|
|
42
|
+
primarySite {
|
|
43
|
+
id
|
|
44
|
+
}
|
|
45
|
+
... on ContentPodcast {
|
|
46
|
+
fileSrc
|
|
47
|
+
fileName
|
|
48
|
+
transcript
|
|
49
|
+
}
|
|
50
|
+
... on ContentWebinar {
|
|
51
|
+
transcript
|
|
52
|
+
}
|
|
53
|
+
... on Authorable {
|
|
54
|
+
authors {
|
|
55
|
+
edges {
|
|
56
|
+
node {
|
|
57
|
+
id
|
|
58
|
+
name
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
... on Addressable {
|
|
64
|
+
address1
|
|
65
|
+
address2
|
|
66
|
+
city
|
|
67
|
+
state
|
|
68
|
+
zip
|
|
69
|
+
country
|
|
70
|
+
}
|
|
71
|
+
... on Contactable {
|
|
72
|
+
phone
|
|
73
|
+
tollfree
|
|
74
|
+
fax
|
|
75
|
+
website
|
|
76
|
+
title
|
|
77
|
+
mobile
|
|
78
|
+
email: publicEmail
|
|
79
|
+
}
|
|
80
|
+
images(input:{ pagination: { limit: 0 }, sort: { order: values } }) {
|
|
81
|
+
edges {
|
|
82
|
+
node {
|
|
83
|
+
id
|
|
84
|
+
src(input: { options: { auto: "format,compress", w: "1200", fit: "max", q: 70 } })
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
${spreadFragmentName}
|
|
89
|
+
}
|
|
90
|
+
${processedFragment}
|
|
91
|
+
`;
|
|
92
|
+
|
|
93
|
+
$ const buildStructuredData = isFunction(input.buildStructuredData) ? input.buildStructuredData : defaultBuildStructuredData;
|
|
94
|
+
$ const defaultFn = ({ content }) => get(content, 'userRegistration.isCurrentlyRequired', false);
|
|
95
|
+
$ const { contentGatingHandler: globalContentGatingHandler } = out.global;
|
|
96
|
+
$ const contentGatingHandler = isFunction(globalContentGatingHandler) ? globalContentGatingHandler : defaultFn;
|
|
97
|
+
|
|
98
|
+
<if(id)>
|
|
99
|
+
<marko-web-query|{ node }| name="content" params={ id, queryFragment }>
|
|
100
|
+
$ const metadata = {
|
|
101
|
+
type: node.type,
|
|
102
|
+
title: get(node, "metadata.title"),
|
|
103
|
+
description: get(node, "metadata.description"),
|
|
104
|
+
canonicalPath: get(node, "siteContext.path"),
|
|
105
|
+
canonicalUrl: get(node, "siteContext.canonicalUrl"),
|
|
106
|
+
noIndex: get(node, "siteContext.noIndex") || config.website("id") !== get(node, "primarySite.id"),
|
|
107
|
+
imageSrc: get(node, "metadata.image.src"),
|
|
108
|
+
};
|
|
109
|
+
$ const publishedDate = get(node, "metadata.publishedDate");
|
|
110
|
+
$ const updatedDate = get(node, "metadata.updatedDate");
|
|
111
|
+
$ const expiresDate = get(node, "metadata.expiresDate");
|
|
112
|
+
|
|
113
|
+
<common ...metadata />
|
|
114
|
+
<if(node.type === "video")>
|
|
115
|
+
<meta property="og:type" content="video.other" />
|
|
116
|
+
<if(publishedDate)>
|
|
117
|
+
<meta property="video:release_date" content=publishedDate />
|
|
118
|
+
</if>
|
|
119
|
+
</if>
|
|
120
|
+
<else>
|
|
121
|
+
<meta property="og:type" content="article" />
|
|
122
|
+
<if(publishedDate)>
|
|
123
|
+
<meta property="article:published_time" content=publishedDate />
|
|
124
|
+
</if>
|
|
125
|
+
<if(updatedDate)>
|
|
126
|
+
<meta property="article:modified_time" content=updatedDate />
|
|
127
|
+
</if>
|
|
128
|
+
<if(expiresDate)>
|
|
129
|
+
<meta property="article:expiration_time" content=expiresDate />
|
|
130
|
+
</if>
|
|
131
|
+
</else>
|
|
132
|
+
|
|
133
|
+
$ const structuredData = buildStructuredData(node, contentGatingHandler);
|
|
134
|
+
<if(structuredData)>
|
|
135
|
+
<script type="application/ld+json">
|
|
136
|
+
${structuredData}
|
|
137
|
+
</script>
|
|
138
|
+
</if>
|
|
139
|
+
|
|
140
|
+
<@when-empty>
|
|
141
|
+
$ warn(`Unable to create content metadata: no content found for ${id}.`);
|
|
142
|
+
</@when-empty>
|
|
143
|
+
</marko-web-query>
|
|
144
|
+
</if>
|
|
145
|
+
<else>
|
|
146
|
+
$ warn('Unable to create content metadata: no content id was provided.');
|
|
147
|
+
</else>
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
// Compiled using marko@4.20.2 - DO NOT EDIT
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
|
5
|
+
marko_componentType = "/@mindful-web/marko-web$1.0.0/components/page/metadata/content.marko",
|
|
6
|
+
marko_component = require("./content.marko"),
|
|
7
|
+
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
|
8
|
+
module_gql = require("graphql-tag"),
|
|
9
|
+
gql = module_gql.default || module_gql,
|
|
10
|
+
module_objectPath_module = require("@mindful-web/object-path"),
|
|
11
|
+
objectPath_module = module_objectPath_module.default || module_objectPath_module,
|
|
12
|
+
get = module_objectPath_module.get,
|
|
13
|
+
module_utils_module = require("@mindful-web/utils"),
|
|
14
|
+
utils_module = module_utils_module.default || module_utils_module,
|
|
15
|
+
warn = module_utils_module.warn,
|
|
16
|
+
isFunction = module_utils_module.isFunction,
|
|
17
|
+
module_utils_module2 = require("@mindful-web/web-common/src/utils"),
|
|
18
|
+
extractFragmentData = module_utils_module2.extractFragmentData,
|
|
19
|
+
module_defaultBuildStructuredData = require("./google-structured-data/content"),
|
|
20
|
+
defaultBuildStructuredData = module_defaultBuildStructuredData.default || module_defaultBuildStructuredData,
|
|
21
|
+
common_template = require("./components/common.marko"),
|
|
22
|
+
marko_loadTag = require("marko/dist/runtime/helpers/load-tag"),
|
|
23
|
+
common_tag = marko_loadTag(common_template),
|
|
24
|
+
marko_attr = require("marko/dist/runtime/html/helpers/attr"),
|
|
25
|
+
helpers_escape_xml = require("marko/dist/runtime/html/helpers/escape-xml"),
|
|
26
|
+
marko_escapeXml = helpers_escape_xml.x,
|
|
27
|
+
marko_escapeScript = require("marko/dist/runtime/html/helpers/escape-script-placeholder"),
|
|
28
|
+
marko_web_query_template = require("@mindful-web/marko-core/components/queries/index.marko"),
|
|
29
|
+
marko_web_query_tag = marko_loadTag(marko_web_query_template);
|
|
30
|
+
|
|
31
|
+
function render(input, out, __component, component, state) {
|
|
32
|
+
var data = input;
|
|
33
|
+
|
|
34
|
+
const { config } = out.global;
|
|
35
|
+
|
|
36
|
+
const { id, structuredDataQueryFragment } = input;
|
|
37
|
+
|
|
38
|
+
const { spreadFragmentName, processedFragment } = extractFragmentData(structuredDataQueryFragment);
|
|
39
|
+
|
|
40
|
+
const queryFragment = gql`
|
|
41
|
+
fragment ContentPageMetadataFragment on Content {
|
|
42
|
+
id
|
|
43
|
+
type
|
|
44
|
+
siteContext {
|
|
45
|
+
url
|
|
46
|
+
path
|
|
47
|
+
canonicalUrl
|
|
48
|
+
noIndex
|
|
49
|
+
}
|
|
50
|
+
published
|
|
51
|
+
updated
|
|
52
|
+
metadata {
|
|
53
|
+
title
|
|
54
|
+
description
|
|
55
|
+
publishedDate
|
|
56
|
+
updatedDate
|
|
57
|
+
expiresDate
|
|
58
|
+
image {
|
|
59
|
+
id
|
|
60
|
+
src(input: { options: { auto: "format,compress", w: "1200", fit: "max", q: 70 } })
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
userRegistration {
|
|
64
|
+
isCurrentlyRequired
|
|
65
|
+
}
|
|
66
|
+
... on ContentVideo {
|
|
67
|
+
embedSrc
|
|
68
|
+
transcript
|
|
69
|
+
}
|
|
70
|
+
primarySite {
|
|
71
|
+
id
|
|
72
|
+
}
|
|
73
|
+
... on ContentPodcast {
|
|
74
|
+
fileSrc
|
|
75
|
+
fileName
|
|
76
|
+
transcript
|
|
77
|
+
}
|
|
78
|
+
... on ContentWebinar {
|
|
79
|
+
transcript
|
|
80
|
+
}
|
|
81
|
+
... on Authorable {
|
|
82
|
+
authors {
|
|
83
|
+
edges {
|
|
84
|
+
node {
|
|
85
|
+
id
|
|
86
|
+
name
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
... on Addressable {
|
|
92
|
+
address1
|
|
93
|
+
address2
|
|
94
|
+
city
|
|
95
|
+
state
|
|
96
|
+
zip
|
|
97
|
+
country
|
|
98
|
+
}
|
|
99
|
+
... on Contactable {
|
|
100
|
+
phone
|
|
101
|
+
tollfree
|
|
102
|
+
fax
|
|
103
|
+
website
|
|
104
|
+
title
|
|
105
|
+
mobile
|
|
106
|
+
email: publicEmail
|
|
107
|
+
}
|
|
108
|
+
images(input:{ pagination: { limit: 0 }, sort: { order: values } }) {
|
|
109
|
+
edges {
|
|
110
|
+
node {
|
|
111
|
+
id
|
|
112
|
+
src(input: { options: { auto: "format,compress", w: "1200", fit: "max", q: 70 } })
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
${spreadFragmentName}
|
|
117
|
+
}
|
|
118
|
+
${processedFragment}
|
|
119
|
+
`;
|
|
120
|
+
|
|
121
|
+
const buildStructuredData = isFunction(input.buildStructuredData) ? input.buildStructuredData : defaultBuildStructuredData;
|
|
122
|
+
|
|
123
|
+
const defaultFn = ({ content }) => get(content, 'userRegistration.isCurrentlyRequired', false);
|
|
124
|
+
|
|
125
|
+
const { contentGatingHandler: globalContentGatingHandler } = out.global;
|
|
126
|
+
|
|
127
|
+
const contentGatingHandler = isFunction(globalContentGatingHandler) ? globalContentGatingHandler : defaultFn;
|
|
128
|
+
|
|
129
|
+
if (id) {
|
|
130
|
+
marko_web_query_tag({
|
|
131
|
+
collapsible: true,
|
|
132
|
+
name: "content",
|
|
133
|
+
params: {
|
|
134
|
+
id: id,
|
|
135
|
+
queryFragment: queryFragment
|
|
136
|
+
},
|
|
137
|
+
whenEmpty: {
|
|
138
|
+
renderBody: function(out) {
|
|
139
|
+
warn(`Unable to create content metadata: no content found for ${id}.`);
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
renderBody: function(out, { node }) {
|
|
143
|
+
const metadata = {
|
|
144
|
+
type: node.type,
|
|
145
|
+
title: get(node, "metadata.title"),
|
|
146
|
+
description: get(node, "metadata.description"),
|
|
147
|
+
canonicalPath: get(node, "siteContext.path"),
|
|
148
|
+
canonicalUrl: get(node, "siteContext.canonicalUrl"),
|
|
149
|
+
noIndex: get(node, "siteContext.noIndex") || config.website("id") !== get(node, "primarySite.id"),
|
|
150
|
+
imageSrc: get(node, "metadata.image.src"),
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const publishedDate = get(node, "metadata.publishedDate");
|
|
154
|
+
|
|
155
|
+
const updatedDate = get(node, "metadata.updatedDate");
|
|
156
|
+
|
|
157
|
+
const expiresDate = get(node, "metadata.expiresDate");
|
|
158
|
+
|
|
159
|
+
common_tag(metadata, out, __component, "1");
|
|
160
|
+
|
|
161
|
+
if (node.type === "video") {
|
|
162
|
+
out.w("<meta property=\"og:type\" content=\"video.other\">");
|
|
163
|
+
|
|
164
|
+
if (publishedDate) {
|
|
165
|
+
out.w("<meta property=\"video:release_date\"" +
|
|
166
|
+
marko_attr("content", publishedDate) +
|
|
167
|
+
">");
|
|
168
|
+
}
|
|
169
|
+
} else {
|
|
170
|
+
out.w("<meta property=\"og:type\" content=\"article\">");
|
|
171
|
+
|
|
172
|
+
if (publishedDate) {
|
|
173
|
+
out.w("<meta property=\"article:published_time\"" +
|
|
174
|
+
marko_attr("content", publishedDate) +
|
|
175
|
+
">");
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (updatedDate) {
|
|
179
|
+
out.w("<meta property=\"article:modified_time\"" +
|
|
180
|
+
marko_attr("content", updatedDate) +
|
|
181
|
+
">");
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
if (expiresDate) {
|
|
185
|
+
out.w("<meta property=\"article:expiration_time\"" +
|
|
186
|
+
marko_attr("content", expiresDate) +
|
|
187
|
+
">");
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
const structuredData = buildStructuredData(node, contentGatingHandler);
|
|
192
|
+
|
|
193
|
+
if (structuredData) {
|
|
194
|
+
out.w("<script type=\"application/ld+json\">" +
|
|
195
|
+
marko_escapeScript(("\n " + structuredData) + "\n ") +
|
|
196
|
+
"</script>");
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}, out, __component, "0");
|
|
200
|
+
} else {
|
|
201
|
+
warn('Unable to create content metadata: no content id was provided.');
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
marko_template._ = marko_renderer(render, {
|
|
206
|
+
e_: marko_componentType
|
|
207
|
+
}, marko_component);
|
|
208
|
+
|
|
209
|
+
marko_template.meta = {
|
|
210
|
+
id: "/@mindful-web/marko-web$1.0.0/components/page/metadata/content.marko",
|
|
211
|
+
component: "./content.marko",
|
|
212
|
+
tags: [
|
|
213
|
+
"./components/common.marko",
|
|
214
|
+
"@mindful-web/marko-core/components/queries/index.marko"
|
|
215
|
+
]
|
|
216
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Compiled using marko@4.20.2 - DO NOT EDIT
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
|
5
|
+
marko_componentType = "/@mindful-web/marko-web$1.0.0/components/page/metadata/default.marko",
|
|
6
|
+
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
|
7
|
+
common_template = require("./components/common.marko"),
|
|
8
|
+
marko_loadTag = require("marko/dist/runtime/helpers/load-tag"),
|
|
9
|
+
common_tag = marko_loadTag(common_template);
|
|
10
|
+
|
|
11
|
+
function render(input, out, __component, component, state) {
|
|
12
|
+
var data = input;
|
|
13
|
+
|
|
14
|
+
common_tag(input, out, __component, "0");
|
|
15
|
+
|
|
16
|
+
out.w("<meta property=\"og:type\" content=\"website\">");
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
marko_template._ = marko_renderer(render, {
|
|
20
|
+
d_: true,
|
|
21
|
+
e_: marko_componentType
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
marko_template.meta = {
|
|
25
|
+
id: "/@mindful-web/marko-web$1.0.0/components/page/metadata/default.marko",
|
|
26
|
+
tags: [
|
|
27
|
+
"./components/common.marko"
|
|
28
|
+
]
|
|
29
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import gql from "graphql-tag";
|
|
2
|
+
import { get } from "@mindful-web/object-path";
|
|
3
|
+
import { warn } from "@mindful-web/utils";
|
|
4
|
+
|
|
5
|
+
<!-- @todo This data should generated and saved to the page object as flat data, so no relationships are required. -->
|
|
6
|
+
|
|
7
|
+
$ const { alias } = input;
|
|
8
|
+
$ const queryFragment = gql`
|
|
9
|
+
fragment DynamicPageMetadataFragment on ContentPage {
|
|
10
|
+
id
|
|
11
|
+
siteContext {
|
|
12
|
+
path
|
|
13
|
+
canonicalUrl
|
|
14
|
+
noIndex
|
|
15
|
+
}
|
|
16
|
+
metadata {
|
|
17
|
+
title
|
|
18
|
+
description
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
|
|
23
|
+
<if(alias)>
|
|
24
|
+
<marko-web-query|{ node }| name="dynamic-page" params={ alias, queryFragment }>
|
|
25
|
+
$ const metadata = {
|
|
26
|
+
title: get(node, "metadata.title"),
|
|
27
|
+
description: get(node, "metadata.description"),
|
|
28
|
+
canonicalPath: get(node, "siteContext.path"),
|
|
29
|
+
noIndex: get(node, "siteContext.noIndex"),
|
|
30
|
+
};
|
|
31
|
+
<common ...metadata />
|
|
32
|
+
<meta property="og:type" content="website" />
|
|
33
|
+
<@when-empty>
|
|
34
|
+
$ warn(`Unable to create dynamic page metadata: no page found for ${alias}.`);
|
|
35
|
+
</@when-empty>
|
|
36
|
+
</marko-web-query>
|
|
37
|
+
</if>
|
|
38
|
+
<else>
|
|
39
|
+
$ warn('Unable to create dynamic page metadata: no page alias was provided.');
|
|
40
|
+
</else>
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// Compiled using marko@4.20.2 - DO NOT EDIT
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
|
5
|
+
marko_componentType = "/@mindful-web/marko-web$1.0.0/components/page/metadata/dynamic-page.marko",
|
|
6
|
+
marko_component = require("./dynamic-page.marko"),
|
|
7
|
+
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
|
8
|
+
module_gql = require("graphql-tag"),
|
|
9
|
+
gql = module_gql.default || module_gql,
|
|
10
|
+
module_objectPath_module = require("@mindful-web/object-path"),
|
|
11
|
+
objectPath_module = module_objectPath_module.default || module_objectPath_module,
|
|
12
|
+
get = module_objectPath_module.get,
|
|
13
|
+
module_utils_module = require("@mindful-web/utils"),
|
|
14
|
+
utils_module = module_utils_module.default || module_utils_module,
|
|
15
|
+
warn = module_utils_module.warn,
|
|
16
|
+
common_template = require("./components/common.marko"),
|
|
17
|
+
marko_loadTag = require("marko/dist/runtime/helpers/load-tag"),
|
|
18
|
+
common_tag = marko_loadTag(common_template),
|
|
19
|
+
marko_web_query_template = require("@mindful-web/marko-core/components/queries/index.marko"),
|
|
20
|
+
marko_web_query_tag = marko_loadTag(marko_web_query_template);
|
|
21
|
+
|
|
22
|
+
function render(input, out, __component, component, state) {
|
|
23
|
+
var data = input;
|
|
24
|
+
|
|
25
|
+
const { alias } = input;
|
|
26
|
+
|
|
27
|
+
const queryFragment = gql`
|
|
28
|
+
fragment DynamicPageMetadataFragment on ContentPage {
|
|
29
|
+
id
|
|
30
|
+
siteContext {
|
|
31
|
+
path
|
|
32
|
+
canonicalUrl
|
|
33
|
+
noIndex
|
|
34
|
+
}
|
|
35
|
+
metadata {
|
|
36
|
+
title
|
|
37
|
+
description
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
|
|
42
|
+
if (alias) {
|
|
43
|
+
marko_web_query_tag({
|
|
44
|
+
collapsible: true,
|
|
45
|
+
name: "dynamic-page",
|
|
46
|
+
params: {
|
|
47
|
+
alias: alias,
|
|
48
|
+
queryFragment: queryFragment
|
|
49
|
+
},
|
|
50
|
+
whenEmpty: {
|
|
51
|
+
renderBody: function(out) {
|
|
52
|
+
warn(`Unable to create dynamic page metadata: no page found for ${alias}.`);
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
renderBody: function(out, { node }) {
|
|
56
|
+
const metadata = {
|
|
57
|
+
title: get(node, "metadata.title"),
|
|
58
|
+
description: get(node, "metadata.description"),
|
|
59
|
+
canonicalPath: get(node, "siteContext.path"),
|
|
60
|
+
noIndex: get(node, "siteContext.noIndex"),
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
common_tag(metadata, out, __component, "1");
|
|
64
|
+
|
|
65
|
+
out.w("<meta property=\"og:type\" content=\"website\">");
|
|
66
|
+
}
|
|
67
|
+
}, out, __component, "0");
|
|
68
|
+
} else {
|
|
69
|
+
warn('Unable to create dynamic page metadata: no page alias was provided.');
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
marko_template._ = marko_renderer(render, {
|
|
74
|
+
e_: marko_componentType
|
|
75
|
+
}, marko_component);
|
|
76
|
+
|
|
77
|
+
marko_template.meta = {
|
|
78
|
+
id: "/@mindful-web/marko-web$1.0.0/components/page/metadata/dynamic-page.marko",
|
|
79
|
+
component: "./dynamic-page.marko",
|
|
80
|
+
tags: [
|
|
81
|
+
"./components/common.marko",
|
|
82
|
+
"@mindful-web/marko-core/components/queries/index.marko"
|
|
83
|
+
]
|
|
84
|
+
};
|