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

Plugins and Lifecycle #665

Open
jdcauley opened this issue May 29, 2021 · 3 comments
Open

Plugins and Lifecycle #665

jdcauley opened this issue May 29, 2021 · 3 comments

Comments

@jdcauley
Copy link

In issue #664 I mentioned how nice it could be to support plugins via possibly lifecycle hooks.

I'm opening this issue to continue the discussion.

Use Cases

  • Manipulating content markup in bulk to add attribute, convert images etc.
  • fetching offsite resources (content apis)
  • Will extend this list as we move on

11ty provides a plugin model that could be evaluated for its merits, the biggest frustration I had with 11ty is that it was very extendable but the initial start up curve was steeper than I expected.

Being able to start with something simple and light weight as starting a harp project but being able to also implement plugin capabilities would make it hard to be in my opinion.

@jdcauley
Copy link
Author

With the right lifecycle hooks issues like #517 could be more rapidly addressed and evaluated.

Additionally, in the above case having lifecycle hooks could let folks start with sensible defaults and replace some operations if they would prefer operations to preform differently than the default

@sintaxi
Copy link
Owner

sintaxi commented May 30, 2021

@jdcauley Thanks for starting this discussion. I definitely think there are things we can do.

I like your idea of starting with the use cases...

  • generating/content markup (eg. nav generator, sitemap generator)
  • processing existing markup (eg, adding classes internationalization)
  • fetching offsite resources (eg. docs that fetch markdown from github repo)
  • processing images (eg. compressing pngs for smaller payloads)
  • processing css output (eg. autoprefixer)
  1. ESbuild will give us lots of this for free we just need to expose some easy to use flags with sane defaults
  2. PostCSS seems like the way to go. I recently removed it from terraform but it should be added back in a way that makes it easy to extend if one wants to. Finding a golden path with tailwind I think is important here.
  3. A plugin system for crating template functions makes sense so it can be called the same way we call partial()
  4. We can expose a way to processing the output of any file type. Is String or Buffer the way to go here? Not sure.

Thats all I got for now. The most important thing to me is harp remains small and is good enough without the use of any plugins or extensions.

It might be helpful to make a list of all the most popular plugins from other systems (by number of downloads). Is that something you want to take on?

@jdcauley
Copy link
Author

Example integrations/customizations file for an 11ty build: https://github.com/jdcauley/eleventy-starter-ghost/blob/master/.eleventy.js

I know this might sound insane, but I genuinely think that WordPress' hooks system would not be a bad way to think about these types of manipulations.

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

No branches or pull requests

2 participants