lib/pathGenerators
Esta página aún no está disponible en tu idioma.
Functions
Section titled “Functions”ensureHtmlExtension()
Section titled “ensureHtmlExtension()”function ensureHtmlExtension(path: string): string
Defined in: studiocms/packages/studiocms/src/lib/pathGenerators.ts:65
Add ‘.html’ extension to a path.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string
ensureLeadingAndTrailingSlashes()
Section titled “ensureLeadingAndTrailingSlashes()”function ensureLeadingAndTrailingSlashes(href: string): string
Defined in: studiocms/packages/studiocms/src/lib/pathGenerators.ts:29
Ensure the passed path starts and ends with slashes.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string
ensureLeadingSlash()
Section titled “ensureLeadingSlash()”function ensureLeadingSlash(href: string): string
Defined in: studiocms/packages/studiocms/src/lib/pathGenerators.ts:15
Ensure the passed path starts with a leading slash.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string
ensureTrailingSlash()
Section titled “ensureTrailingSlash()”function ensureTrailingSlash(href: string): string
Defined in: studiocms/packages/studiocms/src/lib/pathGenerators.ts:22
Ensure the passed path ends with a trailing slash.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string
fileWithBase()
Section titled “fileWithBase()”function fileWithBase(path: string): string
Defined in: studiocms/packages/studiocms/src/lib/pathGenerators.ts:9
Get the a root-relative file URL path with the site’s base
prefixed.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string
pathWithBase()
Section titled “pathWithBase()”function pathWithBase(path: string): string
Defined in: studiocms/packages/studiocms/src/lib/pathGenerators.ts:2
Get the a root-relative URL path with the site’s base
prefixed.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string
stripHtmlExtension()
Section titled “stripHtmlExtension()”function stripHtmlExtension(path: string): string
Defined in: studiocms/packages/studiocms/src/lib/pathGenerators.ts:59
Remove the extension from a path.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string
stripLeadingAndTrailingSlashes()
Section titled “stripLeadingAndTrailingSlashes()”function stripLeadingAndTrailingSlashes(href: string): string
Defined in: studiocms/packages/studiocms/src/lib/pathGenerators.ts:51
Ensure the passed path does not start and end with slashes.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string
stripLeadingSlash()
Section titled “stripLeadingSlash()”function stripLeadingSlash(href: string): string
Defined in: studiocms/packages/studiocms/src/lib/pathGenerators.ts:37
Ensure the passed path does not start with a leading slash.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string
stripTrailingSlash()
Section titled “stripTrailingSlash()”function stripTrailingSlash(href: string): string
Defined in: studiocms/packages/studiocms/src/lib/pathGenerators.ts:44
Ensure the passed path does not end with a trailing slash.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string