Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.1.0 #151

Merged
merged 8 commits into from
Dec 16, 2024
Merged

v2.1.0 #151

merged 8 commits into from
Dec 16, 2024

Conversation

cossssmin
Copy link
Member

@cossssmin cossssmin commented Nov 29, 2024

New features

You may now pass fileExtension as an Array and the plugin will look for all matching files with those extensions.

For example:

posthtml([
  plugin(
    {
      fileExtension: ['html', 'md'] // looks for both md-layout.html and md-layout.md
    }
  )
])
	.process('`<x-md-layout>test</x-md-layout>`')
	.then(result => result.html)

Note that this is just an example - markdown content isn't parsed, it just reads the file as usual.

This is useful in cases where some components in your project should be sourced directly from files with extensions other than html (because you can't change them or prefer they'd be left unchanged for further processing).

If both md-layout.html and md-layout.md exist in the root folder, the first fileExtension match will be used (in this case, md-layout.html).

@cossssmin cossssmin merged commit c783811 into main Dec 16, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant