@@ -35,26 +35,28 @@ if (currentSection) {
35
35
let product = await getEntry (" products" , currentSection );
36
36
// if entry for changelog, grab the first product value (which corresponds to the folder the entry is in) and use as the primary "product"
37
37
if (currentSection === " changelog" ) {
38
- const products = frontmatter .products
38
+ const products = frontmatter .products ;
39
39
if (products ) {
40
40
product = await getEntry (" products" , products [0 ]);
41
41
}
42
42
}
43
43
44
44
if (product ) {
45
- let productMetaName = product .data .meta .title ? product .data .meta .title : " Cloudflare Docs" ;
45
+ let productMetaName = product .data .meta .title
46
+ ? product .data .meta .title
47
+ : " Cloudflare Docs" ;
46
48
47
49
if (currentSection === " changelog" ) {
48
- productMetaName = " Changelog"
50
+ productMetaName = " Changelog" ;
49
51
}
50
52
51
53
const titleIdx = head .findIndex ((x ) => x .tag === " title" );
52
54
let title: string ;
53
55
54
56
// Prefer the title set via frontmatter.head.title. If not, grab the regular frontmatter title value.
55
- const existingTitle = head [titleIdx ].content ? head [ titleIdx ]. content ?. split (
56
- ` ${DEFAULT_TITLE_DELIMITER } ` ,
57
- )[ 0 ] : frontmatter .title ;
57
+ const existingTitle = head [titleIdx ].content
58
+ ? head [ titleIdx ]. content ?. split ( ` ${DEFAULT_TITLE_DELIMITER } ` )[ 0 ]
59
+ : frontmatter .title ;
58
60
59
61
title = ` ${existingTitle } · ${productMetaName } ` ;
60
62
@@ -128,8 +130,13 @@ if (
128
130
129
131
if (frontmatter .pcx_content_type ) {
130
132
[" pcx_content_type" , " algolia_content_type" ].map ((name ) => {
131
- const contentType = frontmatter .pcx_content_type
132
- const updatedName = contentType ? (contentType .charAt (0 ).toUpperCase () + contentType .slice (1 )).replace (" -" , " " ) : " "
133
+ const contentType = frontmatter .pcx_content_type ;
134
+ const updatedName = contentType
135
+ ? (contentType .charAt (0 ).toUpperCase () + contentType .slice (1 )).replace (
136
+ " -" ,
137
+ " " ,
138
+ )
139
+ : " " ;
133
140
metaTags .push ({
134
141
name ,
135
142
content: updatedName ,
@@ -217,7 +224,6 @@ metaTags.map((attrs) => {
217
224
attrs ,
218
225
});
219
226
});
220
-
221
227
---
222
228
223
229
<script src =" src/scripts/footnotes.ts" ></script >
0 commit comments