GithubHelp home page GithubHelp logo

fluid-project / eleventy-plugin-fluid Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 3.0 809 KB

Eleventy plugin which provides common filters, shortcodes and transforms for Fluid Project websites.

License: BSD 3-Clause "New" or "Revised" License

JavaScript 95.88% Shell 0.34% CSS 0.62% SCSS 0.25% Nunjucks 2.91%
eleventy-filter eleventy-plugin eleventy-shortcode eleventy-transform

eleventy-plugin-fluid's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar greatislander avatar jobara avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eleventy-plugin-fluid's Issues

Assess and update for Eleventy 1.0 compatibility

Is your feature request related to a problem?

Eleventy 1.0 is out. There are a few breaking changes.

Describe the solution you'd like

We should assess this project and update it to use the new version.

Describe alternative solutions you've considered

Not applicable.

Additional context or notes

Not applicable.

Allow i18n features to be disabled

Is your feature request related to a problem?

Users should be able to fully disable i18n features.

Describe the solution you'd like

An i18n option key, defaulting to true, could be set to false to prevent the eleventy-plugin-i18n-gettext from being loaded. The built in Eleventy i18n plugin could be maintained with the default language but there would no longer be a requirement to include a _locales directory in the project source.

Describe alternative solutions you've considered

Not applicable.

Additional context or notes

Not applicable.

Document Node requirements

It seems that now that we're using structuredClone node 16 is no longer supported. If this isn't documented in the eleventy-fluid-plugin we should probably do that there. For here it would also probably help to add docs to the README about how to make use of this file .nvmrc. To get the supported version of node for the project.

Originally posted by @jobara in fluid-project/floeproject.org#309 (comment)

Add figure shortcode

Is your feature request related to a problem?

Markdown doesn't support <figure> and <figcaption> tags, and we often need to use them in our guides and websites.

Describe the solution you'd like

An Eleventy shortcode should be provided.

Describe alternative solutions you've considered

Not applicable.

Additional context or notes

See example implementation here: inclusive-design/guide.inclusivedesign.ca@62bcbf3

Notes on alt text vs <figcaption>: https://thoughtbot.com/blog/alt-vs-figcaption

Allow the markdown filter to take in options

Is your feature request related to a problem?

I'd like to be able to turn on the typographer setting for markdown-it; however, there is no way to modify the configuration used by the file.r

Describe the solution you'd like

Allow the filter to take in configuration to merge/override the default configuration supplied by the filter. Additionally, the default configuration should be documented.

markdown-it configuration

Also 11ty 1.0 will come with a Render plugin that may make this shortcode unnecessary.

Pre-Release peerDependencies break in NPM 7+

Describe the bug

This plugin includes a peerDependency on Infusion 4.x. However, Infusion 4 has not had a stable release and has only published dev releases. NPM 7 and higher will automatically try to install peerDependencies; however, it throws the following error.

ERESOLVE overriding peer dependency
npm WARN While resolving: [email protected]
npm WARN Found: infusion@undefined
npm WARN node_modules/infusion
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer infusion@"4.x" from [email protected]
npm WARN node_modules/eleventy-plugin-fluid
npm WARN   eleventy-plugin-fluid@"0.3.1" from the root project
npm ERR! code ETARGET
npm ERR! notarget No matching version found for [email protected].
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

see: npm/cli#2087

To reproduce

Steps to reproduce the behavior:

  1. Ensure you're running NPM 7 or higher
  2. run npm install eleventy-plugin-fluid to install the package
  3. Notice the error mentioned above

Expected behavior

The package installs correctly.

Additional context or notes

Peer Dependencies

Add footnote support to Markdown

Is your feature request related to a problem?

The ability to add footnotes to Markdown content should be supported across our sites.

Describe the solution you'd like

The extended syntax for footnotes should be supported via the markdown-it-footnote plugin.

Describe alternative solutions you've considered

Not applicable.

Additional context or notes

Deprecate custom `slug` filter in favour of Eleventy 1.0's new `slugify` filter

Is your feature request related to a problem?

