MCPcopy Create free account
hub / github.com/11ty/dev-server / getUrlsFromFilePath

Method getUrlsFromFilePath

server.js:931–948  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

929 // /resource/ <= /resource/index.html
930 // /resource <= resource.html
931 getUrlsFromFilePath(path) {
932 if(this.dir === ".") {
933 path = `/${path}`
934 } else {
935 path = path.slice(this.dir.length);
936 }
937
938 let urls = [];
939 urls.push(path);
940
941 if(path.endsWith(`/${this.options.indexFileName}`)) {
942 urls.push(path.slice(0, -1 * this.options.indexFileName.length));
943 } else if(path.endsWith(".html")) {
944 urls.push(path.slice(0, -1 * ".html".length));
945 }
946
947 return urls;
948 }
949
950 // returns [{ url, inputPath, content }]
951 getBuildTemplatesFromFilePath(path) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected