File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,9 @@ const { seeAlsoLinks, currentId } = Astro.props;
2121 { link .name === currentId ? (
2222 <strong >{ link .name .replace (/ _/ g , ' ' )} </strong >
2323 ) : (
24- <a href = { link .link } >{ link .name .replace (/ _/ g , ' ' )} </a >
24+ <a target = { link .newTab ? ' _blank' : ' _self' }
25+ rel = { link .newTab ? ' noopener noreferrer' : undefined }
26+ href = { link .link } >{ link .name .replace (/ _/ g , ' ' )} </a >
2527 )}
2628 </li >
2729 ))}
Original file line number Diff line number Diff line change @@ -455,6 +455,8 @@ fourDoorVehicles = { -- boats and bikes not included
455455
456456 <SeeAlsoSection seeAlsoLinks ={ getSeeAlsoLinksFromList ([
457457 ' reference:ID_Lists' ,
458+ ' reference:vehicle' ,
459+ ' external:Web Vehicle 3D Model Viewer:http://gta.rockstarvision.com/vehicleviewer/#sa'
458460 ])} currentId =' ' />
459461</StarlightPage >
460462
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ export function renderInlineMarkdown(markdown: string): string | Promise<string>
2424type SeeAlsoLink = {
2525 name : string ;
2626 link : string ;
27+ newTab ?: boolean ;
2728} ;
2829
2930export type SeeAlsoLinkGroup = {
@@ -108,6 +109,14 @@ export function getSeeAlsoLinksFromList(seeAlsoList: string[]): SeeAlsoLinkGroup
108109 groupedMap . get ( title ) ! . push ( { name : refPage , link : `/reference/${ refPage } ` } ) ;
109110 continue ;
110111 }
112+ if ( type === 'external' ) {
113+ const title = rest [ 0 ] ;
114+ const httpprefix = rest [ 1 ] ;
115+ const url = httpprefix + ':' + rest [ 2 ] ;
116+ if ( ! groupedMap . has ( 'Links' ) ) groupedMap . set ( 'Links' , [ ] ) ;
117+ groupedMap . get ( 'Links' ) ! . push ( { name : title , link : url , newTab : true } ) ;
118+ continue ;
119+ }
111120
112121 // Handle function/event style links
113122 const [ subType , category ] = rest ;
@@ -128,6 +137,7 @@ export function getSeeAlsoLinksFromList(seeAlsoList: string[]): SeeAlsoLinkGroup
128137 if ( ! type || rest . length === 0 ) return null ;
129138 if ( type === 'article' ) return 'Articles' ;
130139 if ( type === 'reference' ) return 'Reference' ;
140+ if ( type === 'external' ) return 'Links' ;
131141 return makeTitle ( rest [ 0 ] , rest [ 1 ] , type ) ;
132142 } )
133143 . filter ( ( title ) : title is string => title !== null )
You can’t perform that action at this time.
0 commit comments