Skip to content

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

License

Notifications You must be signed in to change notification settings

takanorip/eleventy-google-fonts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eleventy-google-fonts

A universal shortcode to optimize Google Fonts for eleventy.js. 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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published