eleventy-google-fonts

0.1.0 • Public • Published

eleventy-google-fonts

A Nunjucks shortcode to optimize Google Fonts. This shortcode download and inline Google Font's CSS.

Installation

npm install eleventy-google-fonts --save-dev

Add to eleventy config file

const eleventyGoogleFonts = require("eleventy-google-fonts");
module.exports = function(eleventyConfig) {
  eleventyConfig.addPlugin(eleventyGoogleFonts);
};

Use shortcode

<head>
  ...
  {% eleventyGoogleFonts 'https://fonts.googleapis.com/css2?family=Overpass:wght@600&display=swap' %}
  ...
</head>

License

This code is available under the MIT license.

Package Sidebar

Install

npm i eleventy-google-fonts

Weekly Downloads

99

Version

0.1.0

License

MIT

Unpacked Size

3.67 kB

Total Files

5

Last publish

Collaborators

  • takanorip