ssqch 0.6.3 → 0.6.5

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 +13 -4
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.3",
4
+ "version": "0.6.5",
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.3",
78
- "@ssqch/darwin-x64": "0.6.3",
79
- "@ssqch/linux-x64": "0.6.3",
80
- "@ssqch/win32-x64": "0.6.3"
77
+ "@ssqch/darwin-arm64": "0.6.5",
78
+ "@ssqch/darwin-x64": "0.6.5",
79
+ "@ssqch/linux-x64": "0.6.5",
80
+ "@ssqch/win32-x64": "0.6.5"
81
81
  }
82
82
  }
package/types/index.d.ts CHANGED
@@ -244,6 +244,8 @@ export interface FoundFile {
244
244
  ext: string;
245
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
246
  date: Date;
247
+ /** Where `date` came from: `"name"`, or `"modified"` (the modification time, which says when the file was copied or edited, not when a photo was taken). */
248
+ dateFrom: "name" | "modified";
247
249
  /** Bytes. */
248
250
  size: number;
249
251
  /** Pixels, with `{ dimensions: true }`; `null` for a file that isn't an image ssqch can read the size of. */
@@ -251,11 +253,18 @@ export interface FoundFile {
251
253
  /** Pixels, with `{ dimensions: true }`; `null` for a file that isn't an image ssqch can read the size of. */
252
254
  height?: number | null;
253
255
  }
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. */
256
+ /** 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, once: they're kept in `.cache/ssqch/image-sizes.json` until the file changes. No match is an empty list. */
255
257
  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
+ /** How `slugify` writes a slug. */
259
+ export interface SlugifyOptions {
260
+ /** Between words: a dash by default, `"_"` for `taco_bake`. */
261
+ separator?: string;
262
+ /** `"drop"` (the default): `Drew's Brownies` is `drews-brownies`. `"separate"`: an apostrophe splits words like other punctuation, `drew-s-brownies`, to keep a site's existing URLs. */
263
+ apostrophes?: "drop" | "separate";
264
+ }
265
+ /** 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. A string is the separator. */
266
+ export function slugify(text: string, options?: SlugifyOptions | string): string;
258
267
  /** 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;
268
+ export function slugger(options?: SlugifyOptions): (text: string) => string;
260
269
  const ssqch: { defineConfig: typeof defineConfig; markdown: typeof markdown; readData: typeof readData; files: typeof files; slugify: typeof slugify; slugger: typeof slugger };
261
270
  export default ssqch;