@@ -8,13 +8,13 @@ const publisher = {
88 '@type' : 'Organization' ,
99 name : 'Faable' ,
1010 url : 'https://faable.com' ,
11- logo : 'https://faable.com/assets/logo/Emblem.png' ,
11+ logo : 'https://faable.com/assets/logo/Emblem.png'
1212}
1313
14- const urlForRoute = ( route ) => `${ SITE_URL } ${ route === '/' ? '' : route } `
14+ const urlForRoute = route => `${ SITE_URL } ${ route === '/' ? '' : route } `
1515
1616function humanize ( slug ) {
17- return slug . replace ( / [ - _ ] / g, ' ' ) . replace ( / \b \w / g, ( c ) => c . toUpperCase ( ) )
17+ return slug . replace ( / [ - _ ] / g, ' ' ) . replace ( / \b \w / g, c => c . toUpperCase ( ) )
1818}
1919
2020// schema.org BreadcrumbList from the page path. The leaf uses the real page
@@ -30,7 +30,7 @@ export function buildBreadcrumb(mdxPath, leafTitle) {
3030 const isLast = i === segments . length - 1
3131 items . push ( {
3232 name : isLast && leafTitle ? leafTitle : humanize ( segment ) ,
33- url : `${ SITE_URL } ${ acc } ` ,
33+ url : `${ SITE_URL } ${ acc } `
3434 } )
3535 } )
3636
@@ -41,17 +41,23 @@ export function buildBreadcrumb(mdxPath, leafTitle) {
4141 '@type' : 'ListItem' ,
4242 position : i + 1 ,
4343 name : item . name ,
44- item : item . url ,
45- } ) ) ,
44+ item : item . url
45+ } ) )
4646 }
4747}
4848
4949// TechArticle for a docs page — gives AI engines and search a verifiable,
5050// dated, attributed unit they can cite. dates are ISO strings.
51- export function buildArticle ( { route, title, description, published, modified } ) {
51+ export function buildArticle ( {
52+ route,
53+ title,
54+ description,
55+ published,
56+ modified
57+ } ) {
5258 if ( ! title ) return null
5359 const url = urlForRoute ( route )
54- const iso = ( d ) => ( d instanceof Date ? d . toISOString ( ) : d )
60+ const iso = d => ( d instanceof Date ? d . toISOString ( ) : d )
5561 return {
5662 '@context' : 'https://schema.org' ,
5763 '@type' : 'TechArticle' ,
@@ -64,7 +70,7 @@ export function buildArticle({ route, title, description, published, modified })
6470 datePublished : iso ( published ) ,
6571 dateModified : iso ( modified ) ,
6672 author : publisher ,
67- publisher,
73+ publisher
6874 }
6975}
7076
@@ -119,7 +125,7 @@ export function buildFaqPage(route) {
119125 mainEntity : faqs . map ( ( { question, answer } ) => ( {
120126 '@type' : 'Question' ,
121127 name : question ,
122- acceptedAnswer : { '@type' : 'Answer' , text : answer } ,
123- } ) ) ,
128+ acceptedAnswer : { '@type' : 'Answer' , text : answer }
129+ } ) )
124130 }
125131}
0 commit comments