Skip to content

Latest commit

 

History

History
62 lines (41 loc) · 1.39 KB

README.md

File metadata and controls

62 lines (41 loc) · 1.39 KB

Friends of Google Fonts badge

The “Made by Friends of Google Fonts” badge.

Getting started

A hosted version of this script will be available. To add it to your project, add this script tag to your project:

<script src="../build/googlefontsbadge.js" async defer onload="gfBadge()"></script>

This will asynchronously load the badge and initialise it once it’s ready.

Browserify & Webpack

Alternatively, if you are using a build tool like Browserify, Webpack, etc. you can install the badge as a dependency and initialise it yourself. First, you’ll want to install it as a dependency using npm:

npm install --save https://github.com/googlefonts/friends-badge

Then, require it in your project:

var gfBadge = require('@googlefonts/badge')

// Initialise the badge when you are ready
gfBadge()

Contributing

To run the project locally, run the following commands in your terminal:

git clone https://github.com/googlefonts/badge googlefonts-badge
cd googlefonts-badge
npm install

Now you can build the distributed version of the file by running:

npm run build

…which uses Browserify to build a stand-alone minified version of the file.