Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johanbrook/eleventy-plugin-typeset
A plugin for the Eleventy static site generator for making your typography nicer.
https://github.com/johanbrook/eleventy-plugin-typeset
eleventy plugin typeset typography
Last synced: 29 days ago
JSON representation
A plugin for the Eleventy static site generator for making your typography nicer.
- Host: GitHub
- URL: https://github.com/johanbrook/eleventy-plugin-typeset
- Owner: johanbrook
- Created: 2018-09-17T14:37:13.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-10-05T08:12:51.000Z (about 2 years ago)
- Last Synced: 2024-10-08T13:22:57.666Z (about 1 month ago)
- Topics: eleventy, plugin, typeset, typography
- Language: JavaScript
- Size: 104 KB
- Stars: 18
- Watchers: 3
- Forks: 7
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Typeset plugin for Eleventy
A plugin for the [Eleventy](https://github.com/11ty/eleventy/) static site generator for making your typography nicer, based on [Typeset.js](https://github.com/davidmerfield/Typeset).
## Install
```shell
npm install --save eleventy-plugin-typeset
```## Usage
In your Eleventy config file (defaults to `.eleventy.js`):
```js
const typesetPlugin = require('eleventy-plugin-typeset');module.exports = (eleventyConfig) => {
eleventyConfig.addPlugin(typesetPlugin());
};
```## Configuration
Typeset.js accepts a couple of [options](https://github.com/davidmerfield/Typeset#options), which you can provide to this plugin too:
```js
// Example for passing options to the plugin.eleventyConfig.addPlugin(
typesetPlugin({
only: '.article-text', // Run only on HTML content within a certain CSS selector
disable: ['smallCaps'], // Disable typesetting feature 'smallCaps'
// etc.
})
);
```You can use the options to let this plugin run only on some certain parts of your content. This is actually a quite nice optimisation, since I discovered running Typeset on my full site (pages and posts) takes a few seconds. So unless you wanna typeset _all_ HTML on your site, be sure to scope the plugin with the `only` option to a selector that wraps your article content.
## License
MIT.