isite 2024.5.15 → 2024.5.16
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.
package/lib/parser.js
CHANGED
|
@@ -300,6 +300,11 @@ module.exports = function init(req, res, ____0, route) {
|
|
|
300
300
|
|
|
301
301
|
function getContent(name) {
|
|
302
302
|
let path = null;
|
|
303
|
+
let hide = false;
|
|
304
|
+
if (name.startsWith('#')) {
|
|
305
|
+
hide = true;
|
|
306
|
+
name = name.replace('#', '');
|
|
307
|
+
}
|
|
303
308
|
|
|
304
309
|
if (!path || !____0.isFileExistsSync(path)) {
|
|
305
310
|
let arr = name.split('/');
|
|
@@ -314,7 +319,9 @@ module.exports = function init(req, res, ____0, route) {
|
|
|
314
319
|
|
|
315
320
|
if (!____0.isFileExistsSync(path)) {
|
|
316
321
|
let arr = name.split('/');
|
|
317
|
-
if (arr.length ===
|
|
322
|
+
if (arr.length === 1) {
|
|
323
|
+
path = ____0.path.join(route.parserDir, arr[0]);
|
|
324
|
+
} else if (arr.length === 2) {
|
|
318
325
|
path = ____0.path.join(____0.path.dirname(route.parserDir), 'apps', arr[0], 'site_files', ____0.path.extname(arr[1]).replace('.', ''), arr[1]);
|
|
319
326
|
} else if (arr.length === 3) {
|
|
320
327
|
path = ____0.path.join(____0.path.dirname(route.parserDir), 'apps', arr[0], 'site_files', ____0.path.extname(arr[2]).replace('.', ''), arr[1], arr[2]);
|
|
@@ -352,6 +359,9 @@ module.exports = function init(req, res, ____0, route) {
|
|
|
352
359
|
} else if (name.endsWith('.js')) {
|
|
353
360
|
let txt = ____0.readFileSync(path);
|
|
354
361
|
txt = parser.js(txt);
|
|
362
|
+
if (hide) {
|
|
363
|
+
txt = ____0.hide(txt);
|
|
364
|
+
}
|
|
355
365
|
return txt;
|
|
356
366
|
} else if (name.endsWith('.css')) {
|
|
357
367
|
let txt = ____0.readFileSync(path);
|
|
@@ -359,6 +369,9 @@ module.exports = function init(req, res, ____0, route) {
|
|
|
359
369
|
return txt;
|
|
360
370
|
} else {
|
|
361
371
|
let txt = ____0.readFileSync(path);
|
|
372
|
+
if (hide) {
|
|
373
|
+
txt = ____0.hide(txt);
|
|
374
|
+
}
|
|
362
375
|
return txt;
|
|
363
376
|
}
|
|
364
377
|
}
|