Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shoonia/gatsby-plugin-no-javascript-utils
The utils for the static Gatsby site without JavaScript
https://github.com/shoonia/gatsby-plugin-no-javascript-utils
gatsby gatsby-plugin
Last synced: about 1 month ago
JSON representation
The utils for the static Gatsby site without JavaScript
- Host: GitHub
- URL: https://github.com/shoonia/gatsby-plugin-no-javascript-utils
- Owner: shoonia
- License: mit
- Created: 2020-05-03T13:32:11.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-07-13T14:50:18.000Z (7 months ago)
- Last Synced: 2024-12-11T13:52:09.177Z (about 1 month ago)
- Topics: gatsby, gatsby-plugin
- Language: JavaScript
- Homepage:
- Size: 1.48 MB
- Stars: 15
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gatsby-plugin-no-javascript-utils
[![npm version](https://img.shields.io/npm/v/gatsby-plugin-no-javascript-utils.svg)](https://www.npmjs.com/package/gatsby-plugin-no-javascript-utils)
The utils for static site without JavaScript
Support Gatsby v2, v3, v4 and v5
## Install
```bash
npm i gatsby-plugin-no-javascript-utils
#or
yarn add gatsby-plugin-no-javascript-utils
```## How to use
```js
// In your gatsby-config.js
module.exports = {
siteMetadata: {
title: 'Blog',
description: 'Web Blog',
},
polyfill: false,
plugins: [
'gatsby-plugin-react-helmet',
'gatsby-plugin-postcss',/* ... */
// make sure it is included last in the plugins array.
'gatsby-plugin-no-javascript-utils',
],
}
```## Options
```js
// In your gatsby-config.js
module.exports = {
plugins: [
{
resolve: 'gatsby-plugin-no-javascript-utils',
options: {
noScript: true,
noSourcemaps: true,
removeGeneratorTag: true,
removeHeadDataAttrs: true,
noInlineStyles: false,
removeGatsbyAnnouncer: false,
},
},
],
}
```**`noScript?: boolean (default: true)`**
Removes all scripts and preload links for scripts and page-data fetching.
```diff
-
-⋯
- ⋯
-
-```
**`noSourcemaps?: boolean (default: true)`**
Disable generation of JavaScript sourcemaps.
**`removeGeneratorTag?: boolean (default: true)`**
Remove generator meta tag
```diff
-
My Blog
```**`removeHeadDataAttrs?: boolean (default: true)`**
Removes [data-react-helmet](https://github.com/nfl/react-helmet) and [data-gatsby-head](https://www.gatsbyjs.com/docs/reference/built-in-components/gatsby-head/) data attributes
```diff
-
-
+
+
```**`noInlineStyles?: boolean (default: false)`**
Replacing `` tag with `<link>` tag for reducing the size of HTML files and browser caching of CSS files.
```diff
- <style data-href="/styles.457cfd10c24f55260d5a.css"> ⋯
+
```**`removeGatsbyAnnouncer?: boolean (default: false)`**
The `
` is announcing route changes in a single-page application where the pages update without a reload. It may be unnecessary on a static sites when you don't use any JavaScript.More: [Accessibility Improvements to Client Side Routing in Gatsby](https://www.gatsbyjs.com/blog/2020-02-10-accessible-client-side-routing-improvements/)
```diff
⋯
-
```## License
[MIT](./LICENSE)