Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lekoarts/gatsby-plugin-doctype
Change the DOCTYPE of HTML files in Gatsby
https://github.com/lekoarts/gatsby-plugin-doctype
doctype gatsby gatsby-plugin gatsbyjs
Last synced: 19 days ago
JSON representation
Change the DOCTYPE of HTML files in Gatsby
- Host: GitHub
- URL: https://github.com/lekoarts/gatsby-plugin-doctype
- Owner: LekoArts
- License: mit
- Created: 2020-05-20T18:20:42.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-05-20T18:41:28.000Z (over 4 years ago)
- Last Synced: 2024-12-06T04:42:32.020Z (about 2 months ago)
- Topics: doctype, gatsby, gatsby-plugin, gatsbyjs
- Language: JavaScript
- Size: 4.88 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gatsby-plugin-doctype
Change the DOCTYPE of HTML files in Gatsby. By default, Gatsby adds `` to the start to every HTML file it generates. You can now edit the `html` portion.
## Install
```shell
npm install gatsby-plugin-doctype
```## How to use
Include the plugin in your `gatsby-config.js` file and use the `doctype` option.
```js=title=gatsby-config.js
module.exports = {
plugins: [
{
resolve: `gatsby-plugin-doctype`,
options: {
doctype: 'HTML',
},
},
],
}
```If you want to use something like `HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"` you'll need to make sure that you wrap the option with single quotes/backticks or escape the quotes.
Run a `gatsby build` as this plugin only changes files with the `onPostBuild` lifecycle.
---
You can see the finished result in the HTML files inside `public`.