1.0.6 • Published 4 years ago
@nhvu95/scully-plugin-scroll2section v1.0.6
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-devpeerDependencies is required:
$ npm install @types/jsdom --save-devUsage
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],
},
},
};