@@ -16,25 +16,24 @@ export default {
16
16
'html' ,
17
17
'language' ,
18
18
'pagePath' ,
19
+ 'pagePathStringFromRoot' ,
19
20
'to' ,
20
21
'wikiData' ,
21
22
] ,
22
23
23
- sprawl ( { wikiInfo} ) {
24
- return {
25
- enableSearch : wikiInfo . enableSearch ,
26
- footerContent : wikiInfo . footerContent ,
27
- wikiColor : wikiInfo . color ,
28
- wikiName : wikiInfo . nameShort ,
29
- } ;
30
- } ,
24
+ sprawl : ( { wikiInfo} ) => ( {
25
+ enableSearch : wikiInfo . enableSearch ,
26
+ footerContent : wikiInfo . footerContent ,
27
+ wikiColor : wikiInfo . color ,
28
+ wikiName : wikiInfo . nameShort ,
29
+ canonicalBase : wikiInfo . canonicalBase ,
30
+ } ) ,
31
31
32
- data ( { wikiColor, wikiName} ) {
33
- return {
34
- wikiColor,
35
- wikiName,
36
- } ;
37
- } ,
32
+ data : ( sprawl ) => ( {
33
+ wikiColor : sprawl . wikiColor ,
34
+ wikiName : sprawl . wikiName ,
35
+ canonicalBase : sprawl . canonicalBase ,
36
+ } ) ,
38
37
39
38
relations ( relation , sprawl ) {
40
39
const relations = { } ;
@@ -228,6 +227,7 @@ export default {
228
227
html,
229
228
language,
230
229
pagePath,
230
+ pagePathStringFromRoot,
231
231
to,
232
232
} ) {
233
233
const colors = getColors ( slots . color ?? data . wikiColor ) ;
@@ -241,6 +241,13 @@ export default {
241
241
const mainContentHTML = html . tags ( [ slots . mainContent ] ) . toString ( ) ;
242
242
const hasID = id => mainContentHTML . includes ( `id="${ id } "` ) ;
243
243
244
+ const oEmbedJSONHref =
245
+ ( hasSocialEmbed && data . canonicalBase
246
+ ? data . canonicalBase +
247
+ pagePathStringFromRoot +
248
+ 'oembed.json'
249
+ : null ) ;
250
+
244
251
const titleContentsHTML =
245
252
( html . isBlank ( slots . title )
246
253
? null
@@ -649,6 +656,12 @@ export default {
649
656
. clone ( )
650
657
. slot ( 'mode' , 'html' ) ,
651
658
659
+ oEmbedJSONHref &&
660
+ html . tag ( 'link' , {
661
+ type : 'application/json+oembed' ,
662
+ href : oEmbedJSONHref ,
663
+ } ) ,
664
+
652
665
html . tag ( 'link' , {
653
666
rel : 'stylesheet' ,
654
667
href : to ( 'staticCSS.path' , 'site.css' ) ,
0 commit comments