Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jakecyr/next-export-lang
A npm package to add the HTML lang attribute to all Next.js export files after building for SEO
https://github.com/jakecyr/next-export-lang
javascript nextjs npm seo
Last synced: about 1 month ago
JSON representation
A npm package to add the HTML lang attribute to all Next.js export files after building for SEO
- Host: GitHub
- URL: https://github.com/jakecyr/next-export-lang
- Owner: jakecyr
- Created: 2022-09-19T02:07:32.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-11-11T00:45:58.000Z (about 2 years ago)
- Last Synced: 2024-10-13T03:21:03.476Z (2 months ago)
- Topics: javascript, nextjs, npm, seo
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Next.js Export Lang
A simple npm package to add the HTML lang attribute to all Next.js export files after building to satisfy the Lighthouse accessibility rule for SEO.
## Installation and Usage
### Global CLI Usage
1. Run `npm install -g next-export-lang`
2. Example: run `next-export-lang en-US` when in a Next.JS project after running the `next export` command to add HTML 'lang' attributes to all HTML files in the 'out' folder.### Local Project Installation
The next-export-lang package can be installed in a Node project so it can be integrated as part of your build process.
1. Run `npm install -D next-export-lang`
2. Add `next-export-lang` to your build command (after `next export`). For example, in your package.json, update your build script, adding `&& next-export-lang en` to the end, replacing 'en' with the language you want to add to your HTML files: `"build": "next export && next-export-lang"`.A lang attribute with the defined language will be added to all HTML files in the 'out' folder generated from the `next export` command.