From 6d80b632e03b198af8031bad77ae5ff4ff3c0fa2 Mon Sep 17 00:00:00 2001 From: Yufei Huang Date: Thu, 4 May 2023 14:42:44 +0800 Subject: [PATCH] fix: add an option to disable new tabs in modern template (#8718) * fix: add an option to disable new tabs in modern template * test(snapshot): update snapshots for 0a19fd42e09350d77f464a7034cd6c8fa1a8dd60 --------- Co-authored-by: yufeih --- docs/docs/template.md | 4 ++-- samples/seed/index.md | 1 + templates/modern/layout/_master.tmpl | 1 + templates/modern/src/markdown.ts | 6 +++++- .../SamplesTest.Seed/index.html.view.verified.json | 5 +++-- .../1152x648/index.html.verified.png | 4 ++-- .../1920x1080/index.html.verified.png | 4 ++-- .../375x812/index.html.verified.png | 4 ++-- .../768x600/index.html.verified.png | 4 ++-- .../api-BuildFromProject.Class1.html.verified.html | 1 + .../api-CatLibrary.Cat-2.html-q-cat.verified.html | 1 + .../html/api-CatLibrary.html-term-cat.verified.html | 1 + .../html/api-CatLibrary.html.verified.html | 1 + ...rticles-csharp_coding_standards.html.verified.html | 1 + ...ows-2Ctypescript-markdown-extensions.verified.html | 1 + .../html/index.html.verified.html | 11 ++++++----- .../html/restapi-petstore.html.verified.html | 1 + 17 files changed, 33 insertions(+), 18 deletions(-) diff --git a/docs/docs/template.md b/docs/docs/template.md index 3e10eb9b824..cfb5136a22a 100644 --- a/docs/docs/template.md +++ b/docs/docs/template.md @@ -34,11 +34,11 @@ Name | Type | Description `_appLogoPath` | string | App logo URL path. `_appFaviconPath` | string | Favicon URL path. `_enableSearch` | bool | Whether to show the search box. -`_enableNewTab` | bool | Whether to open external links in a new tab. -`_noindex` | bool | Whether to include in search results +`_noindex` | bool | Whether to include in search results `_disableContribution` | bool | Whether to show the _"Edit this page"_ button. `_gitContribute` | object | Defines the `repo` and `branch` property of git links. `_gitUrlPattern` | string | URL pattern of git links. +`_disableNewTab` | bool | Whether to render external link indicator icons and open external links in a new tab. `_disableNextArticle` | bool | Whether to show the previous and next article link. `lang` | string | Primary language of the page. If unset, the `` tag will not have `lang` property. `layout` | string | Determines the layout of the page. Supported values are `landing` and `chromeless`. diff --git a/samples/seed/index.md b/samples/seed/index.md index befa74464dd..c87506e8e23 100644 --- a/samples/seed/index.md +++ b/samples/seed/index.md @@ -1,6 +1,7 @@ --- layout: landing lang: zh-CN +_disableNewTab: true --- # docfx-seed diff --git a/templates/modern/layout/_master.tmpl b/templates/modern/layout/_master.tmpl index 2a035bf0606..62c226cdc1c 100644 --- a/templates/modern/layout/_master.tmpl +++ b/templates/modern/layout/_master.tmpl @@ -22,6 +22,7 @@ {{#_noindex}}{{/_noindex}} {{#_enableSearch}}{{/_enableSearch}} + {{#_disableNewTab}}{{/_disableNewTab}} {{#docurl}}{{/docurl}}