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;
21
21
{ link .name === currentId ? (
22
22
<strong >{ link .name .replace (/ _/ g , ' ' )} </strong >
23
23
) : (
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 >
25
27
)}
26
28
</li >
27
29
))}
Original file line number Diff line number Diff line change @@ -455,6 +455,8 @@ fourDoorVehicles = { -- boats and bikes not included
455
455
456
456
<SeeAlsoSection seeAlsoLinks ={ getSeeAlsoLinksFromList ([
457
457
' reference:ID_Lists' ,
458
+ ' reference:vehicle' ,
459
+ ' external:Web Vehicle 3D Model Viewer:http://gta.rockstarvision.com/vehicleviewer/#sa'
458
460
])} currentId =' ' />
459
461
</StarlightPage >
460
462
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ export function renderInlineMarkdown(markdown: string): string | Promise<string>
24
24
type SeeAlsoLink = {
25
25
name : string ;
26
26
link : string ;
27
+ newTab ?: boolean ;
27
28
} ;
28
29
29
30
export type SeeAlsoLinkGroup = {
@@ -108,6 +109,14 @@ export function getSeeAlsoLinksFromList(seeAlsoList: string[]): SeeAlsoLinkGroup
108
109
groupedMap . get ( title ) ! . push ( { name : refPage , link : `/reference/${ refPage } ` } ) ;
109
110
continue ;
110
111
}
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
+ }
111
120
112
121
// Handle function/event style links
113
122
const [ subType , category ] = rest ;
@@ -128,6 +137,7 @@ export function getSeeAlsoLinksFromList(seeAlsoList: string[]): SeeAlsoLinkGroup
128
137
if ( ! type || rest . length === 0 ) return null ;
129
138
if ( type === 'article' ) return 'Articles' ;
130
139
if ( type === 'reference' ) return 'Reference' ;
140
+ if ( type === 'external' ) return 'Links' ;
131
141
return makeTitle ( rest [ 0 ] , rest [ 1 ] , type ) ;
132
142
} )
133
143
. filter ( ( title ) : title is string => title !== null )
You can’t perform that action at this time.
0 commit comments