Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jeremenichelli/eleventy-xml-plugin
👩🔬 Useful set of Liquid filters for XML files composition in Eleventy projects
https://github.com/jeremenichelli/eleventy-xml-plugin
Last synced: about 1 month ago
JSON representation
👩🔬 Useful set of Liquid filters for XML files composition in Eleventy projects
- Host: GitHub
- URL: https://github.com/jeremenichelli/eleventy-xml-plugin
- Owner: jeremenichelli
- License: mit
- Created: 2019-07-11T20:10:14.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-30T12:52:02.000Z (about 2 months ago)
- Last Synced: 2024-10-11T13:22:22.821Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 11.7 KB
- Stars: 6
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# eleventy-xml-plugin
[![Build Status](https://travis-ci.org/jeremenichelli/eleventy-xml-plugin.svg?branch=master)](https://travis-ci.org/jeremenichelli/eleventy-xml-plugin)
👩🔬 Useful set of Liquid filters for XML files composition in Eleventy projects.
_This plugins automatically adds a set of filters that Jekyll adds to the already built-in ones in Liquid template language to help you compose XML files like RSS feeds or sitemaps._
## Install
```sh
# npm
npm i eleventy-xml-plugin --save# yarn
yarn add eleventy-xml-plugin
```## Add plugin
Include it as a plugin in your [Eleventy](//11ty.io) project.
```js
// .eleventy.js
const xmlFiltersPlugin = require('eleventy-xml-plugin')module.exports = function(eleventyConfig) {
eleventyConfig.addPlugin(xmlFiltersPlugin)
}
```## Filters
### `date_to_rfc822`
Used in RSS feed as a valid publish date format.
```liquid
{{ post.date | 'date_to_rfc822' }}
```### `date_to_xmlschema`
Used in sitemaps as valid last modified date format.
```liquid
{{ page.date | 'date_to_xmlschema' }}
```### `xml_escape`
Used to safely escape HTML entities in XML files.
```liquid
{{ post.data.title | 'xml_escape' }}
```_This filter uses the [html-entities](https://www.npmjs.com/package/html-entities) package under-the-hood_.
## Contributing
To contribute [Node.js](//nodejs.org) and [yarn](//yarnpkg.com) are required.
Before commit make sure to follow [conventional commits](//www.conventionalcommits.org) specification and check all tests pass by running `yarn test`.