ssqch 0.6.2 → 0.6.3

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.
Files changed (2) hide show
  1. package/package.json +5 -5
  2. package/types/index.d.ts +28 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ssqch",
3
3
  "description": "SiteSquatch, a fast static site generator configured with JavaScript",
4
- "version": "0.6.2",
4
+ "version": "0.6.3",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/reverentgeek/sitesquatch#readme",
7
7
  "repository": {
@@ -74,9 +74,9 @@
74
74
  "node": ">=18"
75
75
  },
76
76
  "optionalDependencies": {
77
- "@ssqch/darwin-arm64": "0.6.2",
78
- "@ssqch/darwin-x64": "0.6.2",
79
- "@ssqch/linux-x64": "0.6.2",
80
- "@ssqch/win32-x64": "0.6.2"
77
+ "@ssqch/darwin-arm64": "0.6.3",
78
+ "@ssqch/darwin-x64": "0.6.3",
79
+ "@ssqch/linux-x64": "0.6.3",
80
+ "@ssqch/win32-x64": "0.6.3"
81
81
  }
82
82
  }
package/types/index.d.ts CHANGED
@@ -230,5 +230,32 @@ export function defineConfig<T extends Config | ((context: ConfigContext) => May
230
230
  export function markdown(text: string, options?: { inline?: boolean }): string;
231
231
  /** Read a JSON, YAML or TOML file (from the project root) into data: `readData("src/_data/sites/en.yml")`. */
232
232
  export function readData(path: string): any;
233
- const ssqch: { defineConfig: typeof defineConfig; markdown: typeof markdown; readData: typeof readData };
233
+ /** A file that `files()` found. */
234
+ export interface FoundFile {
235
+ /** From the project root, with `/`: `"images/albums/v1/20011222_08.JPG"`. */
236
+ path: string;
237
+ /** Where a passthrough copy to the same path is served: from the input folder when the file is inside it (`src/images/a.jpg` is `/images/a.jpg`), otherwise from the project root (`/images/albums/v1/20011222_08.JPG`). */
238
+ url: string;
239
+ /** The file name: `"20011222_08.JPG"`. */
240
+ name: string;
241
+ /** The name without its extension: `"20011222_08"`. */
242
+ stem: string;
243
+ /** The extension, lowercase, without the dot: `"jpg"`. */
244
+ ext: string;
245
+ /** From the start of the name (`20011222_08.JPG`, `2001-12-22-camp.jpg`, at midnight UTC), or the file's modification time. */
246
+ date: Date;
247
+ /** Bytes. */
248
+ size: number;
249
+ /** Pixels, with `{ dimensions: true }`; `null` for a file that isn't an image ssqch can read the size of. */
250
+ width?: number | null;
251
+ /** Pixels, with `{ dimensions: true }`; `null` for a file that isn't an image ssqch can read the size of. */
252
+ height?: number | null;
253
+ }
254
+ /** The files a glob matches, from the project root and ignoring case, sorted by path, as data: `files("images/albums/v1/*.{jpg,png}")`. `{ dimensions: true }` reads each image's width and height from its header. No match is an empty list. */
255
+ export function files(pattern: string, options?: { dimensions?: boolean }): FoundFile[];
256
+ /** The `slugify` template filter, for data files: `slugify("Taco Bake", { separator: "_" })` is `"taco_bake"`. Lowercase letters and digits, with `separator` (a dash by default) for each run of anything else. */
257
+ export function slugify(text: string, options?: { separator?: string } | string): string;
258
+ /** A `slugify` that counts, so every slug it makes is different: the first "Misc Pictures" is `misc-pictures`, the next `misc-pictures-1`, then `misc-pictures-2`. Make one per list, in a data file, and store the slug with each item, so a paginated page's permalink and the links to it agree. */
259
+ export function slugger(options?: { separator?: string }): (text: string) => string;
260
+ const ssqch: { defineConfig: typeof defineConfig; markdown: typeof markdown; readData: typeof readData; files: typeof files; slugify: typeof slugify; slugger: typeof slugger };
234
261
  export default ssqch;