Active hash plugin for vuepress

# How to use

# Install

# Usage

This plugin is an improved version comparing to the official one:

  • We add containerSelecter and offset options to make sure that the link hash can be exactly aligned with the current header.

    You should set containerSelecter as the theme container, and if your theme container has some special layout, you can increase an offset for all headers through the offset option.

  • If you scroll to the top of the page, the hash will be correctly removed.

Addtionally, we changed sidebarLinkSelector to activeLinkSelecter, which should be more senmantic.

# Config

# headerSelector

  • Type: string
  • Default: ".header-anchor"

Selector for header anchors

# activeSelecter

  • Type: string
  • Default: ".sidebar-link"

Selector for active anchors

# containerSelecter

  • Type: string
  • Default: ".theme-default-content"

Selector for theme content container.

It’s used to detect the spacing before the first header

# offset

  • Type: string
  • Default: 0

Additional offset for anchor position, used to make sure the anchor is aligned perfectly.

It’s useful when you have a padding top or other layout styles in your theme.