We added a custom slug filter in this plugin because the built-in slug filter had some issues (it wasn't removing some special characters from slugified URLs). However, this issue has been addressed in Eleventy 1.0 with the addition of a new slugify filter: https://v1-0-0.11ty.dev/docs/filters/slugify/

Describe the solution you'd like

We should swap out our custom slug filter for the new core slugify filter. The easiest way to do this would be to make slug an alias for slugify, which would not necessitate any changes for sites using eleventy-plugin-fluid.

Describe alternative solutions you've considered

Not applicable.

Additional context or notes

See also: https://github.com/11ty/eleventy-upgrade-help

Add HTML minify transform

Is your feature request related to a problem?

We include a default transform in many of our projects which minifies the generated HTML.

Describe the solution you'd like

This transform should be included in the plugin.

Describe alternative solutions you've considered

Not applicable.

Additional context or notes

Not applicable.

Output source maps for CSS, Sass, and JavaScript

Is your feature request related to a problem?

In #164, #168, and #175, the new CSS, Sass, and JavaScript processors support source map generation. However, we need to determine the best way to write these to the filesystem.

Describe the solution you'd like

To be determined.

Describe alternative solutions you've considered

We could remove source map support.

Additional context or notes

Test runner on Windows CI environment has an issue when test and tested files have same name

Describe the bug

The deep-merge.js utility causes a failure on Windows in GitHub Actions if the corresponding test file is called deep-merge.test.js. We haven't figured out why.

To reproduce

Steps to reproduce the behavior:

  1. Rename test/utils.test.js to test/deep-merge.test.js.
  2. Allow CI to run.
  3. See test failure with "Exit 1".

Expected behavior

File names shouldn't cause this issue.

Screenshots

Not applicable.

Additional context or notes

https://github.com/fluid-project/eleventy-plugin-fluid/actions/runs/5520463935/jobs/10067155074?pr=164

Add internationalized date filter

Is your feature request related to a problem?

Currently the formatDate filter formats dates in English. It should support an optional locale parameter to allow internationalized date formats.

Describe the solution you'd like

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

Output: June 21st, 2020

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

Output: 21 juin 2020

Describe alternative solutions you've considered

Not applicable.

Additional context or notes

Related to fluid-project/trivet#148.

figure shortcode injects `<br>` for line breaks.

Describe the bug

The figure shortcode is configured to inject <br> tags when it encounters a line break in the fig caption. The issue is that we may want to use line breaks to enforce readability of the raw Markdown file in source, but not want those included in the rendered HTML.

It appears this is due to configuration set on the Markdown-in markdown renderer.

see: Markdown-It options

Expected behavior

The expectation is that the line breaks within paragraphs in Markdown files are ignored, not injecting <br> tags.

Allow CSS, Sass, and/or JS processing to be disabled

Is your feature request related to a problem?

CSS, Sass, and/or JS processing should be able to be easily disabled for projects which don't require them.

Describe the solution you'd like

Options object should have appropriate keys for CSS, Sass, and JS which can be set to false to disable the functionality.

Describe alternative solutions you've considered

Not applicable.

Additional context or notes

Not applicable.

Add fluid.css to uioStyles shortcode

Describe the bug

UI Options requires some styling from framework/core/css/fluid.css in order to apply certain UIO styles. For example, focus contrast styling requires fl-focus which is a style found in fluid.css.

Otherwise it is up to the integrator to understand this relationship and to manually include fluid.css.

Markdown filter causes issues in dependent projects

Is your feature request related to a problem?

The Markdown filter seems to be causing console errors in projects. This is probably because it loads Eleventy's Markdown template engine in an unsupported way.

Describe the solution you'd like

The filter should be deprecated, and instead the plugin should offer an enhanced Markdown configuration which can be used in dependant projects (along the lines of this: https://github.com/nhoizey/eleventy-plugin-pack11ty/blob/main/_11ty/markdown.js).

Describe alternative solutions you've considered

Not applicable.

Additional context or notes

Existing implementations

Add multilingual UIO

Is your feature request related to a problem?

The new multilingual UIO support added in fluid-project/trivet#148 should be moved here.

Describe the solution you'd like

Ability for UIO initialization shortcode to accept a language code and direction (ltr or rtl) and initialize UIO in that language.

Describe alternative solutions you've considered

Not applicable.

Additional context or notes

UIO needs to fall back to the default locale if a requested locale is not available.

Add basic parse transform

Is your feature request related to a problem?

We include a default parse transform which enables native lazy-loading of images in the main content area.

Describe the solution you'd like

This parse transform should be included in the plugin.

Describe alternative solutions you've considered

Not applicable.

Additional context or notes

Not applicable.

generatePermalink should work if content is not in a language directory

Describe the bug

Right now the generatePermalink utility tries to determine the content language:

const lang = EleventyI18nPlugin.LangUtils.getLanguageCodeFromInputPath(data.page.inputPath);

However, this should be done in directory data files and passed to the helper in the data object so that the generatePermalink utility works even when there is only one (default) language.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.