@rettangoli/sites 1.0.1 → 1.0.2

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/README.md CHANGED
@@ -210,7 +210,7 @@ Use VT against your generated site:
210
210
  Docker runtime (recommended for stable Playwright/browser versions):
211
211
 
212
212
  ```bash
213
- IMAGE="han4wluc/rtgl:playwright-v1.57.0-rtgl-v1.0.5"
213
+ IMAGE="han4wluc/rtgl:playwright-v1.57.0-rtgl-v1.1.0"
214
214
  docker pull "$IMAGE"
215
215
  docker run --rm -v "$PWD:/workspace" -w /workspace "$IMAGE" rtgl vt screenshot
216
216
  docker run --rm -v "$PWD:/workspace" -w /workspace "$IMAGE" rtgl vt report
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rettangoli/sites",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Generate static sites using Markdown and YAML for docs, blogs, and marketing sites.",
5
5
  "author": {
6
6
  "name": "Luciano Hanyon Wu",
@@ -177,6 +177,10 @@ function mdImpl(content) {
177
177
  };
178
178
  }
179
179
 
180
+ function defaultImpl(value, fallbackValue = '') {
181
+ return value == null || value === '' ? fallbackValue : value;
182
+ }
183
+
180
184
  export const builtinTemplateFunctions = {
181
185
  encodeURI: (value) => encodeURI(String(value ?? '')),
182
186
  encodeURIComponent: (value) => encodeURIComponent(String(value ?? '')),
@@ -188,6 +192,7 @@ export const builtinTemplateFunctions = {
188
192
  sort: sortImpl,
189
193
  chunk: chunkImpl,
190
194
  md: mdImpl,
195
+ default: defaultImpl,
191
196
  toQueryString,
192
197
  };
193
198