Skip to content

Implicit layout value with Express #842

Closed

Description

@malaudha

I'm trying to declare a default layout for each of the visited URLs on my local Express server but can't get it to work. I've tried using several methods and parse the template literal with the {% layout "xx" %} but I never manage to have elements called within the parsed templates to resolve. For instance, parsing a file buttons.html with this content:
{% render 'partials/elements/button' %} fails because it never resolves this path, but when using static HTML code, it works.
I have to admit I have trouble getting my way through the documentation of the methods of the api, so I might have tried random things, but anyone has an idea on how to achieve this?

PS: I am already able to make this work with the {% layout "xx" %} in the template itself, but the whole point is to avoid having to repeat that in every file.

Activity

  1. harttle commented on Jan 6, 2026

    @harttle
    Owner

    Try set a custom fs instance and change the file content when returning to Liquid parser. See https://liquidjs.com/tutorials/render-file.html#Abstract-File-System

  2. Repository owner locked and limited conversation to collaborators on Jan 6, 2026
  3. converted this issue into a discussion #844 on Jan 6, 2026
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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions