Skip to content

Pod template folder can only contain text files #821

Closed

Description

@jvherweg

The TemplatedResourcesGenerator tries to interpret every file in the template folder as a string and feed it into the templating engine: https://github.com/solid/community-server/blob/e43b579ae7a14a0b7be5c89545922346c7fb3833/src/pods/generate/TemplatedResourcesGenerator.ts#L153

This goes wrong if the file is a non-text file such as an image. The templating engine should only be called on text-based files, or perhaps even only on files that are indicated to be a template.

We could just catch the error there and return the raw file in case of error. Or we could check the content-type, but then we need a list of supported types. Or we could use a specific extension for files that need te be templated so they can easily be recognized, such as card.ttl.hbs.

Activity

  1. added
    🐛 bug
    on Jul 19, 2021
  2. RubenVerborgh commented on Jul 19, 2021

    @RubenVerborgh
    Member

    I'd go for the recognized extension, and then strip it off.

  3. added this to the v1.0.0 milestone on Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions