Skip to content

Commit

Permalink
feat: Eleventy 1.0 changes (#109)
Browse files Browse the repository at this point in the history
chore(deps-dev): require Eleventy 1.0

feat: deprecate slug filter (fix #94)
BREAKING CHANGE: throw error on use of slug filter instead of slugify
filter

feat: add internationalization support to formatDate (fix #60)

feat: markdown filter inherits base configuration (fix #85)

chore(deps): remove markdown-it dependency
  • Loading branch information
greatislander committed Mar 22, 2022
1 parent 90d2489 commit 4dcfbd0
Show file tree
Hide file tree
Showing 10 changed files with 11,611 additions and 2,272 deletions.
25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ Formats a date string.

Output: `June 21st, 2020`

Optionally, a [`locale` parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation)
can be supplied to format a date in a locale other than English.

```nunjucks
{{ "Sun Jun 21 2020 18:00:00 GMT-0300 (Atlantic Daylight Time)" | formatDate('fr') }}
```

Output: `21 juin 2020`

#### isoDate

Formats a date string to [ISO 8601](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
Expand Down Expand Up @@ -77,16 +86,13 @@ Processes an input string using [Markdown](https://markdown-it.github.io).

Output: `<p>A paragraph with some <em>emphasis</em>.</p>\n`

#### slug
#### slug (deprecated)

Processes an input string by lowercasing it, replacing whitespace with hyphens, and stripping special characters to
create a URL-safe version.

```nunjucks
{{ "Here’s my title!" | slug }};
```

Output: `heres-my-title`
**NOTE: This filter is deprecated and the `slug-filter.js` file has been removed as of eleventy-plugin-fluid 1.0.
Instead, use Eleventy's new [`slugify`](https://www.11ty.dev/docs/filters/slugify/) filter.**

#### split

Expand Down Expand Up @@ -302,11 +308,8 @@ By default, `eleventy-plugin-fluid` copies the [required assets](src/config/uio-
### Releasing

This package uses [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/), enforced with
[commitlint](https://commitlint.js.org/). This facilitates releasing new versions of the package. To cut a release, run:

```bash
npm run release
```
[commitlint](https://commitlint.js.org/). This facilitates releasing new versions of the package via [Release Please](https://github.com/googleapis/release-please).
To cut a release, merge the current [release pull request](https://github.com/google-github-actions/release-please-action#whats-a-release-pr).

This will tag an appropriate [semantic version](https://semver.org) based on the nature of the recent commits to the
project and update [the changelog](CHANGELOG.md).
Expand Down
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const htmlMinifyTransform = require("./src/transforms/html-minify-transform.js")
const isoDateFilter = require("./src/filters/iso-date-filter.js");
const limitFilter = require("./src/filters/limit-filter.js");
const markdownFilter = require("./src/filters/markdown-filter.js");
const slugFilter = require("./src/filters/slug-filter.js");
const splitFilter = require("./src/filters/split-filter.js");
const uioShortcodes = require("./src/shortcodes/uio.js");
const uioAssets = require("./src/config/uio-assets.json");
Expand All @@ -33,7 +32,9 @@ module.exports = {
eleventyConfig.addFilter("isoDate", isoDateFilter);
eleventyConfig.addFilter("limit", limitFilter);
eleventyConfig.addFilter("markdown", markdownFilter);
eleventyConfig.addFilter("slug", slugFilter);
eleventyConfig.addFilter("slug", () => {
throw new Error("`slug` filter is no longer supported. Please use `slugify`.");
});
eleventyConfig.addFilter("split", splitFilter);

eleventyConfig.addPairedShortcode("figure", figureShortcode);
Expand Down
Loading

0 comments on commit 4dcfbd0

Please sign in to comment.