@nhvu95/scully-plugin-scroll2section
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

scully-plugin-scroll2section

The scully-plugin-scroll2section is a postProcessByHtml plugin for Scully that help <a> tag can route and scroll to a section in current static site.

For example:

  • 📦 Usage(#usage)

This plugin helps usage above scroll to the ## Usage bellow

📦 Installation

To install this plugin with npm run

$ npm install @nhvu95/scully-plugin-scroll2section --save-dev

peerDependencies is required:

$ npm install @types/jsdom --save-dev

Usage

Add plugin to scully.*.config.ts config

import { getScrollToSection } from "@nhvu95/scully-plugin-scroll2section";

const ScrollToSection = getScrollToSection();

export const config: ScullyConfig = {
    projectRoot: "./src",
    projectName: "portfolio",
    distFolder: "./dist/portfolio/browser",
    outDir: "./dist/static",
    routes: {
        "/blog/:slug": {
            type: "contentFolder",
            slug: {
                folder: "./blog",
            },
            postRenderers: [ScrollToSection],
        },
    },
};

Package Sidebar

Install

npm i @nhvu95/scully-plugin-scroll2section

Weekly Downloads

2

Version

1.0.6

License

MIT

Unpacked Size

86.3 kB

Total Files

15

Last publish

Collaborators

  • nhvu95