@@ -153,7 +153,11 @@ export class SearchBarInner extends Component {
153
153
key = { `${ item . title } -${ item . content } -${ item . featuredImage } ` }
154
154
className = { theme [ 'group-cell' ] }
155
155
>
156
- < a className = { theme . articleLink } href = { `${ config . TC_EDU_BASE_PATH } ${ config . TC_EDU_ARTICLES_PATH } /${ item . title } ` } >
156
+ < a
157
+ className = { theme . articleLink }
158
+ href = { ( item . externalArticle && item . contentUrl ) ? item . contentUrl : `${ config . TC_EDU_BASE_PATH } ${ config . TC_EDU_ARTICLES_PATH } /${ item . title } ` }
159
+ target = { ( item . externalArticle && item . contentUrl ) ? '_blank' : '_self' }
160
+ >
157
161
{
158
162
item . featuredImage ? (
159
163
< img
@@ -189,7 +193,11 @@ export class SearchBarInner extends Component {
189
193
key = { `${ item . title } -${ item . content } -${ item . featuredImage } ` }
190
194
className = { theme [ 'group-cell' ] }
191
195
>
192
- < a className = { theme . articleLink } href = { `${ config . TC_EDU_BASE_PATH } ${ config . TC_EDU_ARTICLES_PATH } /${ item . title } ` } >
196
+ < a
197
+ className = { theme . articleLink }
198
+ href = { ( item . externalArticle && item . contentUrl ) ? item . contentUrl : `${ config . TC_EDU_BASE_PATH } ${ config . TC_EDU_ARTICLES_PATH } /${ item . title } ` }
199
+ target = { ( item . externalArticle && item . contentUrl ) ? '_blank' : '_self' }
200
+ >
193
201
{
194
202
item . featuredImage ? (
195
203
< div className = { theme [ 'cell-image' ] } >
@@ -227,7 +235,11 @@ export class SearchBarInner extends Component {
227
235
key = { `${ item . title } -${ item . content } -${ item . featuredImage } ` }
228
236
className = { theme [ 'group-cell' ] }
229
237
>
230
- < a className = { theme . forumLink } href = { `${ config . TC_EDU_BASE_PATH } ${ config . TC_EDU_ARTICLES_PATH } /${ item . title } ` } >
238
+ < a
239
+ className = { theme . forumLink }
240
+ href = { ( item . externalArticle && item . contentUrl ) ? item . contentUrl : `${ config . TC_EDU_BASE_PATH } ${ config . TC_EDU_ARTICLES_PATH } /${ item . title } ` }
241
+ target = { ( item . externalArticle && item . contentUrl ) ? '_blank' : '_self' }
242
+ >
231
243
< span className = { theme [ 'cell-text' ] } >
232
244
{ item . title }
233
245
</ span >
@@ -360,6 +372,8 @@ export class SearchBarInner extends Component {
360
372
featuredImage : featuredImage . fields . file . url ,
361
373
tags : fields . tags ,
362
374
contentAuthor : contentAuthor . fields ,
375
+ externalArticle : fields . externalArticle ,
376
+ contentUrl : fields . contentUrl ,
363
377
} ;
364
378
} ) ,
365
379
'type' ,
0 commit comments