Skip to content

Preview/shopify theme #63

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .coderabbit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
reviews:
path_filters: ["**/*","*.*"]
Comment on lines +1 to +2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix YAML formatting and simplify redundant path patterns.

The configuration has several formatting issues and redundant patterns:

  1. Missing space after comma in the array
  2. Missing newline at end of file
  3. The pattern *.* is redundant since **/* already matches all files

Apply this diff to fix the formatting and simplify the configuration:

 reviews:
-  path_filters: ["**/*","*.*"]
+  path_filters: ["**/*"]
+
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
reviews:
path_filters: ["**/*","*.*"]
reviews:
path_filters: ["**/*"]
🧰 Tools
🪛 YAMLlint (1.37.1)

[warning] 2-2: too few spaces after comma

(commas)


[error] 2-2: no new line character at the end of file

(new-line-at-end-of-file)

🤖 Prompt for AI Agents
In .coderabbit.yml at lines 1 to 2, fix the YAML formatting by adding a space
after the comma in the path_filters array, remove the redundant pattern '*.*'
since '**/*' already matches all files, and ensure there is a newline at the end
of the file. This will simplify the configuration and correct formatting issues.

3 changes: 3 additions & 0 deletions .theme-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Explicitly enable all checks (by default, all are enabled)
checks:
all: true
8 changes: 8 additions & 0 deletions assets/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* CSS with deliberate issues */
body {
font-family: Arial sans-serif /* Missing comma between fonts and no semicolon */
color: #333
}
Comment on lines +2 to +5
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix CSS syntax errors in body selector.

The body selector has multiple syntax issues that will prevent proper styling:

  • Missing comma between font names in font-family
  • Missing semicolons after declarations

