A minimal web templating language written in Puppy
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Use + instead of strings.cat

Emmeline fea3300c 885445c8

+8 -8
+8 -8
paw.pup
··· 15 15 ], 16 16 ]; 17 17 18 - _error(msg: str) = throw(strings.cat(["paw error: ", msg])); 18 + _error(msg: str) = throw("paw error: " + msg); 19 19 20 20 _get_path(kind: str, path: str) { 21 21 let path = [conf.dirs[kind], path]; ··· 32 32 if i == 0 { 33 33 d = dirs[0]; 34 34 } else { 35 - d = strings.cat([d, "/", dirs[i]]); 35 + d = d + '/' + dirs[i]; 36 36 } 37 37 if !fs.isdir(d) { 38 38 fs.mkdir(d); ··· 86 86 process_file(path: str) -> str { 87 87 let fp = fs.open(path, "r"); 88 88 if !fp { 89 - _error(strings.cat(["failed to open: ", path])); 89 + _error("failed to open: " + path); 90 90 } 91 91 let text = fs.read(fp, -1); 92 92 fs.close(fp); ··· 94 94 } 95 95 96 96 add_component(name: str) { 97 - let path = _get_path("components", strings.cat([name, ".html"])); 97 + let path = _get_path("components", name + ".html"); 98 98 conf.vars.components[name] = process_file(path); 99 99 } 100 100 ··· 105 105 106 106 let path = _get_path("output", url); 107 107 if strings.find(_basename(path), ".html", 0) == -1 { 108 - path = strings.cat([path, "/index.html"]); 108 + path = path + "/index.html"; 109 109 } 110 110 _mkdirs(_pathname(path)); 111 111 let fp = fs.open(path, "w"); 112 112 if !fp { 113 - _error(strings.cat(["failed to open/create: ", path])); 113 + _error("failed to open/create: " + path); 114 114 } 115 115 fs.write(fp, template); 116 116 fs.close(fp); ··· 118 118 119 119 add_static(path: str) { 120 120 let text = process_file(_get_path("static", path)); 121 - let outpath = _get_path("output", strings.cat([conf.dirs.static, "/", path])); 121 + let outpath = _get_path("output", conf.dirs.static + "/" + path); 122 122 _mkdirs(_pathname(outpath)); 123 123 let fp = fs.open(outpath, "w"); 124 124 if !fp { 125 - _error(strings.cat(["failed to open/create: ", outpath])); 125 + _error("failed to open/create: " + outpath); 126 126 } 127 127 fs.write(fp, text); 128 128 fs.close(fp);