triển khai drupal để làm FE
This commit is contained in:
@@ -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}`);
|
||||
});
|
||||
Reference in New Issue
Block a user