You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @property {boolean} extend extend known unicode symbols with a `{'char': 'replacement'}` object
16
+
* @property {string} [replacement='-'] replace spaces with replacement character, defaults to `-`
17
+
* @property {RegExp} [remove] remove characters that match regex
18
+
* @property {boolean} [lower=true] convert to lower case, defaults to `true`
19
+
* @property {boolean} [strict=false] strip special characters except replacement, defaults to `false`
20
+
* @property {string} [locale] language code of the locale to use
21
+
* @property {boolean} trim trim leading and trailing replacement chars, defaults to `true`
22
+
*/
23
+
24
+
/**
25
+
* @callback slugFunction
26
+
* @param {string} filepath
27
+
* @returns {string} slug
28
+
*/
29
+
30
+
/**
31
+
* Linkset definition
32
+
*
33
+
* @typedef {Object} Linkset
34
+
* @property {boolean} [isDefault] Whether this linkset should be used as the default instead
35
+
* @property {Object.<string,*>} match An object whose key:value pairs will be used to match files and transform their permalinks according to the rules in this linkset
36
+
* @property {string} pattern A permalink pattern to transform file paths into, e.g. `blog/:date/:title`
37
+
* @property {SlugifyOptions|slugFunction} [slug] [Slugify options](https://github.com/simov/slugify) or a custom slug function of the form `(pathpart) => string`
38
+
* @property {string} [date='YYYY/MM/DD'] [Moment.js format string](https://momentjs.com/docs/#/displaying/format/) to transform Date link parts into, defaults to `YYYY/MM/DD`.
* @property {string} [pattern] A permalink pattern to transform file paths into, e.g. `blog/:date/:title`
46
+
* @property {string} [date='YYYY/MM/DD'] [Moment.js format string](https://momentjs.com/docs/#/displaying/format/) to transform Date link parts into, defaults to `YYYY/MM/DD`.
47
+
* @property {boolean|'folder'} [relative=true] When `true` (by default), will duplicate sibling files so relative links keep working in resulting structure. Turn off by setting `false`. Can also be set to `folder`, which uses a strategy that considers files in folder as siblings if the folder is named after the html file.
48
+
* @property {string} [indexFile='index.html'] Basename of the permalinked file (default: `index.html`)
49
+
* @property {boolean|Function} [unique] Set to `true` to add a number to duplicate permalinks (default: `false`), or specify a custom duplicate handling callback of the form `(permalink, files, file, options) => string`
50
+
* @property {boolean} [duplicatesFail=false] Set to `true` to throw an error if multiple file path transforms result in the same permalink. `false` by default
51
+
* @property {Linkset[]} [linksets] An array of additional linksets
52
+
* @property {SlugifyOptions|slugFunction} [slug] [Slugify options](https://github.com/simov/slugify) or a custom slug function of the form `(pathpart) => string`
53
+
*/
54
+
55
+
/** @type {Options} */
56
+
constdefaultOptions={
57
+
pattern: null,
58
+
date: 'YYYY/MM/DD',
59
+
slug: {lower: true},
60
+
relative: true,
61
+
indexFile: 'index.html',
62
+
unique: false,
63
+
duplicatesFail: false,
64
+
linksets: [],
65
+
}
66
+
11
67
/**
12
68
* Maps the slugify function to slug to maintain compatibility
0 commit comments