theme-tools icon indicating copy to clipboard operation
theme-tools copied to clipboard

Extension should look for templates relatively or by setting.

Open IngoVals opened this issue 4 years ago • 4 comments

I'm using Webpack to build my theme so I have the liquid files inside a /src/static directory. I keep these static files in the same directory structure as they will be built as.

{% comment %} Inside theme.liquid {% endcomment %}
{% section 'header' %}

So theme-check extension checks my code automatically and gives me a MissingTemplate.

Since this file is located at src/static/layout I would like theme check to look in src/static/sections/header.liquid

If that is not possible maybe a base url setting for the extension for which theme check will be ran in.

IngoVals avatar Oct 14 '21 19:10 IngoVals

I have the same issue.

It seems that the extension is built to only be compatible with flat theme structures.

adrianocr avatar Oct 14 '21 20:10 adrianocr

I guess we could add a .theme-check.yml and set the root to either the '/dist' folder or '/src/static'

This is enabled by the theme check CLI tool that this extension uses under the hood

IngoVals avatar Oct 14 '21 21:10 IngoVals

Yep the way to do this is with .theme-check.yml as you said. What steps did you take to get the extension running? Do you have suggestions on how we could improve our docs (or their discoverability)?

charlespwd avatar Oct 25 '21 18:10 charlespwd

This seems broken when editing a theme from within a VSCode Workspace with many directories. I have my root: . in theme-check.yml but the root it goes to is seemingly the first directory in the workspace. If I open just the theme directory in a new VSCode window it works.

teknolog2000 avatar Jan 23 '23 13:01 teknolog2000