1414
1515 </div >
1616
17- <v-container fluid class =" pa-0" >
18-
1917 <news-banner v-if =" $t('newsBanner') !== ''" >
2018 <div v-html =" $t('newsBanner')" />
2119 </news-banner >
2220
23- <page-section v-for =" (section, index) in sections" :key =" section.data.target.fields.title"
24- :titleId =" section.data.target.fields.title" :title =" section.data.target.fields.title"
25- :bg =" index % 2 === 1 ? 'surface-bright' : undefined" >
26- <RichTextRenderer :document =" section.data.target.fields.body" :nodeRenderers =" renderNodes()" />
21+ <page-section
22+ v-for =" (section, index) in sections"
23+ :key =" section.data.target.fields.title"
24+ :title =" section.data.target.fields.shownTitle"
25+ :class =" index % 2 && 'bg-surface-bright'" >
26+ <RichTextRenderer
27+ :document =" section.data.target.fields.body"
28+ :nodeRenderers =" renderNodes()" />
2729 </page-section >
2830
2931 <div class =" bg-surface-bright" >
3638 <SpeakerCards />
3739 </v-responsive >
3840
39-
40- </v-container >
41-
4241</template >
4342
4443<script >
@@ -47,11 +46,13 @@ import {
4746 PageSection ,
4847 NewsBanner ,
4948 EventCards ,
49+ EventCard ,
5050 SpeakerCards ,
5151 TicketItem ,
5252 SponsorItem
5353} from ' @/components'
5454import RichTextRenderer from ' contentful-rich-text-vue-renderer'
55+ import { BLOCKS } from ' @contentful/rich-text-types' ;
5556import { h } from ' vue'
5657import { useGlobalStore } from ' @/store' ;
5758import { mapState } from ' pinia' ;
@@ -70,7 +71,8 @@ export default {
7071 RichTextRenderer,
7172 TicketItem,
7273 SponsorItem,
73- EventCards
74+ EventCards,
75+ EventCard,
7476 },
7577 computed: {
7678 currentYear () {
@@ -79,6 +81,7 @@ export default {
7981 ... mapState (useGlobalStore, [' pages' ]),
8082 sections () {
8183 const page = this .pages .find ((p ) => p .fields .pageName === ' 2025' ) ?? this .pages [0 ]
84+ console .log (page)
8285 return page .fields .pageBody .content
8386 .filter ((c ) => c .nodeType === ' embedded-entry-block' )
8487 .map ((c ) => c)
@@ -108,15 +111,17 @@ export default {
108111 },
109112 renderNodes () {
110113 return {
114+ [BLOCKS .PARAGRAPH ]: (node , key , next ) => h (' p' , { class: ' w-100' }, next (node .content , key, next)),
115+ [BLOCKS .HEADING_2 ]: (node , key , next ) => h (' h2' , { class: ' w-100' }, next (node .content , key, next)),
116+ [BLOCKS .HEADING_3 ]: (node , key , next ) => h (' h3' , { class: ' w-100' }, next (node .content , key, next)),
117+ [BLOCKS .HEADING_4 ]: (node , key , next ) => h (' h4' , { class: ' w-100' }, next (node .content , key, next)),
111118 ' embedded-entry-inline ' : (node ) => {
112119 const target = node .data .target
113120 const type = target .sys .contentType .sys .id
114121
115122 if (type === ' ticket' ) {
116123 const { ticketName , href , price , discountedPrice , validFrom , validUntil , highlighted } = target .fields
117124
118-
119- console .log (" type >>>>>" , ticketName, price, validUntil)
120125 const isValid =
121126 (! validFrom || (new Date () > new Date (validFrom))) &&
122127 (! validUntil || (new Date () < new Date (validUntil)))
@@ -136,6 +141,17 @@ export default {
136141
137142 return ' '
138143 },
144+ ' embedded-entry-block ' : (node ) => {
145+ const target = node .data .target
146+ const type = target .sys .contentType .sys .id
147+
148+ if (type === ' card' ) {
149+ const {cardTitle , description } = target .fields
150+ return h (EventCard, {title: cardTitle, description})
151+ }
152+
153+ return ' '
154+ },
139155 ' embedded-asset-block ' : (node ) => {
140156 const target = node .data .target
141157 const file = target .fields .file
0 commit comments