@@ -35,26 +35,28 @@ if (currentSection) {
3535 let product = await getEntry (" products" , currentSection );
3636 // if entry for changelog, grab the first product value (which corresponds to the folder the entry is in) and use as the primary "product"
3737 if (currentSection === " changelog" ) {
38- const products = frontmatter .products
38+ const products = frontmatter .products ;
3939 if (products ) {
4040 product = await getEntry (" products" , products [0 ]);
4141 }
4242 }
4343
4444 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" ;
4648
4749 if (currentSection === " changelog" ) {
48- productMetaName = " Changelog"
50+ productMetaName = " Changelog" ;
4951 }
5052
5153 const titleIdx = head .findIndex ((x ) => x .tag === " title" );
5254 let title: string ;
5355
5456 // 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 ;
5860
5961 title = ` ${existingTitle } · ${productMetaName } ` ;
6062
@@ -128,8 +130,13 @@ if (
128130
129131if (frontmatter .pcx_content_type ) {
130132 [" 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+ : " " ;
133140 metaTags .push ({
134141 name ,
135142 content: updatedName ,
@@ -217,7 +224,6 @@ metaTags.map((attrs) => {
217224 attrs ,
218225 });
219226});
220-
221227---
222228
223229<script src =" src/scripts/footnotes.ts" ></script >
0 commit comments