Apply this diff to fix the syntax:

 body {
-  font-family: Arial sans-serif    /* Missing comma between fonts and no semicolon */
-  color: #333
+  font-family: Arial, sans-serif;
+  color: #333;
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
body {
font-family: Arial sans-serif /* Missing comma between fonts and no semicolon */
color: #333
}
body {
font-family: Arial, sans-serif;
color: #333;
}
🧰 Tools
🪛 Biome (1.9.4)

[error] 4-4: Unexpected value or character.

Expected one of:

(parse)

🤖 Prompt for AI Agents
In assets/style.css around lines 2 to 5, fix the CSS syntax errors in the body
selector by adding a comma between "Arial" and "sans-serif" in the font-family
property and adding semicolons at the end of both the font-family and color
declarations to ensure proper CSS syntax.

.invalid-selector {
--unknown: 123 /* Invalid property/value syntax */
}
6 changes: 6 additions & 0 deletions assets/theme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// JavaScript with syntax errors
function initTheme() {
console.log("Initializing theme... // Missing closing quote and parenthesis
}

initTheme();
13 changes: 13 additions & 0 deletions config/settings_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"name": "General",
"settings": [
{
"type": "text",
"id": "title",
"label": "Store Title",
"default": "My Shopify Store",
} // Trailing comma causes invalid JSON
]
}
]
14 changes: 14 additions & 0 deletions layout/theme.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{{ page_title </title> {# Missing closing curly brace and invalid Liquid tag #}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix critical syntax error in title tag

The title tag has invalid syntax with a missing closing }} and an incorrect comment format. This is causing HTML parsing errors.

-  <title>{{ page_title </title>  {# Missing closing curly brace and invalid Liquid tag #}
+  <title>{{ page_title }}</title>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<title>{{ page_title </title> {# Missing closing curly brace and invalid Liquid tag #}
<title>{{ page_title }}</title>
🤖 Prompt for AI Agents
In layout/theme.liquid at line 5, the title tag contains a syntax error due to a
missing closing curly brace for the Liquid variable and an invalid comment
format. Fix this by adding the missing closing `}}` to properly close the Liquid
expression and remove or correct the comment to use valid Liquid comment syntax
if needed.

{{ 'style.css' | asset_url | stylesheet_tag }}
</head>
<body>
{% include 'header' %} {# Assume this is meant to call a section/snippet but syntax might be off #}
{{ content_for_layout }
{% include 'footer' %}
Comment on lines +9 to +11
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix syntax error and use 'render' instead of deprecated 'include'

Multiple issues in this section:

  1. Line 10 is missing closing }}
  2. Both header and footer are using deprecated include tags
-  {% include 'header' %}  {# Assume this is meant to call a section/snippet but syntax might be off #}
-  {{ content_for_layout }
-  {% include 'footer' %}
+  {% render 'header' %}
+  {{ content_for_layout }}
+  {% render 'footer' %}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{% include 'header' %} {# Assume this is meant to call a section/snippet but syntax might be off #}
{{ content_for_layout }
{% include 'footer' %}
{% render 'header' %}
{{ content_for_layout }}
{% render 'footer' %}
🤖 Prompt for AI Agents
In layout/theme.liquid around lines 9 to 11, fix the syntax error by adding the
missing closing braces to the content_for_layout variable on line 10. Replace
the deprecated 'include' tags on lines 9 and 11 with 'render' tags to properly
include the header and footer snippets. This will correct the syntax and update
the code to use the current Liquid template conventions.

{{ 'theme.js' | asset_url | script_tag }}
</body>
</html>
5 changes: 5 additions & 0 deletions locales/en.default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"general": {
"welcome": "Welcome to our store!", // Trailing comma causes invalid JSON
}
}
4 changes: 4 additions & 0 deletions sections/footer.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<footer>
<p>© {{ 'now' | date: "%Y" }} My Shopify Store</p>
<p>Contact us at [email protected] {# Missing closing tag or unexpected text #}
</footer>
9 changes: 9 additions & 0 deletions sections/header.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<header>
<h1>{{ settings.title }</h1> {# Missing closing double curly brace on settings.title #}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix missing closing curly brace in settings.title.

The settings.title Liquid expression is missing a closing curly brace, causing a template parsing error.

Apply this diff to fix the syntax:

-  <h1>{{ settings.title }</h1>  {# Missing closing double curly brace on settings.title #}
+  <h1>{{ settings.title }}</h1>  {# Fixed: Added closing curly brace #}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<h1>{{ settings.title }</h1> {# Missing closing double curly brace on settings.title #}
<h1>{{ settings.title }}</h1> {# Fixed: Added closing curly brace #}
🤖 Prompt for AI Agents
In sections/header.liquid at line 2, the Liquid expression {{ settings.title }
is missing a closing curly brace, causing a template parsing error. Add the
missing closing curly brace to complete the expression as {{ settings.title }}
to fix the syntax.

<nav>
<ul>
<li><a href="/collections/all">Products</a></li>
<li><a href="/about-us">About Us</a></li>
<!-- Missing closing </ul> tag -->
</nav>
Comment on lines +4 to +8
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add missing closing ul tag.

The navigation list is missing its closing </ul> tag, which creates invalid HTML structure.

Apply this diff to fix the HTML structure:

   <nav>
     <ul>
       <li><a href="/collections/all">Products</a></li>
       <li><a href="/about-us">About Us</a></li>
-    <!-- Missing closing </ul> tag -->
+    </ul> <!-- Fixed: Added closing ul tag -->
   </nav>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<ul>
<li><a href="/collections/all">Products</a></li>
<li><a href="/about-us">About Us</a></li>
<!-- Missing closing </ul> tag -->
</nav>
<nav>
<ul>
<li><a href="/collections/all">Products</a></li>
<li><a href="/about-us">About Us</a></li>
</ul> <!-- Fixed: Added closing ul tag -->
</nav>
🧰 Tools
🪛 Shopify Theme Check cli (3.77.1) theme (3.58.2)

[error] 8-8: SyntaxError: expected "}}"

(LiquidHTMLSyntaxError)

🤖 Prompt for AI Agents
In sections/header.liquid around lines 4 to 8, the unordered list <ul> is
missing its closing </ul> tag, causing invalid HTML structure. Add the closing
</ul> tag just before the closing </nav> tag to properly close the list and fix
the HTML.

</header>
4 changes: 4 additions & 0 deletions snippets/product-card.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div class="product-card">
<h2>{{ product.title </h2> {# Missing closing curly brace for product.title #}
<p>Price: {{ product.price | money }}</p
Comment on lines +2 to +3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix multiple syntax errors in product card.

The snippet has two syntax errors:

  1. Missing closing curly brace in the product title Liquid expression
  2. Missing closing bracket in the paragraph tag

Apply this diff to fix both issues:

-  <h2>{{ product.title </h2>  {# Missing closing curly brace for product.title #}
-  <p>Price: {{ product.price | money }}</p
+  <h2>{{ product.title }}</h2>  {# Fixed: Added closing curly brace #}
+  <p>Price: {{ product.price | money }}</p> {# Fixed: Added closing bracket #}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<h2>{{ product.title </h2> {# Missing closing curly brace for product.title #}
<p>Price: {{ product.price | money }}</p
<h2>{{ product.title }}</h2> {# Fixed: Added closing curly brace #}
<p>Price: {{ product.price | money }}</p> {# Fixed: Added closing bracket #}
🧰 Tools
🪛 Shopify Theme Check cli (3.77.1) theme (3.58.2)

[error] 3-3: SyntaxError: expected ">"

(LiquidHTMLSyntaxError)

🤖 Prompt for AI Agents
In snippets/product-card.liquid around lines 2 to 3, fix the syntax errors by
adding the missing closing curly brace to the product.title Liquid expression
and by adding the missing closing angle bracket to the paragraph tag to ensure
proper HTML and Liquid syntax.

</div>
8 changes: 8 additions & 0 deletions templates/index.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% section 'header' %}
<main>
<h2>Featured Products</h2>
{% for product in collections.frontpage.products %}
{% include 'product-card' {# Missing closing %} tag #}
Comment on lines +4 to +5
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix syntax error and use 'render' instead of deprecated 'include'

There are two issues here:

  1. The include tag is deprecated in favor of render
  2. Line 5 is missing the closing %} delimiter
-  {% for product in collections.frontpage.products %}
-    {% include 'product-card'  {# Missing closing %} tag #}
+  {% for product in collections.frontpage.products %}
+    {% render 'product-card', product: product %}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{% for product in collections.frontpage.products %}
{% include 'product-card' {# Missing closing %} tag #}
{% for product in collections.frontpage.products %}
{% render 'product-card', product: product %}
🧰 Tools
🪛 Shopify Theme Check cli (3.77.1) theme (3.58.2)

[warning] 4-4: Use the 'render' tag instead of 'include'

(DeprecatedTag)

🤖 Prompt for AI Agents
In templates/index.liquid around lines 4 to 5, replace the deprecated 'include'
tag with 'render' and add the missing closing '%}' delimiter to fix the syntax
error. Change the line to use '{% render 'product-card' %}' ensuring proper
Liquid syntax and updated tag usage.

{% endfor %}
</main>
{% section 'footer' {# Using "section" instead of include for footer, and missing closing %} #}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix syntax error and use correct tag for footer

This line has multiple issues:

  1. Missing closing %} delimiter
  2. Using section tag which should be render for snippets
-{% section 'footer'  {# Using "section" instead of include for footer, and missing closing %} #}
+{% render 'footer' %}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{% section 'footer' {# Using "section" instead of include for footer, and missing closing %} #}
{% render 'footer' %}
🤖 Prompt for AI Agents
In templates/index.liquid at line 8, fix the syntax error by adding the missing
closing `%}` delimiter and replace the incorrect `section` tag with the correct
`render` tag to properly include the footer snippet.

8 changes: 8 additions & 0 deletions templates/product.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% section 'header' %}
<main>
<article>
<h1>{{ product.title }}</h1>
<div>{{ product.description {# Missing closing curly brace #}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix missing closing curly brace in Liquid expression.

The product description output is missing a closing curly brace, causing a template parsing error.

Apply this diff to fix the syntax:

-    <div>{{ product.description  {# Missing closing curly brace #}
+    <div>{{ product.description }}</div> {# Fixed: Added closing braces and div tag #}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div>{{ product.description {# Missing closing curly brace #}
- <div>{{ product.description {# Missing closing curly brace #}
+ <div>{{ product.description }}</div> {# Fixed: Added closing braces and div tag #}
🤖 Prompt for AI Agents
In templates/product.liquid at line 5, the Liquid expression for
product.description is missing a closing curly brace, causing a parsing error.
Add the missing closing curly brace to properly close the expression, changing
{{ product.description to {{ product.description }}.

</article>
</main>
{% section 'footer' %}