diff --git a/lib/config.schema.json b/lib/config.schema.json deleted file mode 100644 index 9ae16a6..0000000 --- a/lib/config.schema.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "type": "object", - "additionalProperties": false, - "properties": { - "recursive": { - "description": "Follow your links across all pages to optimize the fonts across the antire site", - "type": "boolean", - "default": true - }, - "inlineFonts": { - "title": "Inline fonts", - "description": "Inline generated font subsets into their respective @font-face blocks. When set to `false` external font files will be created", - "type": "boolean", - "default": false - }, - "inlineCss": { - "title": "Inline CSS", - "description": "Inline generated CSS @font-face blocks into each page. When set to `false` an external CSS file will be created", - "type": "boolean", - "default": false - }, - "fontDisplay": { - "title": "CSS font-display", - "description": "Subfont lets you set CSS font-display value of the optimized subsets. See https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display", - "type": "string", - "enum": [ - "auto", - "block", - "swap", - "fallback", - "optional" - ], - "default": "swap" - }, - "entryPoints": { - "title": "Entry points", - "description": "An array of glob patterns for pages on your site. Recursive traversal will start from these", - "type": "array", - "items": [ - { - "type": "string" - } - ], - "minItems": 1, - "uniqueItems": true, - "default": [ - "*.html" - ] - } - } -} diff --git a/lib/index.js b/lib/index.js index 4559bd1..386a838 100644 --- a/lib/index.js +++ b/lib/index.js @@ -2,7 +2,6 @@ const { promisify } = require('util'); const { resolve } = require('path'); const appendFile = promisify(require('fs').appendFile); const subfont = require('subfont'); -const configSchema = require('./config.schema.json'); const globby = require('globby'); const canonicalRoot = process.env.URL; @@ -15,13 +14,9 @@ const immutableHeaders = ` `; module.exports = { - name: 'subfont', - - config: configSchema, - onPostBuild: async ({ constants: { BUILD_DIR }, - pluginConfig: { entryPoints, ...subfontConfig } + inputs: { entryPoints, ...subfontConfig } }) => { console.log( `Running subfont version ${require('subfont/package.json').version}` diff --git a/manifest.yml b/manifest.yml new file mode 100644 index 0000000..ace74c1 --- /dev/null +++ b/manifest.yml @@ -0,0 +1,22 @@ +name: netlify-plugin-subfont +inputs: + - name: recursive + default: true + # description: Follow your links across all pages to optimize the fonts across the antire site + # validation: boolean + - name: inlineFonts + default: false + # description: Inline generated font subsets into their respective @font-face blocks. When set to `false` external font files will be created + # validation: boolean + - name: inlineCss + default: false + # description: Inline generated CSS @font-face blocks into each page. When set to `false` an external CSS file will be created + # validation: boolean + - name: fontDisplay + default: swap + # description: Subfont lets you set CSS font-display value of the optimized subsets. See https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display + # validation: string among auto|block|swap|fallback|optional + - name: entryPoints + default: ['*.html'] + # description: An array of glob patterns for pages on your site. Recursive traversal will start from these + # validation: array of strings, minimum 1 item, unique items diff --git a/package.json b/package.json index 04e3c34..a743082 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,9 @@ "name": "netlify-plugin-subfont", "description": "Netlify build plugin to run automated web font loading optimizations on static pages", "repository": "git://github.com/munter/netlify-plugin-subfont.git", + "bugs": { + "url": "https://github.com/munter/netlify-plugin-subfont/issues" + }, "version": "3.0.1", "license": "BSD-3-Clause", "maintainers": [