Skip to content

Commit

Permalink
feat: ✨ uplift publication content types to landingpage
Browse files Browse the repository at this point in the history
  • Loading branch information
waitingallday committed Feb 4, 2025
1 parent 62ac872 commit 564b3c5
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
:siteSection="page.siteSection"
:pageTitle="page.title"
:pageLanguage="page.lang"
:topicTags="page.showTopicTags ? page.topicTags : []"
:updatedDate="page.changed || page.created"
:showContentRating="page.showContentRating"
>
Expand Down Expand Up @@ -49,10 +50,9 @@
</template>

<script setup lang="ts">
import { TideSiteData } from '@dpc-sdp/ripple-tide-api/types'
import { indexNode, TidePublicationPage } from '../../types'
import { processMenu, useRoute, useTidePublicationMenu } from '#imports'
import { ref } from 'vue'
import type { indexNode, TidePublicationPage } from '../../types'
import type { TideSiteData } from '@dpc-sdp/ripple-tide-api/types'
import { processMenu, useRoute, useTidePublicationMenu, ref } from '#imports'
interface Props {
site: TideSiteData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
:siteSection="page.siteSection"
:pageTitle="page.title"
:pageLanguage="page.lang"
:topicTags="page.showTopicTags ? page.topicTags : []"
:updatedDate="page.changed || page.created"
:showContentRating="page.showContentRating"
>
Expand Down Expand Up @@ -53,12 +54,12 @@
</template>

<script setup lang="ts">
import { indexNode, TidePublicationPagePage } from '../../types'
import { processMenu, useRoute, useTidePublicationMenu } from '#imports'
import { ref } from 'vue'
import type { indexNode, TidePublicationPagePage } from '../../types'
import type { TideSiteData } from '@dpc-sdp/ripple-tide-api/types'
import { processMenu, useRoute, useTidePublicationMenu, ref } from '#imports'
interface Props {
site: any
site: TideSiteData
page: TidePublicationPagePage
}
Expand Down
2 changes: 2 additions & 0 deletions packages/ripple-tide-publication/mapping/publication-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { heroHeaderMapping } from '@dpc-sdp/ripple-tide-landing-page/mapping'
const tidePublicationPageModule: IRplTideModuleMapping = {
mapping: {
...tidePageBaseMapping({
withTopicTags: true,
withSidebarContacts: true,
withSidebarRelatedLinks: true,
withSidebarSocialShare: true
Expand Down Expand Up @@ -67,6 +68,7 @@ const tidePublicationPageModule: IRplTideModuleMapping = {
},
includes: [
...tidePageBaseIncludes({
withTopicTags: true,
withSidebarContacts: true,
withSidebarRelatedLinks: true,
withSidebarSocialShare: true
Expand Down
2 changes: 2 additions & 0 deletions packages/ripple-tide-publication/mapping/publication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const chapters = (src: string) =>
const tidePublicationModule: IRplTideModuleMapping = {
mapping: {
...tidePageBaseMapping({
withTopicTags: true,
withSidebarContacts: true,
withSidebarRelatedLinks: true,
withSidebarSocialShare: true
Expand Down Expand Up @@ -66,6 +67,7 @@ const tidePublicationModule: IRplTideModuleMapping = {
},
includes: [
...tidePageBaseIncludes({
withTopicTags: true,
withSidebarContacts: true,
withSidebarRelatedLinks: true,
withSidebarSocialShare: true
Expand Down
10 changes: 10 additions & 0 deletions packages/ripple-tide-publication/server/plugins/publication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default defineNitroPlugin(async (nitroApp: NitroApp) => {
'publication_page',
tidePublicationPageModule
)

// Adding support for landing page component includes
nitroApp.tide?.pageApi.dynamicComponents[
'paragraph--basic_text'
Expand Down Expand Up @@ -46,4 +47,13 @@ export default defineNitroPlugin(async (nitroApp: NitroApp) => {
nitroApp.tide?.pageApi.dynamicComponents[
'paragraph--call_to_action'
]?.contentTypes.push(...['publication_page'])
nitroApp.tide?.pageApi.dynamicComponents[
'paragraph--from_library'
]?.contentTypes.push(...['publication', 'publication_page'])
nitroApp.tide?.pageApi.dynamicComponents[
'paragraph--data_table'
]?.contentTypes.push(...['publication_page'])
nitroApp.tide?.pageApi.dynamicComponents[
'paragraph--data_driven_component'
]?.contentTypes.push(...['publication_page'])
})

0 comments on commit 564b3c5

Please sign in to comment.