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

Spec #1

Open
regisphilibert opened this issue May 5, 2021 · 0 comments
Open

Spec #1

regisphilibert opened this issue May 5, 2021 · 0 comments

Comments

@regisphilibert
Copy link
Member

regisphilibert commented May 5, 2021

The idea behind this module is never to have to worry about the media solution used on any given project.

tnd-media/Get

We should rely on a single partial tnd-media/Get which will retrieve a given asset, process it if transformation are used and return an object

Return

  • Permalink
  • RelPermalink
  • Width
  • Height?
  • MediaType
  • Extensions
  • Alt
  • Title

Note that Width and Height will be useful for SEO metas

Parameters

The partial would take parameters just like the tnd-imgix/GetSRC partial:

  • A lone string (path to retrieve the media info without transformation)
  • A map with
    • src (or path) pointing to the file location within the media storage location
    • any transformation key (width, height etc...)

Logic

The partial will look for tier service setup. (For now only imgix will be supported using the tnd-imgix module)
If found, the service own logic will be used to retrieve to apply transformation and return the resulting permalinks etc...
If no service is found, the partial will use Hugo's own Page Bundle transformation tooling to apply transformations requests (if given method is available and then return the data.

Challenges

Hugo transformation is about different methods. So one needs depending on the list of transformation requests to potentially find the proper method and settings.

Storages

There are three types of storage avaible:

static

With static, transformation is only possible with Imgix and minimal media data can be returned through Get.

assets

With assets, transformations are possible through imgix and hugo.
Documentation should point out that only the media submitted to code (not those simply added to the storage) will be published and there's no way around that.

bundle

With bundle, transformations are possible through imgix and hugo.
Documentation should point out that only the media submitted to code (not those simply added to the storage) will be published unless user set _build options to the given bundle.

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

1 participant