@rettangoli/vt 0.0.2-rc2 → 0.0.2-rc3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rettangoli/vt",
3
- "version": "0.0.2-rc2",
3
+ "version": "0.0.2-rc3",
4
4
  "description": "Rettangoli Visual Testing",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -83,7 +83,7 @@
83
83
  <iframe
84
84
  loading="lazy"
85
85
  width="100%"
86
- src="/candidate/{{ file.path }}"
86
+ src="/candidate/{{ file.path | remove_ext }}.html"
87
87
  frameborder="0"
88
88
  style="
89
89
  width: 1080px;
package/src/common.js CHANGED
@@ -47,6 +47,12 @@ engine.registerFilter("slug", (value) => {
47
47
  return value.toLowerCase().replace(/\s+/g, "-");
48
48
  });
49
49
 
50
+ // Add custom filter to remove file extension
51
+ engine.registerFilter("remove_ext", (value) => {
52
+ if (typeof value !== "string") return "";
53
+ return value.replace(/\.[^/.]+$/, "");
54
+ });
55
+
50
56
  /**
51
57
  * Get all files from a directory recursively
52
58
  */