3
3
// TODO: remove when we have implemented component library as a module
4
4
// https://nuxt.com/docs/guide/directory-structure/components#library-authors
5
5
import {
6
- TwoColLayoutWStickySideBar , NavBreadcrumb , ResponsiveImage , RichText , PageAnchor , FlexibleBlocks , SectionWrapper ,
6
+ TwoColLayoutWStickySideBar , NavBreadcrumb , ResponsiveImage , CardMeta , RichText , PageAnchor , FlexibleBlocks , SectionWrapper ,
7
7
} from ' ucla-library-website-components'
8
8
9
9
import { onMounted } from ' vue'
@@ -73,12 +73,11 @@ const parseParentTitle = computed(() => {
73
73
return ' Home'
74
74
})
75
75
76
- const parsedButtonText = computed (() => {
77
- return _get (page .value , ' button[0].buttonText' , ' ' )
78
- })
79
-
80
- const parsedButtonTo = computed (() => {
81
- return _get (page .value , ' button[0].buttonUrl' , ' ' )
76
+ const parseTitle = computed (() => {
77
+ if (page .value .formattedTitle )
78
+ return page .value .formattedTitle
79
+ else
80
+ return page .value .title
82
81
})
83
82
84
83
onMounted (() => {
@@ -100,44 +99,33 @@ onMounted(() => {
100
99
:parent-title =" parseParentTitle"
101
100
/>
102
101
103
- <banner-text
104
- v-if =" page && (!page.heroImage || page.heroImage.length == 0)"
105
- class =" banner-text"
106
- :category =" page.format"
107
- :title =" page.title"
108
- :text =" page.summary"
109
- :button-text =" parsedButtonText"
110
- :to =" parsedButtonTo"
111
- />
112
-
113
- <section-wrapper class =" section-banner" >
114
- <code >{{ page }}</code>
115
- JEN JEN JEN
116
- <banner-header
117
- v-if =" page && page.heroImage && page.heroImage.length == 1"
118
- :media =" page.heroImage[0].image[0]"
119
- :category =" page.format"
120
- :title =" page.title"
121
- :text =" page.summary"
122
- :to =" parsedButtonTo"
123
- :prompt =" parsedButtonText"
124
- />
125
- </section-wrapper>
126
-
127
- <section-wrapper theme =" divider" >
128
- <divider-way-finder class =" divider-way-finder" />
129
- </section-wrapper>
102
+ <TwoColLayoutWStickySideBar >
103
+ <template #primaryTop >
104
+ <CardMeta
105
+ data-test =" text-block"
106
+ category =" Scategory"
107
+ :title =" parseTitle"
108
+ >
109
+ <template #customDescription >
110
+ <rich-text :rich-text-content =" page.text" />
111
+ </template >
112
+ </CardMeta >
113
+
114
+ <DividerWayFinder class =" remove-top-margin" />
115
+
116
+ <FlexibleBlocks
117
+ class =" flexible-content"
118
+ :blocks =" page.blocks"
119
+ />
120
+ </template >
121
+ <template #sidebarTop />
122
+ </TwoColLayoutWStickySideBar>
130
123
131
124
<page-anchor
132
125
v-if =" h2Array.length >= 3"
133
126
:section-titles =" h2Array"
134
127
/>
135
128
136
- <flexible-blocks
137
- v-if =" page"
138
- class =" flexible-content"
139
- :blocks =" page.blocks"
140
- />
141
129
</main>
142
130
</template >
143
131
0 commit comments