Skip to content

No target=_self on the next page button. #5112

@itamm15

Description

@itamm15

Describe the bug

Hello! Thanks for this great lib.
The issue is rather simple: inconsistency in behaviour between the sidebar and the next page button.

Reproduction

VitePress config:

import { defineConfig } from 'vitepress'

export default defineConfig({
  title: "Test",
  description: "Test",
  base: "/docs/",
  outDir: "/docs",
  themeConfig: {
    nav: [],
    sidebar: [
      {
        items: [
          { text: 'Introduction', link: '/' },
          { text: 'test', link: '/test', target: '_self' },
        ]
      }
    ]
  }
})

On the sidebar the test link has target=_self option, though that option does not exist on the next page button.

Expected behavior

The next page button should also have the target=_self attribute.

System Info

System:
    OS: macOS 15.0
    CPU: (8) arm64 Apple M2
    Memory: 85.75 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 24.13.0 - /Users/mateuszosinski/.asdf/installs/nodejs/24.13.0/bin/node
    npm: 11.8.0 - /Users/mateuszosinski/.asdf/plugins/nodejs/shims/npm
  Browsers:
    Chrome: 144.0.7559.112
    Firefox: 136.0.1
    Safari: 18.0


(tested on Chrome)

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    themeRelated to the theme

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions