diff --git a/docs/reference/default-theme-config.md b/docs/reference/default-theme-config.md index adf3db95..da8b0f96 100644 --- a/docs/reference/default-theme-config.md +++ b/docs/reference/default-theme-config.md @@ -398,3 +398,10 @@ Can be used to customize the label of the return to top button. This label is on - Default: `Change language` Can be used to customize the aria-label of the language toggle button in navbar. This is only used if you're using [i18n](../guide/i18n). + +## externalLinkIcon + +- Type: `boolean` +- Default: `false` + +Whether to show an external link icon next to external links in markdown. diff --git a/src/client/theme-default/components/VPDoc.vue b/src/client/theme-default/components/VPDoc.vue index bbb833a9..7a413718 100644 --- a/src/client/theme-default/components/VPDoc.vue +++ b/src/client/theme-default/components/VPDoc.vue @@ -2,10 +2,13 @@ import { useRoute } from 'vitepress' import { useSidebar } from 'vitepress/theme' import { computed } from 'vue' +import { useData } from '../composables/data' import VPDocAside from './VPDocAside.vue' import VPDocFooter from './VPDocFooter.vue' import VPDocOutlineDropdown from './VPDocOutlineDropdown.vue' +const { theme } = useData() + const route = useRoute() const { hasSidebar, hasAside, leftAside } = useSidebar() @@ -42,7 +45,13 @@ const pageName = computed(() =>
- +
@@ -193,4 +202,8 @@ const pageName = computed(() => .VPDoc.has-aside .content-container { max-width: 688px; } + +.external-link-icon-enabled :is(.vp-doc a[href*='://'], .vp-doc a[target='_blank'])::after { + content: ''; +} diff --git a/src/client/theme-default/components/VPLink.vue b/src/client/theme-default/components/VPLink.vue index 3166858c..3e9f8e59 100644 --- a/src/client/theme-default/components/VPLink.vue +++ b/src/client/theme-default/components/VPLink.vue @@ -1,7 +1,6 @@