File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ type MetadataProps = {
133133} ;
134134
135135// Helper function to clean up canonical tags missing leading or trailing slash
136- function checkCanonicalTagFormat ( tag : string ) {
136+ function formatCanonicalTag ( tag : string ) {
137137 if ( tag . charAt ( 0 ) !== '/' ) {
138138 tag = '/' + tag ;
139139 }
@@ -174,13 +174,13 @@ export async function generateMetadata({params}: MetadataProps): Promise<Metadat
174174 description = pageNode . frontmatter . description ?? '' ;
175175
176176 if ( pageNode . frontmatter . customCanonicalTag ) {
177- customCanonicalTag = pageNode . frontmatter . customCanonicalTag ;
177+ customCanonicalTag = formatCanonicalTag ( pageNode . frontmatter . customCanonicalTag ) ;
178178 }
179179 }
180180 }
181181
182182 const canonical = customCanonicalTag
183- ? domain + checkCanonicalTagFormat ( customCanonicalTag )
183+ ? domain + customCanonicalTag
184184 : params . path
185185 ? `${ domain } /${ params . path . join ( '/' ) } /`
186186 : domain ;
You can’t perform that action at this time.
0 commit comments