Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
gatsby-plugin-page-progress
Advanced tools
Progress indicator for the top of pages as user scrolls
Add a page progress indicator to your Gatsby project 😎 The progress bar moves as you scroll down the page.
Useful for blog sites and other reading material so users know how far they've read into an article or page.
npm i gatsby-plugin-page-progress
Inside gatsby-config.js
plugins: [
{
resolve: "gatsby-plugin-page-progress",
options: {
includePaths: ["/", { regex: "^/blog" }],
excludePaths: ["/blog/beep-beep-lettuce"],
height: 3,
prependToBody: false,
color: `#663399`,
footerHeight: 500,
headerHeight: 0,
},
},
];
If you'd like the progression bar to appear on all pages of your project,
you can simply add the name of the plugin to your plugins array in gatsby-config.js
plugins: ["gatsby-plugin-page-progress"];
includePaths
Required: ❌
Accepts: [string | object]
Default: []
Supports multiple paths. This option enables the plugin to include an array of paths. You can use regex to define multiple path inclusions. See examples below
excludePaths
Required: ❌
Accepts: [string | object]
Default: []
Supports multiple paths. This option enables the plugin to exclude an array of paths. You can use regex to multiple path exclusions. Defining paths to exclude will take precedence over
includePath
definitions. See examples below
prependToBody
Required: ❌
Accepts: boolean
Default: false
If
false
, the bar is appended to the<body>
. Iftrue
, the bar is prepended to the<body>
.
height
Required: ❌
Accepts: number
Default: 3
Sets the
height
of the progress bar.
color
Required: ❌
Accepts: string
Default: #663399
Sets the
color
of the progress bar.
footerHeight
Required: ❌
Accepts: number
Default: 0
Sets the height of the footer. The width of the progress bar will be scaled appropriately to reach 100% before reaching the page footer.
headerHeight
Required: ❌
Accepts: number
Default: 0
Sets the height of the header. The width of the progress bar will be scaled appropriately to reach 100% while offsetting the height of a fixed header and moves the progress bar below the header.
plugins: [
{
resolve: "gatsby-plugin-page-progress",
options: {
includePaths: ["/"],
excludePaths: [],
},
},
];
/blog
route:plugins: [
{
resolve: "gatsby-plugin-page-progress",
options: {
includePaths: ["/", { regex: "^/blog" }],
excludePaths: [],
},
},
];
This plugin calls the constructor function for RegExp. That's why we define any regex that we want to use inside an object. For more information on how to write regular expressions using the RegExp constructor use MDN for reference.
plugins: [
{
resolve: "gatsby-plugin-page-progress",
options: {
includePaths: [],
excludePaths: ["/"],
},
},
];
/blog
route, but exclude a specific path under /blog
:plugins: [
{
resolve: "gatsby-plugin-page-progress",
options: {
includePaths: ["/", { regex: "^/blog" }],
excludePaths: ["/blog/awesome/article"],
},
},
];
/blog
route, but exclude all paths under /blog
that end with 'react'
':plugins: [
{
resolve: "gatsby-plugin-page-progress",
options: {
includePaths: ["/", { regex: "^/blog" }],
excludePaths: [{ regex: "^/blog.+react$" }],
},
},
];
Remember that exclusions always take precedence over inclusions. In the case above - If the plugin finds any path that begins with
/blog
and ends withreact
it will not apply the progress indicator because it already knows to exclude that route 😁 Inversely, if we were on a route under/blog
that didn't end withreact
, it would apply the progress indicator because the exclusion rule wouldn't apply to that route.
FAQs
Progress indicator for the top of pages as user scrolls
The npm package gatsby-plugin-page-progress receives a total of 64 weekly downloads. As such, gatsby-plugin-page-progress popularity was classified as not popular.
We found that gatsby-plugin-page-progress demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.