Merge branch 'main' into chore/vite-3

pull/1136/head
Divyansh Singh 3 years ago committed by GitHub
commit 773e2e59f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -46,7 +46,7 @@ Pages and internal links get generated with the `.html` suffix by default.
### External Links
Outbound links automatically get `target="_blank" rel="noopener noreferrer"`:
Outbound links automatically get `target="_blank" rel="noreferrer"`:
- [vuejs.org](https://vuejs.org)
- [VitePress on GitHub](https://github.com/vuejs/vitepress)

@ -34,7 +34,7 @@ const component = computed(() => {
:class="classes"
:href="href ? normalizeLink(href) : undefined"
:target="isExternal ? '_blank' : undefined"
:rel="isExternal ? 'noopener noreferrer' : undefined"
:rel="isExternal ? 'noreferrer' : undefined"
>
{{ text }}
</component>

@ -19,7 +19,7 @@ const isExternal = computed(() => props.href && EXTERNAL_URL_RE.test(props.href)
:class="{ link: href }"
:href="href ? normalizeLink(href) : undefined"
:target="isExternal ? '_blank' : undefined"
:rel="isExternal ? 'noopener noreferrer' : undefined"
:rel="isExternal ? 'noreferrer' : undefined"
>
<slot />
<VPIconExternalLink v-if="isExternal && !noIcon" class="icon" />

@ -32,7 +32,7 @@ const icons = {
:href="link"
:title="icon"
target="_blank"
rel="noopener noreferrer"
rel="noreferrer"
>
<component :is="icons[icon]" class="icon" />
<span class="visually-hidden">{{ icon }}</span>

@ -78,7 +78,7 @@ export const createMarkdownRenderer = async (
linkPlugin,
{
target: '_blank',
rel: 'noopener noreferrer',
rel: 'noreferrer',
...options.externalLinks
},
base

@ -89,7 +89,7 @@ export async function createMarkdownToVueRenderFn(
`\n(!) Found dead link ${c.cyan(url)} in file ${c.white(
c.dim(file)
)}\nIf it is intended, you can use:\n ${c.cyan(
`<a href="${url}" target="_blank" rel="noopener noreferrer">${url}</a>`
`<a href="${url}" target="_blank" rel="noreferrer">${url}</a>`
)}`
)
)

@ -144,6 +144,7 @@ function cleanRoute(siteData: SiteData, route: string): string {
function hasTag(head: HeadConfig[], tag: HeadConfig) {
const [tagType, tagAttrs] = tag
if (tagType !== 'meta') return false
const keyAttr = Object.entries(tagAttrs)[0] // First key
if (keyAttr == null) return false
return head.some(

Loading…
Cancel
Save