triển khai drupal để làm FE

This commit is contained in:
NAS\NASPC
2026-05-27 09:01:38 +07:00
parent 6bdc2aa18f
commit 8b06a94852
242 changed files with 35975 additions and 21294 deletions
+17
View File
@@ -0,0 +1,17 @@
const fs = require('fs');
const path = require('path');
const layoutDir = path.join(__dirname, 'sis_theme', 'templates', 'layout');
const files = fs.readdirSync(layoutDir).filter(f => f.startsWith('page--') && f.endsWith('.html.twig'));
files.forEach(file => {
const filePath = path.join(layoutDir, file);
let content = fs.readFileSync(filePath, 'utf8');
// Replace paths like src="./UMass Amherst _ UMass Amherst_files/image.jpg"
// or url('./UMass Amherst _ UMass Amherst_files/image.jpg')
content = content.replace(/\.\/[^/]+_files\//g, "{{ directory }}/images/umass/");
fs.writeFileSync(filePath, content);
console.log(`Updated paths in ${file}`);
});