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

Implementing code-less metadata updater and updating dependencies #15

Merged
merged 1 commit into from
Jan 30, 2022

Conversation

liarco
Copy link
Member

@liarco liarco commented Jan 30, 2022

The new TemplatedMetadataUpdater allows to deploy this solution without touching a single line of code in most of the cases (even when shuffling the tokens).

Usage

The new METADATA_TEMPLATE env variable can be set to null (metadata is kept as is) or a JSON object that is used in order to update the metadata for each token.

Some placeholder keys are also provided for dynamic replacement:

  • {TOKEN_ID}
  • {INT_TOKEN_ID}: a value matching this string exactly will be replaced with the token ID as an integer value
  • {ASSET_URI}: please remember that the "image" key is already replaced by default!
    TemplatedMetadataUpdater

Example:

In a collection where tokens have been shuffled (e.g. token number 1234 becomes 5678), you may have the need to update that ID in some properties such as name.

Original metadata:

{
  ..
  "name": "My awesome token (#1234)"
  ..
}

Metadata template:

{
  "name": "My awesome token (#{TOKEN_ID})"
}

App output:

{
  ..
  "name": "My awesome token (#4567)"
  ..
}

@liarco liarco merged commit 95e4389 into main Jan 30, 2022
@liarco liarco deleted the generic-metadata-updater branch January 30, 2022 20:12
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.

None yet

1 participant