Skip to content

Commit

Permalink
feat(addon-doc): support target property for links (#6876)
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode authored Feb 26, 2024
1 parent 4187c11 commit 83fc4b0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
<a
*ngFor="let item of group"
tuiOption
[attr.rel]="item.rel"
[fragment]="item.fragment"
[routerLink]="item.route"
[target]="item.target || '_self'"
(click)="onClick(input)"
>
{{ item.title }}
Expand Down Expand Up @@ -81,7 +83,9 @@
routerLinkActive="t-sublink_active"
tuiLink
class="t-sublink"
[attr.rel]="item.rel"
[routerLink]="item.route"
[target]="item.target || '_self'"
[tuiScrollIntoViewLink]="isActive(item.route)"
(click)="closeMenu()"
>
Expand Down Expand Up @@ -128,8 +132,10 @@
routerLinkActive="t-sublink_active"
tuiLink
class="t-sublink t-sublink_small"
[attr.rel]="subPage.rel"
[fragment]="subPage.fragment"
[routerLink]="subPage.route"
[target]="subPage.target || '_self'"
[tuiScrollIntoViewLink]="isActive(subPage.route)"
(click)="closeMenu()"
>
Expand Down
2 changes: 2 additions & 0 deletions projects/addon-doc/interfaces/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export interface TuiDocPage extends TuiDocPageBase {
readonly keywords?: string;
readonly route: string;
readonly icon?: PolymorpheusContent;
readonly rel?: HTMLAnchorElement['rel'];
readonly target?: HTMLAnchorElement['target'];
}

export interface TuiDocPageGroup extends TuiDocPageBase {
Expand Down
1 change: 1 addition & 0 deletions projects/demo/src/modules/app/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const pages: TuiDocPages = [
title: 'StackBlitz',
keywords: 'reproduce, issue, bug, sandbox, playground, test',
route: '/stackblitz',
target: '_blank',
},
{
section: 'Documentation',
Expand Down

0 comments on commit 83fc4b0

Please sign in to comment.